public class MatlabSolver extends java.lang.Object implements DirectSolver
| Constructor and Description |
|---|
MatlabSolver() |
| 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 |
incAll(int[] ar) |
void |
incIndices(double[] ar) |
void |
int2double(int[] ar,
double[] dar) |
void |
printArray(double[] ar) |
void |
printArray(int[] ar) |
void |
printArray(java.lang.String name,
double[] ar) |
void |
printArray(java.lang.String name,
int[] ar) |
void |
printData(double[] rows,
double[] cols,
double[] vals) |
void |
printIdxs(double[] rows,
double[] cols) |
void |
queryFullMatrix() |
void |
querySparseMatrix() |
void |
solve(double[] x,
double[] b) |
void |
solve(VectorNd x,
VectorNd b)
Solves the system
|
void |
test() |
void |
write(java.lang.String filename) |
void |
writeArray(IndentingPrintWriter pw,
java.lang.String name,
double[] ar) |
void |
writeArray(IndentingPrintWriter pw,
java.lang.String name,
int[] ar) |
public void test()
public 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 factor()
DirectSolverfactor in interface DirectSolverpublic void analyzeAndFactor(Matrix M)
DirectSolveranalyze (M, M.rowSize(), 0) factor()
analyzeAndFactor in interface DirectSolverM - matrix to factorpublic void querySparseMatrix()
public void queryFullMatrix()
public void solve(VectorNd x, VectorNd b)
DirectSolversolve in interface DirectSolverx - vector in which result is returnedb - right hand vector of matrix equationpublic void autoFactorAndSolve(VectorNd x, VectorNd b, int tolExp)
DirectSolverM 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.autoFactorAndSolve in interface DirectSolverx - 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.public void solve(double[] x,
double[] b)
public void write(java.lang.String filename)
public void writeArray(IndentingPrintWriter pw, java.lang.String name, double[] ar)
public void writeArray(IndentingPrintWriter pw, java.lang.String name, int[] ar)
public void printData(double[] rows,
double[] cols,
double[] vals)
public void printIdxs(double[] rows,
double[] cols)
public void printArray(java.lang.String name,
int[] ar)
public void printArray(int[] ar)
public void printArray(java.lang.String name,
double[] ar)
public void printArray(double[] ar)
public void int2double(int[] ar,
double[] dar)
public void incAll(int[] ar)
public void incIndices(double[] ar)
public boolean hasAutoIterativeSolving()
autoFactorAndSolve method.hasAutoIterativeSolving in interface DirectSolverpublic void dispose()
DirectSolverdispose in interface DirectSolver