Simbody  3.5
SimTK::MatrixCommitment Class Reference

A MatrixCommitment provides a set of acceptable matrix characteristics. More...

+ Inheritance diagram for SimTK::MatrixCommitment:

Classes

class  Hermitian
 This is the default commitment for a Hermitian (*not* symmetric) matrix. More...
 
class  RowVector
 This is the default commitment for a row vector. More...
 
class  SkewHermitian
 This is the default commitment for a skew Hermitian (*not* skew symmetric) matrix. More...
 
class  SkewSymmetric
 This is the default commitment for skew symmetric (*not* skew Hermitian) matrix. More...
 
class  Symmetric
 This is the default commitment for a symmetric (*not* Hermitian) matrix. More...
 
class  Triangular
 This is the default commitment for a triangular matrix. More...
 
class  Vector
 This is the default commitment for a column vector. More...
 

Public Member Functions

 MatrixCommitment ()
 
 MatrixCommitment (const MatrixStructure &str)
 This is an implicit conversion from a MatrixStructure specification to a MatrixCommitment with storage, outline, and condition uncommitted. More...
 
MatrixCommitmentcommitSize (int m, int n)
 
MatrixCommitmentcommitNumRows (int m)
 
MatrixCommitmentcommitNumCols (int n)
 
MatrixCommitmentcommitBandwidth (int lb, int ub)
 
MatrixCommitmentcommitLowerBandwidth (int lb)
 
MatrixCommitmentcommitUpperBandwidth (int ub)
 
MatrixCommitmentcommitStructure (const MatrixStructure &s)
 
MatrixCommitmentcommitStorage (const MatrixStorage &s)
 
MatrixCommitmentcommitOutline (const MatrixOutline &o)
 
MatrixCommitmentcommitCondition (const MatrixCondition &c)
 
MatrixCharacter calcDefaultCharacter (int minNumRows, int minNumCols) const
 For any handle commitment, we can calculate a "best character" for an allocation that satisfies the commitment, optionally with an initial allocation size. More...
 
const MatrixStructuregetStructureCommitment () const
 These report the commitment as it was specified. More...
 
const MatrixStoragegetStorageCommitment () const
 
const MatrixOutlinegetOutlineCommitment () const
 
const MatrixConditiongetConditionCommitment () const
 
const MatrixStructure::MaskgetStructureMask () const
 These report the masks of acceptable values generated from the commitment. More...
 
const MatrixStorage::MaskgetStorageMask () const
 
const MatrixOutline::MaskgetOutlineMask () const
 
const MatrixCondition::MaskgetConditionMask () const
 
MatrixCharacter::Mask::SizeMask getNumRowsMask () const
 
MatrixCharacter::Mask::SizeMask getNumColsMask () const
 
MatrixCharacter::Mask::SizeMask getLowerBandwidthMask () const
 
MatrixCharacter::Mask::SizeMask getUpperBandwidthMask () const
 
int getDefaultNumRows () const
 
int getDefaultNumCols () const
 
bool isSizeOK (int m, int n) const
 
bool isSizeOK (const std::pair< int, int > &mn) const
 
bool isBandwidthOK (int lower, int upper) const
 
bool isSatisfiedBy (const MatrixCharacter &actual) const
 
bool isStructureOK (const MatrixStructure &s) const
 
bool isStorageOK (const MatrixStorage &s) const
 
bool isOutlineOK (const MatrixOutline &o) const
 
bool isConditionOK (const MatrixCondition &c) const
 
bool isResizeable () const
 
bool isFullyResizeable () const
 
bool isNumRowsLocked () const
 
bool isNumColsLocked () const
 
bool isStructureCommitted () const
 
bool isStorageCommitted () const
 
bool isOutlineCommitted () const
 
bool isConditionCommitted () const
 
void clear ()
 Set commitment s to "none" and masks to "uncommitted" for all characteristics. More...
 

Protected Member Functions

 MatrixCommitment (const MatrixStructure &structure, const MatrixStorage &storage, const MatrixOutline &outline, const MatrixCondition &condition)
 

Protected Attributes

MatrixStructure structure
 These are the commitments as specified. More...
 
MatrixStorage storage
 
MatrixOutline outline
 
MatrixCondition condition
 
MatrixCharacter::Mask masks
 These are the bitmasks of acceptable characteristics which would satisfy the above-specified commitments. More...
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &o, const MatrixCommitment &)
 Output a textual description of a MatrixCommitment; handy for debugging. More...
 

Detailed Description

A MatrixCommitment provides a set of acceptable matrix characteristics.

Since we define the characteristics each with its own bit, a commitment is implemented as a set of masks with bits set corresponding to the acceptable characteristics.

Constructor & Destructor Documentation

SimTK::MatrixCommitment::MatrixCommitment ( )
inline
SimTK::MatrixCommitment::MatrixCommitment ( const MatrixStructure str)
inline

This is an implicit conversion from a MatrixStructure specification to a MatrixCommitment with storage, outline, and condition uncommitted.

SimTK::MatrixCommitment::MatrixCommitment ( const MatrixStructure structure,
const MatrixStorage storage,
const MatrixOutline outline,
const MatrixCondition condition 
)
inlineprotected

Member Function Documentation

