AbstractLinAlgPack::MatrixNonsing Class Reference

Abstract base class for all nonsingular polymorphic matrices that can solve for linear system with but it may not be convienent to compute matrix vector products {abstract}. More...

#include <AbstractLinAlgPack_MatrixNonsing.hpp>

Inheritance diagram for AbstractLinAlgPack::MatrixNonsing:

[legend]
List of all members.

Clone

virtual mat_mns_mut_ptr_t clone_mns ()
 Clone the non-const matrix object (if supported).
virtual mat_mns_ptr_t clone_mns () const
 Clone the const matrix object (if supported).

Level-2 BLAS

virtual void V_InvMtV (VectorMutable *v_lhs, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2) const =0
 v_lhs = inv(op(M_rhs1)) * vs_rhs2
virtual void V_InvMtV (VectorMutable *v_lhs, BLAS_Cpp::Transp trans_rhs1, const SpVectorSlice &sv_rhs2) const
 v_lhs = inv(op(M_rhs1)) * sv_rhs2
virtual value_type transVtInvMtV (const Vector &v_rhs1, BLAS_Cpp::Transp trans_rhs2, const Vector &v_rhs3) const
 result = vs_rhs1' * inv(op(M_rhs2)) * vs_rhs3
virtual value_type transVtInvMtV (const SpVectorSlice &sv_rhs1, BLAS_Cpp::Transp trans_rhs2, const SpVectorSlice &sv_rhs3) const
 result = sv_rhs1' * inv(op(M_rhs2)) * sv_rhs3

Level-3 BLAS

virtual void M_StInvMtM (MatrixOp *m_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &mwo_rhs2, BLAS_Cpp::Transp trans_rhs2) const
 m_lhs = alpha * inv(op(M_rhs1)) * op(mwo_rhs2) (right).
virtual void M_StMtInvM (MatrixOp *m_lhs, value_type alpha, const MatrixOp &mwo_rhs1, BLAS_Cpp::Transp trans_rhs1, BLAS_Cpp::Transp trans_rhs2) const
 m_lhs = alpha * op(mwo_rhs1) * inv(op(M_rhs2)) (left).

Friends

void V_InvMtV (VectorMutable *v_lhs, const MatrixNonsing &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2)
 
void V_InvMtV (VectorMutable *v_lhs, const MatrixNonsing &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const SpVectorSlice &sv_rhs2)
 
value_type transVtInvMtV (const Vector &v_rhs1, const MatrixNonsing &M_rhs2, BLAS_Cpp::Transp trans_rhs2, const Vector &v_rhs3)
 
value_type transVtInvMtV (const SpVectorSlice &sv_rhs1, const MatrixNonsing &M_rhs2, BLAS_Cpp::Transp trans_rhs2, const SpVectorSlice &sv_rhs3)
 
void M_StInvMtM (MatrixOp *m_lhs, value_type alpha, const MatrixNonsing &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &mwo_rhs2, BLAS_Cpp::Transp trans_rhs2)
 
void M_StMtInvM (MatrixOp *m_lhs, value_type alpha, const MatrixOp &mwo_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixNonsing &M_rhs2, BLAS_Cpp::Transp trans_rhs2)
 

Detailed Description

Abstract base class for all nonsingular polymorphic matrices that can solve for linear system with but it may not be convienent to compute matrix vector products {abstract}.

The operations supported are:

Level-2 BLAS

v_lhs = inv(op(M_rhs1)) * vs_rhs2
v_lhs = inv(op(M_rhs1)) * sv_rhs2
result = v_rhs1' * inv(op(M_rhs2)) * v_rhs3
result = sv_rhs1' * inv(op(M_rhs2)) * sv_rhs3

Level-3 BLAS

m_lhs = alpha * inv(op(M_rhs1)) * op(mwo_rhs2) (right)
m_lhs = alpha * op(mwo_rhs1) * inv(op(M_rhs2)) (left)

For the solve operations, the lhs and rhs arguments may not be the same in general so don't assume that you can alias the lhs with the rhs and get correct results.

Any nonsingular matrix abstraction that can be used to solve for nonlinear systems should also be able to support the MatrixOp interface. Therefore, this interface is more of an implementation artifact than an a legitimate domain abstraction. However, some linear solvers that can implement this interface, can not easily implement the MatrixOp interface and therefore this interface is justified. A general client should never use this interface directly. Instead, the combined interface MatrixOpNonsing should be used with fully formed matrix abstractions.

