maspack.solvers
Class UmfpackSolver

java.lang.Object
  extended by maspack.solvers.UmfpackSolver
All Implemented Interfaces:
DirectSolver

public class UmfpackSolver
extends java.lang.Object
implements DirectSolver


Field Summary
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
           
 
Constructor Summary
UmfpackSolver()
           
 
Method Summary
 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 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.
 int factor(double[] vals)
           
 void finalize()
           
static java.lang.String getInitErrorMessage()
           
 boolean hasAutoIterativeSolving()
          Returns true if this solver supports automatic 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)
           
 void solve(VectorNd x, VectorNd b)
          Solves the system
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UMFPACK_OK

public static int UMFPACK_OK

UMFPACK_WARNING_singular_matrix

public static int UMFPACK_WARNING_singular_matrix

UMFPACK_WARNING_determinant_underflow

public static int UMFPACK_WARNING_determinant_underflow

UMFPACK_WARNING_determinant_overflow

public static int UMFPACK_WARNING_determinant_overflow

UMFPACK_ERROR_out_of_memory

public static int UMFPACK_ERROR_out_of_memory

UMFPACK_ERROR_invalid_Numeric_object

public static int UMFPACK_ERROR_invalid_Numeric_object

UMFPACK_ERROR_invalid_Symbolic_object

public static int UMFPACK_ERROR_invalid_Symbolic_object

UMFPACK_ERROR_argument_missing

public static int UMFPACK_ERROR_argument_missing

UMFPACK_ERROR_n_nonpositive

public static int UMFPACK_ERROR_n_nonpositive

UMFPACK_ERROR_invalid_matrix

public static int UMFPACK_ERROR_invalid_matrix

UMFPACK_ERROR_different_pattern

public static int UMFPACK_ERROR_different_pattern

UMFPACK_ERROR_invalid_system

public static int UMFPACK_ERROR_invalid_system

UMFPACK_ERROR_invalid_permutation

public static int UMFPACK_ERROR_invalid_permutation

UMFPACK_ERROR_internal_error

public static int UMFPACK_ERROR_internal_error

UMFPACK_ERROR_file_IO

public static int UMFPACK_ERROR_file_IO
Constructor Detail

UmfpackSolver

public UmfpackSolver()
Method Detail

isAvailable

public static boolean isAvailable()

getInitErrorMessage

public static java.lang.String getInitErrorMessage()

finalize

public void finalize()
Overrides:
finalize in class java.lang.Object

analyze

public void analyze(Matrix M,
                    int size,
                    int type)
Description copied from interface: DirectSolver
Performs prefactor analysis on a specified matrix. The matrix reference is stored and used by later calls to 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.

Specified by:
analyze in interface DirectSolver
Parameters:
M - matrix to analyze
size - size of the matrix to factor.
type - or-ed flags giving information about the matrix type. Typical flags are SYMMETRIC or POSITIVE_DEFINITE

analyze

public int analyze(int[] colOffs,
                   int[] rowIdxs,
                   int size,
                   int numVals)

factor

public int factor(double[] vals)

factor

public void factor()
Description copied from interface: DirectSolver
Factors a previously analyzed matrix.

Specified by:
factor in interface DirectSolver

analyzeAndFactor

public void analyzeAndFactor(Matrix M)
Description copied from interface: DirectSolver
Factors a matrix. This is equivalent to the two calls
   analyze (M, M.rowSize(), 0)
   factor()
 

Specified by:
analyzeAndFactor in interface DirectSolver
Parameters:
M - matrix to factor

solve

public void solve(VectorNd x,
                  VectorNd b)
Description copied from interface: DirectSolver
Solves the system
  M x = b
 
where M was specified using previous calls to analyze or factor.

Specified by:
solve in interface DirectSolver
Parameters:
x - vector in which result is returned
b - right hand vector of matrix equation

autoFactorAndSolve

public void autoFactorAndSolve(VectorNd x,
                               VectorNd b,
                               int tolExp)
Description copied from interface: DirectSolver
Factors a previously analyzed matrix M and then solves the system
 M x = b
 
This 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.

Specified by:
autoFactorAndSolve in interface DirectSolver
Parameters:
x - vector in which result is returned
b - right hand vector of matrix equation
tolExp - if positive, enables auto-iterative solving with the specified value giving the (negative) exponent of the desired relative residual.

hasAutoIterativeSolving

public boolean hasAutoIterativeSolving()
Returns true if this solver supports automatic iterative solving using a recent directly-factored matrix as a preconditioner. If this feature is available, it may be invoked using the autoFactorAndSolve method.

Specified by:
hasAutoIterativeSolving in interface DirectSolver
Returns:
true if auto-iterative solving is available

solve

public void solve(double[] x,
                  double[] b)

main

public static void main(java.lang.String[] args)

dispose

public void dispose()
Description copied from interface: DirectSolver
Releases all internal resources allocated by this solver.

Specified by:
dispose in interface DirectSolver