public interface DirectSolver
Modifier and Type | Method and Description |
---|---|
void |
analyze(Matrix M,
int size,
int type)
Performs prefactor analysis on a specified matrix.
|
void |
analyzeAndFactor(Matrix M)
Factors a matrix.
|
void |
autoFactorAndSolve(VectorNd x,
VectorNd b,
int tolExp)
Factors a previously analyzed matrix M and then solves the system
|
void |
dispose()
Releases all internal resources allocated by this solver.
|
void |
factor()
Factors a previously analyzed matrix.
|
boolean |
hasAutoIterativeSolving()
Returns true if this solver supports automatic iterative solving using a
recent directly-factored matrix as a preconditioner.
|
void |
solve(VectorNd x,
VectorNd b)
Solves the system
|
void analyze(Matrix M, int size, int type)
factor()
. If
size
is less than the actual matrix size, then the analysis
is done on the principal submatrix of M defined by the first
size
rows and columns.M
- matrix to analyzesize
- size of the matrix to factor.type
- or-ed flags giving information about the matrix type. Typical flags are
SYMMETRIC
or
POSITIVE_DEFINITE
java.lang.IllegalArgumentException
- if the matrix is not square, or the matrix type is not supported by the
solver.NumericalException
- if the analysis failed for numeric reasons.void factor()
java.lang.IllegalStateException
- if no previous call to analyze
has been made.NumericalException
- if the factor failed for numeric reasons.void analyzeAndFactor(Matrix M)
analyze (M, M.rowSize(), 0) factor()
M
- matrix to factorjava.lang.IllegalArgumentException
- if the matrix is not square, or general matrices are not supported by the
solver.NumericalException
- if the analysis or factoring failed for numeric reasons.void solve(VectorNd x, VectorNd b)
x
- vector in which result is returnedb
- right hand vector of matrix equationNumericalException
- if the solve failed for numeric reasons.java.lang.IllegalStateException
- if no previous call to analyze
or
factor
has been made.void autoFactorAndSolve(VectorNd x, VectorNd b, int tolExp)
M x = bThis is equivalent to
factor() solve (x, b)but is included because it may be faster depending on the underlying implementation. If auto-iterative solving is available (as determined by
hasAutoIterativeSolving
), this method also
allows the solver to automatically employ iterative solving using a recent
direct factorization as a preconditioner. To enable auto-iterative
solving, the argument tolExp should be set to a positive value giving the
(negative) exponent of the desired relative residual.x
- vector in which result is returnedb
- right hand vector of matrix equationtolExp
- if positive, enables auto-iterative solving with the specified value
giving the (negative) exponent of the desired relative residual.NumericalException
- if the factoring or solving failed for numeric reasonsboolean hasAutoIterativeSolving()
autoFactorAndSolve
method.void dispose()