public class UmfpackSolver extends java.lang.Object implements DirectSolver
DirectSolver.IterativeMethod| Modifier and Type | Field and Description |
|---|---|
static int |
UMFPACK_ERROR_argument_missing |
static int |
UMFPACK_ERROR_different_pattern |
static int |
UMFPACK_ERROR_file_IO |
static int |
UMFPACK_ERROR_internal_error |
static int |
UMFPACK_ERROR_invalid_matrix |
static int |
UMFPACK_ERROR_invalid_Numeric_object |
static int |
UMFPACK_ERROR_invalid_permutation |
static int |
UMFPACK_ERROR_invalid_Symbolic_object |
static int |
UMFPACK_ERROR_invalid_system |
static int |
UMFPACK_ERROR_n_nonpositive |
static int |
UMFPACK_ERROR_out_of_memory |
static int |
UMFPACK_OK |
static int |
UMFPACK_WARNING_determinant_overflow |
static int |
UMFPACK_WARNING_determinant_underflow |
static int |
UMFPACK_WARNING_singular_matrix |
ANALYZED, DEFAULT_ITERATIVE_MAX_SOLVES, DEFAULT_ITERATIVE_TOLERANCE, FACTORED, UNSET| Constructor and Description |
|---|
UmfpackSolver() |
| Modifier and Type | Method and Description |
|---|---|
void |
analyze(double[] vals,
int[] colIdxs,
int[] rowOffs,
int size,
int type)
Performs prefactor analysis on a matrix whose structure and values are
supplied in compressed row storage (CRS) format, using 1-based
indices, as described in the documentation for
Matrix.setCRSValues. |
int |
analyze(int[] colOffs,
int[] rowIdxs,
int size,
int numVals) |
void |
analyze(Matrix M,
int size,
int type)
Performs prefactor analysis on a specified matrix.
|
void |
analyzeAndFactor(Matrix M)
Factors a matrix.
|
void |
dispose()
Releases all internal resources allocated by this solver.
|
void |
factor()
Factors a previously analyzed matrix.
|
void |
factor(double[] vals)
Factors a previously analyzed matrix, using the numeric values supplied
by
vals. |
void |
finalize() |
java.lang.String |
getErrorMessage()
|
static java.lang.String |
getInitErrorMessage() |
long |
getNumNonZerosInFactors()
If possible, returns the number of non-zero elements in the
factorization.
|
int |
getState()
|
boolean |
hasIterativeSolves()
Returns true if this solver supports iterative solving, using a recent
directly-factored matrix as a preconditioner.
|
static boolean |
isAvailable() |
static void |
main(java.lang.String[] args) |
void |
solve(double[] x,
double[] b)
Solves the system
|
void |
solve(VectorNd x,
VectorNd b)
Solves the system
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIterativeMaxSolves, getIterativeMethod, getIterativeTolerance, getLastIterativeResidual, getLastIterativeSolves, getMaxRefinementSteps, getNumNegEigenvalues, getNumPerturbedPivots, getNumPosEigenvalues, hasMultipleRhsSolves, iterativeSolve, iterativeSolve, residual, setIterativeMaxSolves, setIterativeMethod, setIterativeTolerance, setMaxRefinementSteps, solvepublic static int UMFPACK_OK
public static int UMFPACK_WARNING_singular_matrix
public static int UMFPACK_WARNING_determinant_underflow
public static int UMFPACK_WARNING_determinant_overflow
public static int UMFPACK_ERROR_out_of_memory
public static int UMFPACK_ERROR_invalid_Numeric_object
public static int UMFPACK_ERROR_invalid_Symbolic_object
public static int UMFPACK_ERROR_argument_missing
public static int UMFPACK_ERROR_n_nonpositive
public static int UMFPACK_ERROR_invalid_matrix
public static int UMFPACK_ERROR_different_pattern
public static int UMFPACK_ERROR_invalid_system
public static int UMFPACK_ERROR_invalid_permutation
public static int UMFPACK_ERROR_internal_error
public static int UMFPACK_ERROR_file_IO
public static boolean isAvailable()
public static java.lang.String getInitErrorMessage()
public void finalize()
finalize in class java.lang.Objectpublic void analyze(Matrix M, int size, int type)
DirectSolverfactor(). 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.analyze in interface DirectSolverM - 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_DEFINITEpublic void analyze(double[] vals,
int[] colIdxs,
int[] rowOffs,
int size,
int type)
Matrix.setCRSValues. The number of
non-zero values is given by rowOffs[size]-1. If the matrix type
is symmetric, only the upper triangular portion should be supplied.
Because no matrix object is supplied, factor()
cannot be used after calling this method; use factor(vals) instead. The values supplied here may be used to assist
the analysis but are not used for any numeric factorization.
This method is not supported by Umfpack, which requires its matrix
structure to be supplied in compressed column storage (CCS) format using
analyze(colOffs,rowIdxs,size,numVals).
analyze in interface DirectSolvervals - values of the non-zero matrix elementscolIdxs - 1-based column indices of the non-zero matrix elementsrowOffs - 1-based row start offsets into vals and
colIdxssize - size of the matrix to be analyzedtype - or-ed flags giving information about the matrix type, as
described for analyze(M,size,type)public int analyze(int[] colOffs,
int[] rowIdxs,
int size,
int numVals)
public void factor(double[] vals)
vals. These must be ordered in the same way as those
supplied to the most recent call to analyze().
The values must be ordered to match the compressed column storage
(CCS) structure supplied to analyze(colOffs,rowIdxs,size,numVals).
factor in interface DirectSolvervals - non-zero matrix element valuespublic void factor()
DirectSolverfactor in interface DirectSolverpublic void analyzeAndFactor(Matrix M)
DirectSolveranalyze (M, M.rowSize(), 0) factor()
analyzeAndFactor in interface DirectSolverM - matrix to factorpublic void solve(VectorNd x, VectorNd b)
DirectSolversolve in interface DirectSolverx - vector in which result is returnedb - right hand vector of matrix equationpublic boolean hasIterativeSolves()
DirectSolver.IterativeMethod are available, as are the
settings DirectSolver.setIterativeMethod(maspack.solvers.DirectSolver.IterativeMethod), DirectSolver.setIterativeMaxSolves(int) and
DirectSolver.setIterativeTolerance(double).
Umfpack does not support iterative solving.
hasIterativeSolves in interface DirectSolverpublic int getState()
getState in interface DirectSolverpublic java.lang.String getErrorMessage()
analyze() or factor(), or
null if the method succeeded.getErrorMessage in interface DirectSolverpublic long getNumNonZerosInFactors()
analyze(). If the solver does not report this quantity, -1 is returned.
Umfpack does not report this quantity, so -1 is returned.
getNumNonZerosInFactors in interface DirectSolverpublic void solve(double[] x,
double[] b)
DirectSolverM x = bwhere the solution and right hand side are supplied using
double[] objects.solve in interface DirectSolverx - vector in which result is returnedb - right hand vector of matrix equationpublic static void main(java.lang.String[] args)
public void dispose()
DirectSolverdispose in interface DirectSolver