

It is important to note that this package is divided into different sub-packages, regarding of the kind of geometry we want to use: As its name states it, LUDecomposition relies on the LU decomposition, and thus works only with square matrices.įor other matrices, different solvers exist, usually solving the equation using the least square method. Then, we create an LUDecomposition which provides a solver for equations under the form AX = B. The case is pretty straightforward: we define a matrix a from an array of array of doubles, and a vector b from an array of a vector. New double ,ĭecompositionSolver solver = new LUDecomposition(a).getSolver() If we have a linear system of equations under the form AX = B where A is a matrix of real numbers, and B a vector of real numbers – Commons Math provides structures to represent both the matrix and the vector, and also provide solvers to find the value of X: RealMatrix a = new Array2DRowRealMatrix( Statistics, Probabilities, and Randomness 3.special – special functions (Gamma, Beta).3.util – common math/stat functions extending.

