Simbody
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes

SimTK::MatrixCondition Class Reference

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

#include <MatrixCharacteristics.h>

List of all members.

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.
 MatrixCondition (Condition cond, Diagonal diag=UnknownDiagonal)
 This is an implicit conversion from the Condition enum to a MatrixCondition object.
MatrixConditionsetToNone ()
 Restore to default-constructed state of "none".
Mask mask () const
 Return the commitment mask corresponding to use of "this" condition as a commitment.
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.
static DiagonalMask calcMask (Diagonal)
 Given a particular Diagonal condition provided as a commitment, calculate the mask of all Diagonal conditions taht would satisfy that commitment.

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

typedef unsigned short SimTK::MatrixCondition::ConditionMask
typedef unsigned short SimTK::MatrixCondition::DiagonalMask

Member Enumeration Documentation

Enumerator:
UnknownCondition 
Orthogonal 
PositiveDefinite 
WellConditioned 
FullRank 
Singular 
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

SimTK::MatrixCondition::MatrixCondition ( ) [inline]

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

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

static const char* SimTK::MatrixCondition::name ( Condition  ) [static]
static const char* SimTK::MatrixCondition::name ( Diagonal  ) [static]
std::string SimTK::MatrixCondition::name ( ) const [inline]
MatrixCondition& SimTK::MatrixCondition::setToNone ( ) [inline]

Restore to default-constructed state of "none".

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.

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

Given a particular Diagonal condition provided as a commitment, calculate the mask of all Diagonal conditions taht 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 SimTK::MatrixCondition::mask ( ) const [inline]

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

Condition SimTK::MatrixCondition::getCondition ( ) const [inline]
Diagonal SimTK::MatrixCondition::getDiagonal ( ) const [inline]
MatrixCondition& SimTK::MatrixCondition::setCondition ( Condition  c) [inline]
MatrixCondition& SimTK::MatrixCondition::setDiagonal ( Diagonal  d) [inline]

Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines