Simbody  3.6
SimTK::MatrixCharacter Class Reference

A MatrixCharacter is a set containing a value for each of the matrix characteristics except element type, which is part of the templatized declaration of a Matrix_, Vector_, or RowVector_ handle. More...

+ Inheritance diagram for SimTK::MatrixCharacter:

Classes

class  LapackFull
 Predefined MatrixCharacter for an ordinary Lapack-style full matrix of a particular dimension m x n (nrows X ncols). More...
 
class  Mask
 This class collects masks of each characteristic type for representing sets of accceptable characteristics. More...
 
class  RowVector
 Predefined MatrixCharacter for an ordinary row vector of a particular size. More...
 
class  Vector
 Predefined MatrixCharacter for an ordinary column vector of a particular size. More...
 

Public Member Functions

 MatrixCharacter ()
 Default constructor sets lengths to zero and the other characteristics to "none specified". More...
 
MatrixCharactersetToNone ()
 Restore this MatrixCharacter to its default-constructed state of "none". More...
 
int nrow () const
 These are dimensions of the logical matrix and have nothing to do with how much storage may be used to hold the elements. More...
 
int ncol () const
 
std::pair< int, int > getSize () const
 
ptrdiff_t nelt () const
 
int getLowerBandwidth () const
 
int getUpperBandwidth () const
 
std::pair< int, int > getBandwidth () const
 
const MatrixStructuregetStructure () const
 
const MatrixStoragegetStorage () const
 
const MatrixOutlinegetOutline () const
 
const MatrixConditiongetCondition () const
 
MatrixStructureupdStructure ()
 
MatrixStorageupdStorage ()
 
MatrixOutlineupdOutline ()
 
MatrixConditionupdCondition ()
 
MatrixCharactersetStructure (const MatrixStructure &sa)
 
MatrixCharactersetStorage (const MatrixStorage &sa)
 
MatrixCharactersetOutline (const MatrixOutline &oa)
 
MatrixCharactersetCondition (const MatrixCondition &ca)
 
MatrixCharactersetActualSize (int m, int n)
 Set the actual size and update the outline to match. More...
 
MatrixCharactersetActualNumRows (int m)
 
MatrixCharactersetActualNumCols (int n)
 
MatrixCharactersetBandwidth (int lb, int ub)
 
MatrixCharactersetLowerBandwidth (int lb)
 
MatrixCharactersetUpperBandwidth (int ub)
 

Protected Member Functions

 MatrixCharacter (int m, int n, int lb, int ub, MatrixStructure structure, MatrixStorage storage, MatrixCondition condition)
 

Protected Attributes

int nr
 actual number of rows More...
 
int nc
 actual number of columns More...
 
int lband
 actual lower bandwidth, if banded More...
 
int uband
 actual upper bandwidth, if banded More...
 
MatrixStructure structure
 
MatrixStorage storage
 
MatrixOutline outline
 
MatrixCondition condition
 

Related Functions

(Note that these are not member functions.)

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

Detailed Description

A MatrixCharacter is a set containing a value for each of the matrix characteristics except element type, which is part of the templatized declaration of a Matrix_, Vector_, or RowVector_ handle.

MatrixCharacters are used both as the handle "commitment", setting restrictions on what kinds of matrices a handle can reference, and as the "facts on the ground" current character of the matrix being referenced. The current character must always satisfy the character commitment.

Matrix characteristics are specifications of particular aspects of matrices:

  • Element type
  • Size
  • Structure
  • Storage format
  • Outline
  • Conditioning

Collectively, the set of values for the above properties is called a matrix character. A matrix character can be used to describe an existing matrix, or a character mask can be used to describe the range of characteristics that a matrix handle may support. The character mask describing the acceptable matrices for a matrix handle is called the handle's character commitment or just the handle commitment. The character describing an existing matrix is called the actual character of that matrix. Thus there are always two sets of characteristics associated with a matrix: the handle's commitment, and the actual character of the matrix to which the handle currently refers. The actual character must always satisfy the character commitment.

When a handle presents a view into another handle's data, it is the characteristics of the matrix as seen through the view that must satisfy the handle's character commitment. So for example, a view showing one column of a full matrix satisfies a "column" outline commitment.

Element type for a matrix handle is always determined at compile time via the template argument used in the declaration. For example, a matrix handle declared Matrix_<Vec3> can only hold matrices whose elements are Vec3s. Also, recall that Matrix is an abbreviation for Matrix_<Real> so that declaration commits the matrix handle to Real-element matrices. Element type is the only matrix characteristic for which no matrix handle can remain uncommitted. However, different handles can provide views of the same data through which that data is seen to contain different element types.

