Simbody  3.6
SimTK::MatrixCondition Class Reference

Matrix "condition" is a statement about the numerical characteristics of a Matrix. More...

Classes

struct  Mask
 Use this class to represent a set of acceptable Condition values. More...
 

Public Types

enum  Condition {
  UnknownCondition = 0x0000,
  Orthogonal = 0x0001,
  PositiveDefinite = 0x0002,
  WellConditioned = 0x0004,
  FullRank = 0x0008,
  Singular = 0x0010
}
 
enum  Diagonal {
  UnknownDiagonal = 0x0000,
  ZeroDiagonal = 0x0001,
  OneDiagonal = 0x0002,
  RealDiagonal = 0x0004,
  ImaginaryDiagonal = 0x0008
}
 
typedef unsigned short ConditionMask
 
typedef unsigned short DiagonalMask
 

Public Member Functions

std::string name () const
 
 MatrixCondition ()
 The default constructor sets the condition to Unknown, which is typically where it remains. More...
 
 MatrixCondition (Condition cond, Diagonal diag=UnknownDiagonal)
 This is an implicit conversion from the Condition enum to a MatrixCondition object. More...
 
MatrixConditionsetToNone ()
 Restore to default-constructed state of "none". More...
 
Mask mask () const
 Return the commitment mask corresponding to use of "this" condition as a commitment. More...
 
Condition getCondition () const
 
Diagonal getDiagonal () const
 
MatrixConditionsetCondition (Condition c)
 
MatrixConditionsetDiagonal (Diagonal d)
 

Static Public Member Functions

static const char * name (Condition)
 
static const char * name (Diagonal)
 
static ConditionMask calcMask (Condition)
 Given a particular Condition provided as a commitment, calculate the mask of all Condition values that would satisfy that commitment. More...
 
static DiagonalMask calcMask (Diagonal)
 Given a particular Diagonal condition provided as a commitment, calculate the mask of all Diagonal conditions that would satisfy that commitment. More...
 

Static Public Attributes

static const ConditionMask AnyCondition = 0x001fU
 
static const ConditionMask UncommittedCondition = 0xffffU
 
static const DiagonalMask AnyDiagonal = 0x000fU
 
static const DiagonalMask UncommittedDiagonal = 0xffffU
 

Detailed Description

Matrix "condition" is a statement about the numerical characteristics of a Matrix.

It can be set as a result of an operation, or by a knowledgeable user. Simmatrix is entitled to rely on the correctness of these assertions, although it will try to check them if requested or when it is possible to do so without sacrificing performance. In most cases the condition will not be set at all, which we interpret to mean "unknown condition" in an actual character, and "uncommitted" in a character commitment.

Member Typedef Documentation

◆ ConditionMask

typedef unsigned short SimTK::MatrixCondition::ConditionMask

◆ DiagonalMask

typedef unsigned short SimTK::MatrixCondition::DiagonalMask

Member Enumeration Documentation

◆ Condition

Enumerator
UnknownCondition 
Orthogonal 
PositiveDefinite 
WellConditioned 
FullRank 
Singular 

◆ Diagonal

Enumerator
UnknownDiagonal 

we don't know the condition of the diagonal elements

ZeroDiagonal 

all diagonal elements are zero (also pure real and pure imaginary)

OneDiagonal 

all diagonal elements are one (and real)

RealDiagonal 

all diagonal elements are pure real

ImaginaryDiagonal 

all diagonal elements are pure imaginary

Constructor & Destructor Documentation

◆ MatrixCondition() [1/2]

SimTK::MatrixCondition::MatrixCondition ( )
inline

The default constructor sets the condition to Unknown, which is typically where it remains.

◆ MatrixCondition() [2/2]

SimTK::MatrixCondition::MatrixCondition ( Condition  cond,
Diagonal  diag = UnknownDiagonal 
)
inline

This is an implicit conversion from the Condition enum to a MatrixCondition object.

Member Function Documentation

◆ name() [1/3]

static const char* SimTK::MatrixCondition::name ( Condition  )
static

◆ name() [2/3]

static const char* SimTK::MatrixCondition::name ( Diagonal  )
static

◆ name() [3/3]

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

◆ setToNone()

MatrixCondition& SimTK::MatrixCondition::setToNone ( )
inline

Restore to default-constructed state of "none".

◆ calcMask() [1/2]

static ConditionMask SimTK::MatrixCondition::calcMask ( Condition  )
static

Given a particular Condition provided as a commitment, calculate the mask of all Condition values that would satisfy that commitment.

For example, if the commitment is "WellConditioned" then "Orthogonal" and "PositiveDefinite" also qualify since they are automatically well conditioned. If the Condition is "Unknown" we'll return an Uncommitted mask.

◆ calcMask() [2/2]

static DiagonalMask SimTK::MatrixCondition::calcMask ( Diagonal  )
static

Given a particular Diagonal condition provided as a commitment, calculate the mask of all Diagonal conditions that would satisfy that commitment.

For example, if the commitment is "RealDiagonal" then "ZeroDiagonal" and "OneDiagonal" would also be acceptable. If the Diagonal condition is specified as "UnknownDiagonal" then we'll return an Uncommitted mask.

◆ mask()

Mask SimTK::MatrixCondition::mask ( ) const
inline

Return the commitment mask corresponding to use of "this" condition as a commitment.

◆ getCondition()

Condition SimTK::MatrixCondition::getCondition ( ) const
inline

◆ getDiagonal()

Diagonal SimTK::MatrixCondition::getDiagonal ( ) const
inline

◆ setCondition()

MatrixCondition& SimTK::MatrixCondition::setCondition ( Condition  c)
inline

◆ setDiagonal()

MatrixCondition& SimTK::MatrixCondition::setDiagonal ( Diagonal  d)
inline

Member Data Documentation

◆ AnyCondition

const ConditionMask SimTK::MatrixCondition::AnyCondition = 0x001fU
static

◆ UncommittedCondition

const ConditionMask SimTK::MatrixCondition::UncommittedCondition = 0xffffU
static

◆ AnyDiagonal

const DiagonalMask SimTK::MatrixCondition::AnyDiagonal = 0x000fU
static

◆ UncommittedDiagonal

const DiagonalMask SimTK::MatrixCondition::UncommittedDiagonal = 0xffffU
static

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