Simbody  3.6
SimTK::MatrixStructure Class Reference

Matrix "structure" refers to an inherent mathematical (or at least algorithmic) characteristic of the matrix rather than a storage strategy. More...

Classes

struct  Mask
 

Public Types

enum  Structure {
  NoStructure = 0x00000000,
  Matrix1d = 0x00000001,
  Zero = 0x00000002,
  Identity = 0x00000004,
  Permutation = 0x00000008,
  RepeatedDiagonal = 0x00000010,
  Diagonal = 0x00000020,
  BiDiagonal = 0x00000040,
  TriDiagonal = 0x00000080,
  BandedSymmetric = 0x00000100,
  BandedHermitian = 0x00000200,
  Banded = 0x00000400,
  Triangular = 0x00000800,
  QuasiTriangular = 0x00001000,
  Hessenberg = 0x00002000,
  Symmetric = 0x00004000,
  Hermitian = 0x00008000,
  SkewSymmetric = 0x00010000,
  SkewHermitian = 0x00020000,
  Full = 0x00040000
}
 
enum  Position {
  NoPosition = 0x0000,
  Lower = 0x0001,
  Upper = 0x0002
}
 For triangular matrices, we have to know which triangle we're talking about. More...
 
enum  DiagValue {
  NoDiagValue = 0x0000,
  StoredDiag = 0x0001,
  ZeroDiag = 0x0002,
  UnitDiag = 0x0004
}
 For triangular, symmetric, and hermitian matrices the diagonal elements may have a single, assumed value rather than being stored in memory. More...
 
typedef unsigned int StructureMask
 
typedef unsigned short PositionMask
 
typedef unsigned short DiagValueMask
 

Public Member Functions

MatrixStructuresetMissingAttributes ()
 
std::string name () const
 
 MatrixStructure ()
 
 MatrixStructure (Structure s, Position p=NoPosition, DiagValue d=NoDiagValue)
 This constructor is also an implicit conversion from the Structure enum to a MatrixStructure object which does not specify Position or DiagValue. More...
 
Mask mask () const
 Given a Structure commitment, which more-restrictive Structures will still satisfy this commitment? Returned value is a mask with a bit set for every Structure that is satisfactory. More...
 
Structure getStructure () const
 
Position getPosition () const
 
DiagValue getDiagValue () const
 
MatrixStructuresetStructure (Structure s)
 
MatrixStructuresetPosition (Position p)
 
MatrixStructuresetDiagValue (DiagValue d)
 
MatrixStructureset (Structure s, Position p, DiagValue d)
 
MatrixStructuresetToNone ()
 

Static Public Member Functions

static const char * name (Structure)
 
static StructureMask calcStructureMask (Structure)
 
static const char * name (Position)
 
static PositionMask calcPositionMask (Structure)
 
static const char * name (DiagValue)
 
static DiagValueMask calcDiagValueMask (Structure)
 

Static Public Attributes

static const StructureMask AnyStructure = 0x0007ffffU
 
static const StructureMask UncommittedStructure = 0xffffffffU
 
static const PositionMask AnyPosition = 0x0003U
 
static const PositionMask UncommittedPosition = 0xffffU
 
static const DiagValueMask AnyDiagValue = 0x0003U
 
static const DiagValueMask UncommittedDiagValue = 0xffffU
 

Detailed Description

Matrix "structure" refers to an inherent mathematical (or at least algorithmic) characteristic of the matrix rather than a storage strategy.

Symmetry is the clearest example of this; it is far more significant mathematically than just a way to save storage and reduce operation count.

Member Typedef Documentation

◆ StructureMask

◆ PositionMask

typedef unsigned short SimTK::MatrixStructure::PositionMask

◆ DiagValueMask

typedef unsigned short SimTK::MatrixStructure::DiagValueMask

Member Enumeration Documentation

◆ Structure

Enumerator
NoStructure 

unspecified structure

Matrix1d 

a 1-d matrix (could be row or column)

Zero 

a matrix of all zeroes

Identity 

diagonal matrix with repeated 1's

Permutation 

permutation of an identity matrix

RepeatedDiagonal 

diagonal matrix with repeated element

Diagonal 

diagonal matrix with arbitrary elements

BiDiagonal 

diagonal plus one upper or lower band

TriDiagonal 

diagonal plus one upper and one lower band

BandedSymmetric 

diagonal plus adjacent symmetric bands

BandedHermitian 

diagonal plus adjacent conjugate bands

Banded 

diagonal plus upper and lower bands

Triangular 

