org.ejml.alg.dense.linsol
Class LinearSolverFactory

java.lang.Object
  extended by org.ejml.alg.dense.linsol.LinearSolverFactory

public class LinearSolverFactory
extends Object

A factory for generating solvers for systems of the form A*x=b, where A and B are known and x is unknown.

Author:
Peter Abeles

Constructor Summary
LinearSolverFactory()
           
 
Method Summary
static AdjustableLinearSolver adjustable()
          Create a solver which can efficiently add and remove elements instead of recomputing everything from scratch.
static LinearSolver<DenseMatrix64F> general(int numRows, int numCols)
          Creates a general purpose solver.
static LinearSolver<DenseMatrix64F> leastSquares(int numRows, int numCols)
          Creates a good general purpose solver for over determined systems and returns the optimal least-squares solution.
static LinearSolver<DenseMatrix64F> linear(int matrixSize)
          Creates a solver for linear systems.
static LinearSolver<DenseMatrix64F> solverPseudoInverse()
          Returns a solver which uses the pseudo inverse.
static LinearSolver<DenseMatrix64F> solverQrPivot(int matrixWidth)
          Creates a solver which can come up with a partial solution for a singular matrix.
static LinearSolver<DenseMatrix64F> symmPosDef(int matrixWidth)
          Creates a solver for symmetric positive definite matrices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearSolverFactory

public LinearSolverFactory()
Method Detail

general

public static LinearSolver<DenseMatrix64F> general(int numRows,
                                                   int numCols)
Creates a general purpose solver. Use this if you are not sure what you need.

Parameters:
numRows - The number of rows that the decomposition is optimized for.
numCols - The number of columns that the decomposition is optimized for.

linear

public static LinearSolver<DenseMatrix64F> linear(int matrixSize)
Creates a solver for linear systems. The A matrix will have dimensions (m,m).

Returns:
A new linear solver.

leastSquares

public static LinearSolver<DenseMatrix64F> leastSquares(int numRows,
                                                        int numCols)
Creates a good general purpose solver for over determined systems and returns the optimal least-squares solution. The A matrix will have dimensions (m,n) where m ≥ n.

Parameters:
numRows - The number of rows that the decomposition is optimized for.
numCols - The number of columns that the decomposition is optimized for.
Returns:
A new least-squares solver for over determined systems.

symmPosDef

public static LinearSolver<DenseMatrix64F> symmPosDef(int matrixWidth)
Creates a solver for symmetric positive definite matrices.

Returns:
A new solver for symmetric positive definite matrices.

solverQrPivot

public static LinearSolver<DenseMatrix64F> solverQrPivot(int matrixWidth)
Creates a solver which can come up with a partial solution for a singular matrix. The matrix is decomposed using QR with column pivots. Variables which can't be solved for because its singular are set to the input.

Returns:
A new solver which can handle

solverPseudoInverse

public static LinearSolver<DenseMatrix64F> solverPseudoInverse()
Returns a solver which uses the pseudo inverse. Useful when a matrix needs to be inverted which is singular.

Returns:
Solver for singular matrices.

adjustable

public static AdjustableLinearSolver adjustable()
Create a solver which can efficiently add and remove elements instead of recomputing everything from scratch.



Copyright © 2011. All Rights Reserved.