|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ru.sscc.matrix.solve.RealDirectSolver | +--ru.sscc.matrix.solve.RealDenseSolver | +--ru.sscc.matrix.solve.GreenSolver
Performs the solving of SLAE having the form Cx+By=b with restriction BTx=0. Here C is a square m×m-matrix, B is a rectangular m×k-matrix, x and y are unknown vectors. The matrices C and B are merged into one m×n-matrix, n=m+k: first m columns occupies C matrix and last k columns ocupies B matrix. The unknown vectors x and y also merged into one vector of the length n: x goes first and y goes last.
The original algorithm is used to solve the system. The special transforms F and H are calculated in such a way to provide FB=U and HB=O, where U is the upper triangular k×k-matrix and O is the null n×k-matrix. Then the original system is transformed to HCHTz=Hb and the square matrix A=HCHT is factorized. Then the vectors x and y are easily calculated from z and Fb.
The solver and the transformer used in the algorithm may be selected by
the user. The solver should be of RealDenseSolver
's subtype and
the transformer is any of RealCommonSolver
's subtype. The default
classes used for solver and transformer are CrautSolver
and
ReflectionSolver
.
This method has especial benefits for spline construction systems,
because A is always positive definite symmetric matrix. So, it may be
factorized by CholeskySolver
.
Field Summary | |
protected RealDenseSolver |
solver
The solver used for factorization of transformed matrix. |
protected RealCommonSolver |
transformer
The solver used for transformation. |
Fields inherited from class ru.sscc.matrix.solve.RealDenseSolver |
matrix |
Constructor Summary | |
GreenSolver()
Constructs an instance without attached matrix with default internal solver and transformer instances ( CrautSolver and
ReflectionSolver ). |
|
GreenSolver(DenseMatrix matrix)
Constructs an instance upon a dense matrix with default internal solver and transformer. |
|
GreenSolver(int nRows,
int nColumns)
Constructs an instance with clear double[] type container and default internal solver and transformer. |
|
GreenSolver(RealContainer entries,
int nRows,
int nColumns)
Constructs an instance based on a user's real data container with default internal solver and transformer. |
|
GreenSolver(RealDenseSolver solver,
RealCommonSolver transformer)
Constructs an instance without attached matrix and with specified solver and transformer. |
Method Summary | |
void |
attach(DenseMatrix matrix)
Attaches a matrix to the solver and sets the initial state for the solver and matrix. |
RealDirectSolver |
factorize()
Factorizes the matrix using the original transformation technique. |
double |
getReductionAccuracy()
Returns the transformation accuracy level. |
void |
setReductionAccuracy(double accuracy)
Sets the transformation accuracy level affecting on making the decision ether B matrix column depends on previous columns or not. |
void |
solve(RealVector source,
RealVector target)
Solves SLAE using already factorized matrix. |
int |
transformationDefect()
Returns the transformation defect (the range of null space). |
DenseMatrix |
transformationNullSpace()
Returns the transformation null space. |
Methods inherited from class ru.sscc.matrix.solve.RealDenseSolver |
clone,
forwardSubstitution,
getMatrix,
reuse,
solveLowerTriangular,
solveUpperTriangular,
sourceSize,
targetSize |
Methods inherited from class ru.sscc.matrix.solve.RealDirectSolver |
constructInverse,
constructRefinedInverse,
ensureFactorized,
isFactorized,
setFactorized,
solveAndRefine |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected RealDenseSolver solver
protected RealCommonSolver transformer
Constructor Detail |
public GreenSolver()
CrautSolver
and
ReflectionSolver
).public GreenSolver(RealDenseSolver solver, RealCommonSolver transformer)
solver
- a solvertransformer
- a transformerpublic GreenSolver(int nRows, int nColumns)
nRows
- a number of matrix rowsnColumns
- a number of matrix columnspublic GreenSolver(RealContainer entries, int nRows, int nColumns)
entries
- a container of matrix entriesnRows
- a number of matrix rowsnColumns
- a number of matrix columnspublic GreenSolver(DenseMatrix matrix)
matrix
- a dense matrixMethod Detail |
public void attach(DenseMatrix matrix)
public final void setReductionAccuracy(double accuracy)
public final double getReductionAccuracy()
public final int transformationDefect()
public final DenseMatrix transformationNullSpace()
public RealDirectSolver factorize() throws CalculatingException
public void solve(RealVector source, RealVector target)
source
- a source vector (the right hand side of SLAE)target
- a target vector to write the solution
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |