Theoretica
A C++ numerical and automatic mathematical library
Theoretica

GitHub last commit GitHub Workflow Status Codacy Badge Documentation License

A C++ math library for scientific computing with a simple and elegant interface.

Theoretica provides methods for scientific computing, statistical analysis of experimental data and numerical approximations. The aim of the project is to give simple and immediate access to powerful algorithms for scientific and engineering software and graphical applications. The library is tested using Chebyshev, a unit testing framework specifically developed for scientific and numerical software.

Table of Contents


Features

Some features of the library include:

  • Cross-platform with x86 and OpenMP enhancements
  • Common real and complex functions
  • Numerical Linear Algebra
  • Complex numbers (algebraic & exponential form) and quaternions
  • Numerical calculus, from integrals to ODEs
  • Multivariate Automatic Differentiation with differential operators
  • Descriptive and inferential statistics and Monte Carlo methods
  • Bezier curves and spline interpolation

Theoretica is constantly developed and improved with new ideas!

Setup

Theoretica is a header-only library and has no dependencies, so you can include it in your projects straight-away! You can build all tests and example programs by running make all in the main folder, ensuring that it works on your machine. When using the library, you can include single headers or use theoretica.h which includes all library headers (you can define THEORETICA_INCLUDE_BASE to make it include only fundamental headers).

Quickstart

You can compile this simple code to check your setup:

#include "theoretica.h"
using namespace th;
int main() {
// Declare a 3D vector
vec3 v = {1, 2, 3};
// Create a 3x3 identity matrix
// Transform v by A
vec3 w = A * v;
}
static mat< Type, N, K > identity()
Get the identity matrix.
Definition: mat.h:595
Main namespace of the library which contains all functions and objects.
Definition: algebra.h:27
vec< real, 3 > vec3
A 3-dimensional vector with real elements.
Definition: algebra_types.h:42
mat< real, 3, 3 > mat3
A 3x3 matrix with real entries.
Definition: algebra_types.h:20
General include file.

Examples

The examples folder contains simple programs that showcase usage of the library:

Documentation

The documentation for the project is available at this link. The documentation is written using Doxygen syntax alongside the source code and the website is automatically updated on each commit. The HTML documentation is also available for download in the gh-pages branch. The bibliography used during research for the library is listed in BIBLIOGRAPHY.md. You may learn more about the design choices behind the library reading the Software Specification.

Contributing

Contributions are welcome and appreciated! Have a look at the Contributing Guide to learn more about how you can help. Contributions include writing code and documentation, testing and researching algorithms.

Workflow

Test on Linux Test on Windows Test on MacOS

Theoretica uses automated workflows for recurring tasks. On each commit to master, tests are run on Linux, Windows and MacOS, benchmarks are launched and documentation is built and deployed to the online website. This ensures that the library works correctly and the documentation is always up-to-date.

License

The project is currently under the GNU Lesser General Public License 3.0. You may learn more about it here.