Each matrix characteristic other than sizes is represented by a class defining one or more enumerated types, where individual characteristics are assigned a single bit. Then an appropriate mask type (an unsigned integral type) is defined which can represent a set of allowable characteristics. The actual character of a matrix is represented via enumeration values; the character commitment is represented by the compatible masks. The operation of determining whether a particular actual character satisfies a handle commitment can then be performed very quickly via bitwise logical operations.

Constructor & Destructor Documentation

◆ MatrixCharacter() [1/2]

SimTK::MatrixCharacter::MatrixCharacter ( )
inline

Default constructor sets lengths to zero and the other characteristics to "none specified".

◆ MatrixCharacter() [2/2]

SimTK::MatrixCharacter::MatrixCharacter ( int  m,
int  n,
int  lb,
int  ub,
MatrixStructure  structure,
MatrixStorage  storage,
MatrixCondition  condition 
)
inlineprotected

Member Function Documentation

◆ setToNone()

MatrixCharacter& SimTK::MatrixCharacter::setToNone ( )
inline

Restore this MatrixCharacter to its default-constructed state of "none".

◆ nrow()

int SimTK::MatrixCharacter::nrow ( ) const
inline

These are dimensions of the logical matrix and have nothing to do with how much storage may be used to hold the elements.

◆ ncol()

int SimTK::MatrixCharacter::ncol ( ) const
inline

◆ getSize()

std::pair<int,int> SimTK::MatrixCharacter::getSize ( ) const
inline

◆ nelt()

ptrdiff_t SimTK::MatrixCharacter::nelt ( ) const
inline

◆ getLowerBandwidth()

int SimTK::MatrixCharacter::getLowerBandwidth ( ) const
inline

◆ getUpperBandwidth()

int SimTK::MatrixCharacter::getUpperBandwidth ( ) const
inline

◆ getBandwidth()

std::pair<int,int> SimTK::MatrixCharacter::getBandwidth ( ) const
inline

◆ getStructure()

const MatrixStructure& SimTK::MatrixCharacter::getStructure ( ) const
inline

◆ getStorage()

const MatrixStorage& SimTK::MatrixCharacter::getStorage ( ) const
inline

◆ getOutline()

const MatrixOutline& SimTK::MatrixCharacter::getOutline ( ) const
inline

◆ getCondition()

const MatrixCondition& SimTK::MatrixCharacter::getCondition ( ) const
inline

◆ updStructure()

MatrixStructure& SimTK::MatrixCharacter::updStructure ( )
inline

◆ updStorage()

MatrixStorage& SimTK::MatrixCharacter::updStorage ( )
inline

◆ updOutline()

MatrixOutline& SimTK::MatrixCharacter::updOutline ( )
inline

◆ updCondition()

MatrixCondition& SimTK::MatrixCharacter::updCondition ( )
inline

◆ setStructure()

MatrixCharacter& SimTK::MatrixCharacter::setStructure ( const MatrixStructure sa)
inline

◆ setStorage()

MatrixCharacter& SimTK::MatrixCharacter::setStorage ( const MatrixStorage sa)
inline

◆ setOutline()

MatrixCharacter& SimTK::MatrixCharacter::setOutline ( const MatrixOutline oa)
inline

◆ setCondition()

MatrixCharacter& SimTK::MatrixCharacter::setCondition ( const MatrixCondition ca)
inline

◆ setActualSize()

MatrixCharacter& SimTK::MatrixCharacter::setActualSize ( int  m,
int  n 
)
inline

Set the actual size and update the outline to match.

◆ setActualNumRows()

MatrixCharacter& SimTK::MatrixCharacter::setActualNumRows ( int  m)
inline

◆ setActualNumCols()

MatrixCharacter& SimTK::MatrixCharacter::setActualNumCols ( int  n)
inline

◆ setBandwidth()

MatrixCharacter& SimTK::MatrixCharacter::setBandwidth ( int  lb,
int  ub 
)
inline

◆ setLowerBandwidth()

MatrixCharacter& SimTK::MatrixCharacter::setLowerBandwidth ( int  lb)
inline

◆ setUpperBandwidth()

MatrixCharacter& SimTK::MatrixCharacter::setUpperBandwidth ( int  ub)
inline

Friends And Related Function Documentation

◆ operator<<()

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

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

Member Data Documentation

◆ nr

int SimTK::MatrixCharacter::nr
protected

actual number of rows

◆ nc

int SimTK::MatrixCharacter::nc
protected

actual number of columns

◆ lband

int SimTK::MatrixCharacter::lband
protected

actual lower bandwidth, if banded

◆ uband

int SimTK::MatrixCharacter::uband
protected

actual upper bandwidth, if banded

◆ structure

MatrixStructure SimTK::MatrixCharacter::structure
protected

◆ storage

MatrixStorage SimTK::MatrixCharacter::storage
protected

◆ outline

MatrixOutline SimTK::MatrixCharacter::outline
protected

◆ condition

MatrixCondition SimTK::MatrixCharacter::condition
protected

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