us.ihmc.utilities.math
Class ConfigurableSolvePseudoInverseSVD

java.lang.Object
  extended by us.ihmc.utilities.math.ConfigurableSolvePseudoInverseSVD
All Implemented Interfaces:
org.ejml.factory.LinearSolver<org.ejml.data.DenseMatrix64F>

public class ConfigurableSolvePseudoInverseSVD
extends java.lang.Object
implements org.ejml.factory.LinearSolver<org.ejml.data.DenseMatrix64F>

The pseudo-inverse is typically used to solve over determined system for which there is no unique solution.
x=inv(ATA)ATb
where A ∈ ℜ m × n and m ≥ n.

This class implements the Moore-Penrose pseudo-inverse using SVD and should never fail. Alternative implementations can use Cholesky decomposition, but those will fail if the ATA matrix is singular. However the Cholesky implementation is much faster.

Author:
Peter Abeles

Constructor Summary
ConfigurableSolvePseudoInverseSVD(int maxRows, int maxCols, double singularValueLimit)
          Creates a new solver targeted at the specified matrix size.
 
Method Summary
 void invert(org.ejml.data.DenseMatrix64F A_inv)
           
 boolean modifiesA()
           
 boolean modifiesB()
           
 double quality()
           
 boolean setA(org.ejml.data.DenseMatrix64F A)
           
 void solve(org.ejml.data.DenseMatrix64F b, org.ejml.data.DenseMatrix64F x)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurableSolvePseudoInverseSVD

public ConfigurableSolvePseudoInverseSVD(int maxRows,
                                         int maxCols,
                                         double singularValueLimit)
Creates a new solver targeted at the specified matrix size.

Parameters:
maxRows - The expected largest matrix it might have to process. Can be larger.
maxCols - The expected largest matrix it might have to process. Can be larger.
Method Detail

setA

public boolean setA(org.ejml.data.DenseMatrix64F A)
Specified by:
setA in interface org.ejml.factory.LinearSolver<org.ejml.data.DenseMatrix64F>

quality

public double quality()
Specified by:
quality in interface org.ejml.factory.LinearSolver<org.ejml.data.DenseMatrix64F>

solve

public void solve(org.ejml.data.DenseMatrix64F b,
                  org.ejml.data.DenseMatrix64F x)
Specified by:
solve in interface org.ejml.factory.LinearSolver<org.ejml.data.DenseMatrix64F>

invert

public void invert(org.ejml.data.DenseMatrix64F A_inv)
Specified by:
invert in interface org.ejml.factory.LinearSolver<org.ejml.data.DenseMatrix64F>

modifiesA

public boolean modifiesA()
Specified by:
modifiesA in interface org.ejml.factory.LinearSolver<org.ejml.data.DenseMatrix64F>

modifiesB

public boolean modifiesB()
Specified by:
modifiesB in interface org.ejml.factory.LinearSolver<org.ejml.data.DenseMatrix64F>