diff --git a/src/site/xdoc/userguide/linear.xml b/src/site/xdoc/userguide/linear.xml index 7319885cd..69be4642e 100644 --- a/src/site/xdoc/userguide/linear.xml +++ b/src/site/xdoc/userguide/linear.xml @@ -42,9 +42,7 @@
- The solve()
methods of the DecompositionSolver
interface
+ The solve()
methods of the DecompositionSolver
class
support solving linear systems of equations of the form AX=B, either in linear sense
or in least square sense. In each case, the RealMatrix
represents the
coefficient matrix of the system. For example, to solve the linear system
@@ -103,19 +102,20 @@ RealMatrix pInverse = new LUDecompositionImpl(p).inverse();
-x + 7y + 6x = -2
4x - 3y - 5z = 1
- Start by creating a RealMatrix to store the coefficients matrix A
+ Start by creating a RealMatrix to store the coefficients matrix A and provide it
+ to a solver
Next create a RealVector
array to represent the constant
- vector B and use solve(RealVector)
from one of the implementations
- of the DecompositionSolver
interface, for example
- LUDecompositionImpl
to solve the system
+ vector B, select one of the decomposition algorithms (LU, QR ...) and use
+ solve(vector, decomposition)
to solve the system
The solution
vector will contain values for x
(solution.getEntry(0)
), y (solution.getEntry(1)
),
@@ -146,7 +146,7 @@ RealVector solution = new LUDecompositionImpl(coefficients).solve(constants);
It is possible to solve multiple systems with the same coefficient matrix
in one method call. To do this, create a matrix whose column vectors correspond
to the constant vectors for the systems to be solved and use
- solve(RealMatrix),
which returns a matrix with column
+ solve(matrix, decomposition),
which returns a matrix with column
vectors representing the solutions.