# .NET Math Library

## Works with all .NET languages, including C#, Visual Basic, and F#.  The NMath .NET math library contains foundational classes for object-oriented numerics on the .NET platform.

• Linear Programming
• Random Number Generators
• Fast Fourier Transforms
• Vector Random Numbers

# Summary of NMath Features

Basic Math

• Single- and double-precision complex number classes.
• Random number generators for various probability distributions, independent streams of random numbers using skip-ahead and leapfrog methods, and quasirandom sequences using Niederreiter and Sobol methods.
• Fast Fourier Transforms (FFTs), Wavelets, and linear convolution and correlation.
• Special functions, such factorial, binomial, the gamma function and related functions, Bessel functions, elliptic integrals, and many more.

Linear Algebra

• Full-featured vector and matrix classes for four datatypes: single- and double-precision floating point numbers, and single- and double-precision complex numbers.
• Flexible indexing using slices and ranges.
• Overloaded arithmetic operators with their conventional meanings for those .NET languages that support them, and equivalent named methods (`Add()`, `Subtract()`, and so on) for those that do not.
• Full-featured structured sparse matrix classes, including triangular, symmetric, Hermitian, banded, tridiagonal, symmetric banded, and Hermitian banded.
• Functions for converting between general matrices and structured sparse matrix types.
• Functions for transposing structured sparse matrices, computing inner products, and calculating matrix norms.
• Classes for factoring structured sparse matrices, including LU factorization for banded and tridiagonal matrices, Bunch-Kaufman factorization for symmetric and Hermitian matrices, and Cholesky decomposition for symmetric and Hermitian positive definite matrices. Once constructed, matrix factorizations can be used to solve linear systems and compute determinants, inverses, and condition numbers.
• General sparse vector and matrix classes, and matrix factorizations.
• Orthogonal decomposition classes for general matrices, including QR decomposition and singular value decomposition (SVD).
• Advanced least squares factorization classes for general matrices, including Cholesky, QR, and SVD.
• LU factorization for general matrices, as well as functions for solving linear systems, computing determinants, inverses, and condition numbers.
• Classes for solving symmetric, Hermitian, and nonsymmetric eigenvalue problems.
• Extension of standard mathematical functions, such as Cos(), Sqrt(), and Exp(), to work with vectors, matrices, and complex number classes.

Functions

• Classes for encapsulating functions of one variable, with support for numerical integration (Romberg and Gauss-Kronrod methods), differentiation (Ridders' method), and algebraic manipulation of functions.
• Polynomial encapsulation, interpolation, and exact differentiation and integration.
• Classes for minimizing univariate functions using golden section search and Brent's method.
• Classes for minimizing multivariate functions using the downhill simplex method, Powell's direction set method, the conjugate gradient method, and the variable metric (or quasi-Newton) method.
• Simulated annealing.
• Linear Programming (LP), Non-Linear Programming (NLP), and Quadratic Programming (QP) using the Microsoft Solver Foundation.
• Least squares polynomial fitting.
• Nonlinear least squares minimization, curve fitting, and surface fitting.
• Classes for finding roots of univariate functions using the secant method, Ridders' method, and the Newton-Raphson method.
• Numerical methods for double integration of functions of two variables.
• Nonlinear least squares minimization using the Trust-Region method, a variant of the Levenberg-Marquardt method.
• Curve and surface fitting by nonlinear least squares.
• Classes for solving first order initial value differential equations by the Runge-Kutta method.

Integration with .NET Standard Libraries

• Fully persistable data classes using standard .NET mechanisms.