diagonal plus all upper or all lower bands

QuasiTriangular 

triangular but with 2x2 blocks on the diagonal

Hessenberg 

triangular plus one band above/below diagonal

Symmetric 

symmetric: elt(i,j)==elt(j,i)

Hermitian 

hermitian: elt(i,j)==conjugate(elt(j,i))

SkewSymmetric 

skew symmetric: elt(i,j) == -elt(j,i)

SkewHermitian 

skew hermitian: elt(i,j) == -conjugate(elt(j,i))

Full 

full mxn matrix, all elements distinct

◆ Position

For triangular matrices, we have to know which triangle we're talking about.

Don't confuse this with MatrixStorage::Placement which has to do with where we put it in memory, not what matrix is being represented.

Enumerator
NoPosition 
Lower 
Upper 

◆ DiagValue

For triangular, symmetric, and hermitian matrices the diagonal elements may have a single, assumed value rather than being stored in memory.

This specifies the value. Don't confuse this with the similar MatrixStorage type which simply says whether there is a known value rather than stored values, not what that value is.

Enumerator
NoDiagValue 
StoredDiag 
ZeroDiag 
UnitDiag 

Constructor & Destructor Documentation

◆ MatrixStructure() [1/2]

SimTK::MatrixStructure::MatrixStructure ( )
inline

◆ MatrixStructure() [2/2]

SimTK::MatrixStructure::MatrixStructure ( Structure  s,
Position  p = NoPosition,
DiagValue  d = NoDiagValue 
)
inline

This constructor is also an implicit conversion from the Structure enum to a MatrixStructure object which does not specify Position or DiagValue.

Member Function Documentation

◆ name() [1/4]

static const char* SimTK::MatrixStructure::name ( Structure  )
static

◆ calcStructureMask()

static StructureMask SimTK::MatrixStructure::calcStructureMask ( Structure  )
static

◆ name() [2/4]

static const char* SimTK::MatrixStructure::name ( Position  )
static

◆ calcPositionMask()

static PositionMask SimTK::MatrixStructure::calcPositionMask ( Structure  )
static

◆ name() [3/4]

static const char* SimTK::MatrixStructure::name ( DiagValue  )
static

◆ calcDiagValueMask()

static DiagValueMask SimTK::MatrixStructure::calcDiagValueMask ( Structure  )
static

◆ setMissingAttributes()

MatrixStructure& SimTK::MatrixStructure::setMissingAttributes ( )
inline

◆ name() [4/4]

std::string SimTK::MatrixStructure::name ( ) const
inline

◆ mask()

Mask SimTK::MatrixStructure::mask ( ) const

Given a Structure commitment, which more-restrictive Structures will still satisfy this commitment? Returned value is a mask with a bit set for every Structure that is satisfactory.

For example, if the commitment is "Banded", "Diagonal" is also acceptable.

◆ getStructure()

Structure SimTK::MatrixStructure::getStructure ( ) const
inline

◆ getPosition()

Position SimTK::MatrixStructure::getPosition ( ) const
inline

◆ getDiagValue()

DiagValue SimTK::MatrixStructure::getDiagValue ( ) const
inline

◆ setStructure()

MatrixStructure& SimTK::MatrixStructure::setStructure ( Structure  s)
inline

◆ setPosition()

MatrixStructure& SimTK::MatrixStructure::setPosition ( Position  p)
inline

◆ setDiagValue()

MatrixStructure& SimTK::MatrixStructure::setDiagValue ( DiagValue  d)
inline

◆ set()

MatrixStructure& SimTK::MatrixStructure::set ( Structure  s,
Position  p,
DiagValue  d 
)
inline

◆ setToNone()

MatrixStructure& SimTK::MatrixStructure::setToNone ( )
inline

Member Data Documentation

◆ AnyStructure

const StructureMask SimTK::MatrixStructure::AnyStructure = 0x0007ffffU
static

◆ UncommittedStructure

const StructureMask SimTK::MatrixStructure::UncommittedStructure = 0xffffffffU
static

◆ AnyPosition

const PositionMask SimTK::MatrixStructure::AnyPosition = 0x0003U
static

◆ UncommittedPosition

const PositionMask SimTK::MatrixStructure::UncommittedPosition = 0xffffU
static

◆ AnyDiagValue

const DiagValueMask SimTK::MatrixStructure::AnyDiagValue = 0x0003U
static

◆ UncommittedDiagValue

const DiagValueMask SimTK::MatrixStructure::UncommittedDiagValue = 0xffffU
static

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