All these Level-2 and Level-3 BLAS operations have default implementations based on the Level-2 BLAS operations:

v_lhs = inv(op(M_rhs1)) * vs_rhs2

which allows for fast prototyping of new matrix subclasses.

The member functions should not be called directly but instead through the provided non-member functions.

The multiple dispatch approach taken in MatrixOp is not taken in this interface. This is because it is considered here that the nonsingular matrix takes procedence of a general matrix arguemnt and we can not expect a general matrix to know how to solve for a linear system with some other nonsigular matrix.

Definition at line 84 of file AbstractLinAlgPack_MatrixNonsing.hpp.


Member Function Documentation

MatrixNonsing::mat_mns_mut_ptr_t AbstractLinAlgPack::MatrixNonsing::clone_mns  )  [virtual]
 

Clone the non-const matrix object (if supported).

The default implementation returns NULL which is perfectly acceptable. A matrix object is not required to return a non-NULL value but almost every good matrix implementation will.

Reimplemented in AbstractLinAlgPack::MatrixOpNonsing, AbstractLinAlgPack::MatrixSymNonsing, and AbstractLinAlgPack::MatrixSymOpNonsing.

Definition at line 49 of file AbstractLinAlgPack_MatrixNonsing.cpp.

MatrixNonsing::mat_mns_ptr_t AbstractLinAlgPack::MatrixNonsing::clone_mns  )  const [virtual]
 

Clone the const matrix object (if supported).

The behavior of this method is the same as for the non-const version above except it returns a smart pointer to a const matrix object.

The default implementation of this method will call the non-const version and then cast to constant.

Reimplemented in AbstractLinAlgPack::MatrixOpNonsing, AbstractLinAlgPack::MatrixSymNonsing, and AbstractLinAlgPack::MatrixSymOpNonsing.

Definition at line 55 of file AbstractLinAlgPack_MatrixNonsing.cpp.

virtual void AbstractLinAlgPack::MatrixNonsing::V_InvMtV VectorMutable v_lhs,
BLAS_Cpp::Transp  trans_rhs1,
const Vector v_rhs2
const [pure virtual]
 

v_lhs = inv(op(M_rhs1)) * vs_rhs2

Implemented in AbstractLinAlgPack::MatrixOpNonsingAggr, AbstractLinAlgPack::MatrixSymDiagStd, AbstractLinAlgPack::MatrixSymIdent, AbstractLinAlgPack::MatrixNonsingSerial, ConstrainedOptPack::MatrixDecompRangeOrthog, ConstrainedOptPack::MatrixSymHessianRelaxNonSing, ConstrainedOptPack::MatrixSymPosDefLBFGS, and AbstractLinAlgPack::MatrixOpNonsingThyra.

void AbstractLinAlgPack::MatrixNonsing::V_InvMtV VectorMutable v_lhs,
BLAS_Cpp::Transp  trans_rhs1,
const SpVectorSlice sv_rhs2
const [virtual]
 

v_lhs = inv(op(M_rhs1)) * sv_rhs2

Reimplemented in AbstractLinAlgPack::MatrixOpNonsingAggr, AbstractLinAlgPack::MatrixSymDiagStd, AbstractLinAlgPack::MatrixNonsingSerial, and ConstrainedOptPack::MatrixSymHessianRelaxNonSing.

Definition at line 62 of file AbstractLinAlgPack_MatrixNonsing.cpp.

value_type AbstractLinAlgPack::MatrixNonsing::transVtInvMtV const Vector v_rhs1,
BLAS_Cpp::Transp  trans_rhs2,
const Vector v_rhs3
const [virtual]
 

result = vs_rhs1' * inv(op(M_rhs2)) * vs_rhs3

Reimplemented in AbstractLinAlgPack::MatrixOpNonsingAggr, and AbstractLinAlgPack::MatrixNonsingSerial.

Definition at line 80 of file AbstractLinAlgPack_MatrixNonsing.cpp.

value_type AbstractLinAlgPack::MatrixNonsing::transVtInvMtV const SpVectorSlice sv_rhs1,
BLAS_Cpp::Transp  trans_rhs2,
const SpVectorSlice sv_rhs3
const [virtual]
 

result = sv_rhs1' * inv(op(M_rhs2)) * sv_rhs3