MatrixCommitment& SimTK::MatrixCommitment::commitSize ( int  m,
int  n 
)
inline
MatrixCommitment& SimTK::MatrixCommitment::commitNumRows ( int  m)
inline
MatrixCommitment& SimTK::MatrixCommitment::commitNumCols ( int  n)
inline
MatrixCommitment& SimTK::MatrixCommitment::commitBandwidth ( int  lb,
int  ub 
)
inline
MatrixCommitment& SimTK::MatrixCommitment::commitLowerBandwidth ( int  lb)
inline
MatrixCommitment& SimTK::MatrixCommitment::commitUpperBandwidth ( int  ub)
inline
MatrixCommitment& SimTK::MatrixCommitment::commitStructure ( const MatrixStructure s)
inline
MatrixCommitment& SimTK::MatrixCommitment::commitStorage ( const MatrixStorage s)
inline
MatrixCommitment& SimTK::MatrixCommitment::commitOutline ( const MatrixOutline o)
inline
MatrixCommitment& SimTK::MatrixCommitment::commitCondition ( const MatrixCondition c)
inline
MatrixCharacter SimTK::MatrixCommitment::calcDefaultCharacter ( int  minNumRows,
int  minNumCols 
) const

For any handle commitment, we can calculate a "best character" for an allocation that satisfies the commitment, optionally with an initial allocation size.

Typically it is the least-restrictive actual character that satisfies the commitment. For example, if the commitment is Triangular we'll allocate a full triangular matrix, not a banded one, or a symmetric one, or for that matter an identity matrix, all of which would satisfy the commitment. The supplied sizes are used as minima – if the commitment requires a larger minimum size you'll get that. For example, if you specify 0x0 but you're committed to a Column outline, you'll get 0x1.

const MatrixStructure& SimTK::MatrixCommitment::getStructureCommitment ( ) const
inline

These report the commitment as it was specified.

const MatrixStorage& SimTK::MatrixCommitment::getStorageCommitment ( ) const
inline
const MatrixOutline& SimTK::MatrixCommitment::getOutlineCommitment ( ) const
inline
const MatrixCondition& SimTK::MatrixCommitment::getConditionCommitment ( ) const
inline
const MatrixStructure::Mask& SimTK::MatrixCommitment::getStructureMask ( ) const
inline

These report the masks of acceptable values generated from the commitment.

const MatrixStorage::Mask& SimTK::MatrixCommitment::getStorageMask ( ) const
inline
const MatrixOutline::Mask& SimTK::MatrixCommitment::getOutlineMask ( ) const
inline
const MatrixCondition::Mask& SimTK::MatrixCommitment::getConditionMask ( ) const
inline
MatrixCharacter::Mask::SizeMask SimTK::MatrixCommitment::getNumRowsMask ( ) const
inline
MatrixCharacter::Mask::SizeMask SimTK::MatrixCommitment::getNumColsMask ( ) const
inline
MatrixCharacter::Mask::SizeMask SimTK::MatrixCommitment::getLowerBandwidthMask ( ) const
inline
MatrixCharacter::Mask::SizeMask SimTK::MatrixCommitment::getUpperBandwidthMask ( ) const
inline
int SimTK::MatrixCommitment::getDefaultNumRows ( ) const
inline
int SimTK::MatrixCommitment::getDefaultNumCols ( ) const
inline
bool SimTK::MatrixCommitment::isSizeOK ( int  m,
int  n 
) const
inline
bool SimTK::MatrixCommitment::isSizeOK ( const std::pair< int, int > &  mn) const
inline
bool SimTK::MatrixCommitment::isBandwidthOK ( int  lower,
int  upper 
) const
inline
bool SimTK::MatrixCommitment::isSatisfiedBy ( const MatrixCharacter actual) const
inline
bool SimTK::MatrixCommitment::isStructureOK ( const MatrixStructure s) const
inline
bool SimTK::MatrixCommitment::isStorageOK ( const MatrixStorage s) const
inline
bool SimTK::MatrixCommitment::isOutlineOK ( const MatrixOutline o) const
inline
bool SimTK::MatrixCommitment::isConditionOK ( const MatrixCondition c) const
inline
bool SimTK::MatrixCommitment::isResizeable ( ) const
inline
bool SimTK::MatrixCommitment::isFullyResizeable ( ) const
inline
bool SimTK::MatrixCommitment::isNumRowsLocked ( ) const
inline
bool SimTK::MatrixCommitment::isNumColsLocked ( ) const
inline
bool SimTK::MatrixCommitment::isStructureCommitted ( ) const
inline
bool SimTK::MatrixCommitment::isStorageCommitted ( ) const
inline
bool SimTK::MatrixCommitment::isOutlineCommitted ( ) const
inline
bool SimTK::MatrixCommitment::isConditionCommitted ( ) const
inline
void SimTK::MatrixCommitment::clear ( )
inline

Set commitment s to "none" and masks to "uncommitted" for all characteristics.

Friends And Related Function Documentation

std::ostream & operator<< ( std::ostream &  o,
const MatrixCommitment  
)
related

Output a textual description of a MatrixCommitment; handy for debugging.

Member Data Documentation

MatrixStructure SimTK::MatrixCommitment::structure
protected

These are the commitments as specified.

They are used to fill in the corresponding bitmasks of acceptable characteristics below.

MatrixStorage SimTK::MatrixCommitment::storage
protected
MatrixOutline SimTK::MatrixCommitment::outline
protected
MatrixCondition SimTK::MatrixCommitment::condition
protected
MatrixCharacter::Mask SimTK::MatrixCommitment::masks
protected

These are the bitmasks of acceptable characteristics which would satisfy the above-specified commitments.


The documentation for this class was generated from the following file: