NuMath is a C++ shared library that implements several numerical methods.
Right now it implements the following methods:
-
Single variable equations
- Incremental search
- Bisection
- Flase position
- Fixed point
- Newton
- Secant
- Multiple roots
-
Systems of equations
- Simple gaussian elimination
- Gaussian elimination with partial pivoting
- Gaussian elimination with total pivoting
- Doolittle Factorization
- Crout Factorization
- Cholesky Factorization
- Gauss-Seidel
- Jacobi
-
Interpolation
- Newton
- Lagrage
- Linear splines
- Quadratic splines
- Cubic splines
-
Numerical Diferentiation
- With 2 points
- With 3 points
- With 5 points
-
Numerical Integration
- General Trapezium
- General Simpson 1/3
- General Simpson 3/8
First, clone the repository using:
git clone https://github.com/rvillegasm/NuMath.git
Make sure that you have the following dependencies installed in your system:
- A C++ compiler that supports OpenMP and C++11 standards (like gcc).
- The GNU make tool.
- The CMake tool.
In the NuMath root directory, create a build directory:
mkdir build
cd build
Then run CMake and compile using Make:
cmake ..
make
That will compile the library and create a shared object in the build/lib
directory.
After that, install it in your system with:
sudo make install
sudo ldconfig
By doing this you will have NuMath available in your system as libnumath.
To use NuMath simply include the header file in your C++ file:
#include "numath.h"
int main() {
// ... your code goes here
}
Every numerical method is located inside the numath::<method_category>
namespace, so in order to use the lagrange interpolation method, you would have to call:
numath::interpolation::lagrange(/*Arguments*/);
Check out the documentation of every method to know theirs parameters, as well as what they return.