Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OSCAR::EqnSolver Class Reference
[Math]

This class contains methods for calculating solutions to the linear system Ax=b. More...

#include <EqnSolver.h>

Inheritance diagram for OSCAR::EqnSolver:

Inheritance graph
[legend]
List of all members.

Public Methods

 EqnSolver ()
virtual bool General (const Matrix &A, Vector &x, const Vector &b)
virtual bool Reconfig (const Matrix &A, JointVector &x, const HandPose &b)
virtual bool OverConstrained (const Matrix &A, Vector &x, const Vector &b)
virtual bool Square (const Matrix &A, Vector &x, const Vector &b)
virtual bool Redundant (const Matrix &A, Vector &x, const Vector &b)
virtual bool RedundantWithWeights (const Matrix &A, Vector &x, const Vector &b)
bool SetWeights (const Matrix &W)
void ClearWeights ()
double GetSolutionProperties (void)
EqnSolver & operator= (const EqnSolver &rhs)
 EqnSolver (const EqnSolver &rhs)
virtual ~EqnSolver ()

Protected Attributes

double determinant
Matrixweights
MatrixstoredWeights
Vectortemp
Vectortemp2
VectorscratchVec
VectorscratchVec2
MatrixscratchMat
MatrixscratchMat2
MatrixscratchMat3
MatrixscratchMat4
MatrixscratchMat5

Detailed Description

Author:
Peter S. March
This class contains methods for calculating solutions to the linear system Ax=b. These methods can be applied to square, over-constrained, and redundant systems.


Constructor & Destructor Documentation

OSCAR::EqnSolver::EqnSolver  
 

Constructor.

This is the default constructor for an object of type EqnSolver. Use this to simply construct an instance of an EqnSolver object that can be used for solving systems of linear equations.

OSCAR::EqnSolver::EqnSolver const EqnSolver &    rhs
 

Copy Constructor.

This is the copy constructor for an object of type EqnSolver. Use this to construct an EqnSolver object from an existing EqnSolver object.

Parameters:
rhs An EqnSolver object that will be used to initialize this new object.

virtual OSCAR::EqnSolver::~EqnSolver   [virtual]
 

Virtual Destructor.

This is the Destructor for an object of type EqnSolver.


Member Function Documentation

void OSCAR::EqnSolver::ClearWeights  
 

Clear the Weighting Matrix.

This method is used to clear the internal Weighting matrix.

Returns:
None
See also:
bool RedundantWithWeights(const Matrix& A, Vector& x, const Vector& b)

bool SetWeights(const Matrix& W);

virtual bool OSCAR::EqnSolver::General const Matrix   A,
Vector   x,
const Vector   b
[virtual]
 

Solve the linear system Ax=b.

This method is used to provide the solution to the linear system Ax=b, and it can be used for any of the square (m=n), redundant (n>m) or over-constrained (m>n) cases. In the square case, the A matrix is simply inverted to get the solution. The redundant case uses a psudeo-inverse. The over-constrained case will yield a least-squares solution.

Parameters:
A A mxn matrix. A will be inverted, so it should be non-singular.
x A nx1 vector.
b A mx1 vector.
Returns:
True if the method succeeds, and False if the method fails. Call GetError() for details.
Exceptions:
matrixSizeMismatch matrixSizeMismatch.
matrixSingularity matrixSingularity.
See also:
Reconfig(const Matrix& A, JointVector& x, const HandPose& b)

GetSolutionProperties()

double OSCAR::EqnSolver::GetSolutionProperties void   
 

Get the Determinant.

Gets the determinant of the Matrix A from the last inverse that was performed.

Returns:
Determinant of the Matrix A.
See also:
General(const Matrix& A, Vector& x, const Vector& b)

EqnSolver& OSCAR::EqnSolver::operator= const EqnSolver &    rhs
 

Assignment Operator.

This is the Assignment operator for an object of type EqnSolver.

Parameters:
rhs An EqnSolver object that goes on the right hand side of the = operator.
Returns:
A reference to the object on the left hand side of the = operator.

virtual bool OSCAR::EqnSolver::OverConstrained const Matrix   A,
Vector   x,
const Vector   b
[virtual]
 

Solve the linear system Ax=b where A is over-constrained (m>n).

Least-squares solution to the linear system Ax=b where A is over-constrained (m>n).

Parameters:
A A mxn matrix. A will be inverted, so it should be non-singular.
x A nx1 vector.
b A mx1 vector.
Returns:
True if the method succeeds, and False if the method fails. Call GetError() for details.
Exceptions:
matrixSizeMismatch matrixSizeMismatch.
matrixSingularity matrixSingularity.
See also:
General(const Matrix& A, Vector& x, const Vector& b)

GetSolutionProperties()

virtual bool OSCAR::EqnSolver::Reconfig const Matrix   A,
JointVector   x,
const HandPose   b
[virtual]
 