Reimplemented in AbstractLinAlgPack::MatrixOpNonsingAggr, and AbstractLinAlgPack::MatrixNonsingSerial.

Definition at line 93 of file AbstractLinAlgPack_MatrixNonsing.cpp.

void AbstractLinAlgPack::MatrixNonsing::M_StInvMtM MatrixOp m_lhs,
value_type  alpha,
BLAS_Cpp::Transp  trans_rhs1,
const MatrixOp mwo_rhs2,
BLAS_Cpp::Transp  trans_rhs2
const [virtual]
 

m_lhs = alpha * inv(op(M_rhs1)) * op(mwo_rhs2) (right).

The default implemention performs a dynamic_cast<MultiVectorMutable>(m_lhs). If this dynamic_cast<> does not return NULL , then this operation is implemented in terms of this->V_InvMtV() one row or column at a time. If this dynamic_cast<> returns false, then this default implementation has no choice but to throw an exception (std::invalid_argument).

Reimplemented in AbstractLinAlgPack::MatrixOpNonsingAggr, AbstractLinAlgPack::MatrixNonsingSerial, and AbstractLinAlgPack::MatrixOpNonsingThyra.

Definition at line 108 of file AbstractLinAlgPack_MatrixNonsing.cpp.

void AbstractLinAlgPack::MatrixNonsing::M_StMtInvM MatrixOp m_lhs,
value_type  alpha,
const MatrixOp mwo_rhs1,
BLAS_Cpp::Transp  trans_rhs1,
BLAS_Cpp::Transp  trans_rhs2
const [virtual]
 

m_lhs = alpha * op(mwo_rhs1) * inv(op(M_rhs2)) (left).

The default implemention performs a dynamic_cast<MultiVectorMutable>(m_lhs). If this dynamic_cast<> does not return NULL , then this operation is implemented in terms of this->V_InvMtV() one row or column at a time. If this dynamic_cast<> returns false, then this default implementation has no choice but to throw an exception (std::invalid_argument).

Reimplemented in AbstractLinAlgPack::MatrixOpNonsingAggr, and AbstractLinAlgPack::MatrixNonsingSerial.

Definition at line 163 of file AbstractLinAlgPack_MatrixNonsing.cpp.


Friends And Related Function Documentation

void V_InvMtV VectorMutable v_lhs,
const MatrixNonsing M_rhs1,
BLAS_Cpp::Transp  trans_rhs1,
const Vector v_rhs2
[friend]
 

Definition at line 236 of file AbstractLinAlgPack_MatrixNonsing.hpp.

void V_InvMtV VectorMutable v_lhs,
const MatrixNonsing M_rhs1,
BLAS_Cpp::Transp  trans_rhs1,
const SpVectorSlice sv_rhs2
[friend]
 

Definition at line 244 of file AbstractLinAlgPack_MatrixNonsing.hpp.

value_type transVtInvMtV const Vector v_rhs1,
const MatrixNonsing M_rhs2,
BLAS_Cpp::Transp  trans_rhs2,
const Vector v_rhs3
[friend]
 

Definition at line 252 of file AbstractLinAlgPack_MatrixNonsing.hpp.

value_type transVtInvMtV const SpVectorSlice sv_rhs1,
const MatrixNonsing M_rhs2,
BLAS_Cpp::Transp  trans_rhs2,
const SpVectorSlice sv_rhs3
[friend]
 

Definition at line 260 of file AbstractLinAlgPack_MatrixNonsing.hpp.

void M_StInvMtM MatrixOp m_lhs,
value_type  alpha,
const MatrixNonsing M_rhs1,
BLAS_Cpp::Transp  trans_rhs1,
const MatrixOp mwo_rhs2,
BLAS_Cpp::Transp  trans_rhs2
[friend]
 

Definition at line 274 of file AbstractLinAlgPack_MatrixNonsing.hpp.

void M_StMtInvM MatrixOp m_lhs,
value_type  alpha,
const MatrixOp mwo_rhs1,
BLAS_Cpp::Transp  trans_rhs1,
const MatrixNonsing M_rhs2,
BLAS_Cpp::Transp  trans_rhs2
[friend]
 

Definition at line 283 of file AbstractLinAlgPack_MatrixNonsing.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:36:07 2008 for MOOCHO (Single Doxygen Collection) by doxygen 1.3.9.1