Solve the linear system Ax=b where A is the Jacobian matrix, x is a JointVector and b is a HandPose.

Solves the linear system Ax=b for the special instance where A is the Jacobian matrix, x is a JointVector and b is a HandPose. This function will use the active/inactive coordinates specified inside the JointVector and HandPose to produce the solution.

Parameters:
A A mxn Jacobian matrix. A will be inverted, so it should be non-singular.
x A nx1 vector of joint velocities.
b A mx1 vector handpose velocities.
Returns:
True if the method succeeds, and False if the method fails. Call GetError() for details
Exceptions:
matrixSizeMismatch matrixSizeMismatch .
matrixSingularity matrixSingularity.
See also:
General(const Matrix& A, Vector& x, const Vector& b)

GetSolutionProperties()

virtual bool OSCAR::EqnSolver::Redundant const Matrix   A,
Vector   x,
const Vector   b
[virtual]
 

Solve the linear system Ax=b where A is redundant (n>m).

Solves the linear system Ax=b where A is redundant (n>m) by calculating the pseudo-inverse of the Matrix.

Parameters:
A A mxn matrix. A will be inverted, so it should be non-singular.
x A nx1 vector.
b A mx1 vector.
Returns:
True if the method succeeds, and False if the method fails. Call GetError() for details.
Exceptions:
matrixSizeMismatch matrixSizeMismatch.
matrixSingularity matrixSingularity.
See also:
General(const Matrix& A, Vector& x, const Vector& b)

GetSolutionProperties()

Reimplemented in OSCAR::DLSEqnSolver.

virtual bool OSCAR::EqnSolver::RedundantWithWeights const Matrix   A,
Vector   x,
const Vector   b
[virtual]
 

Solve the linear system Ax=b where A is redundant (n>m) using a weight Matrix.

Solves the linear system Ax=b where A is redundant (n>m) using a weight Matrix. The weight matrix should be nxn, and the system is solved like so: x=W*A_Tran*inv(A*W*A_Trans). The weight Matrix is defined using the SetWeights() method. If the Matrix has not been set, then a normal pseudo-inverse will be performed.

Parameters:
A A mxn Matrix. A will be inverted, so it should be non-singular.
x A nx1 vector.
b A mx1 vector.
Returns:
True if the method succeeds, and False if the method fails. Call GetError() for details.
Exceptions:
matrixSizeMismatch matrixSizeMismatch.
matrixSingularity matrixSingularity.
See also:
Redundant(const Matrix& A, Vector& x, const Vector& b)

GetSolutionProperties()

SetWeights(const Matrix& W)

Reimplemented in OSCAR::DLSEqnSolver.

bool OSCAR::EqnSolver::SetWeights const Matrix   W
 

Set the Weighting Matrix.

Sets the Weighting Matrix. This Matrix should be nxn.

Parameters:
W A nxn matrix of weights. This matrix will be used for performing the pseudo-inverse.
Returns:
True if the method succeeds, and False if the method fails. Call GetError() for details.
See also:
bool RedundantWithWeights(const Matrix& A, Vector& x, const Vector& b)

ClearWeights()

virtual bool OSCAR::EqnSolver::Square const Matrix   A,
Vector   x,
const Vector   b
[virtual]
 

Solve the linear system Ax=b where A is square (m==n).

Solves the linear system Ax=b where A is square (m==n), by inverting the Matrix.

Parameters:
A A mxn matrix. A will be inverted, so it should be non-singular.
x A nx1 vector.
b A mx1 vector.
Returns:
True if the method succeeds, and False if the method fails. Call GetError() to get detailed error information.
Exceptions:
matrixSizeMismatch matrixSizeMismatch.
matrixSingularity matrixSingularity.
See also:
General(const Matrix& A, Vector& x, const Vector& b)

GetSolutionProperties()


Member Data Documentation

double OSCAR::EqnSolver::determinant [protected]
 

Matrix* OSCAR::EqnSolver::scratchMat [protected]
 

Matrix* OSCAR::EqnSolver::scratchMat2 [protected]
 

Matrix* OSCAR::EqnSolver::scratchMat3 [protected]
 

Matrix* OSCAR::EqnSolver::scratchMat4 [protected]
 

Matrix* OSCAR::EqnSolver::scratchMat5 [protected]
 

Vector* OSCAR::EqnSolver::scratchVec [protected]
 

Vector* OSCAR::EqnSolver::scratchVec2 [protected]
 

Matrix* OSCAR::EqnSolver::storedWeights [protected]
 

Vector* OSCAR::EqnSolver::temp [protected]
 

Vector* OSCAR::EqnSolver::temp2 [protected]
 

Matrix* OSCAR::EqnSolver::weights [protected]
 


The documentation for this class was generated from the following file:
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations