Simbody  3.7
SimTK::MatrixOutline Class Reference

Matrix "outline" refers to the characteristic relationship between the number of rows and columns of a matrix, without necessarily specifying the absolute dimensions. More...

Classes

struct  Mask
 

Public Types

enum  Outline {
  NoOutline = 0x0000,
  Scalar = 0x0001,
  Column = 0x0002,
  Row = 0x0004,
  Square = 0x0008,
  Wide = 0x0010,
  Tall = 0x0020,
  Rectangular = 0x0040
}
 
typedef unsigned short OutlineMask
 

Public Member Functions

std::string name () const
 
 MatrixOutline ()
 Default constructor produces an object containing no outline specification. More...
 
 MatrixOutline (Outline outline)
 This is an implicit conversion from the Outline enum to a MatrixOutline object. More...
 
MatrixOutlinesetToNone ()
 Set the outline back to its default-constructed value of "none". More...
 
Mask mask () const
 When "this" outline is used as a commitment, it represents a mask of acceptable outlines. More...
 
bool isSizeOK (int m, int n) const
 Determine if the proposed shape satisfies this outline. More...
 
void getMinimumSize (int &m, int &n) const
 Return the minimum shape that will satisfy this outline. More...
 
Outline getOutline () const
 Return the outline value stored in this MatrixOutline object. More...
 

Static Public Member Functions

static const char * name (Outline)
 
static OutlineMask calcMask (Outline)
 Compute a mask of acceptable Outline values given a particular value specified as a commitment. More...
 
static MatrixOutline calcFromSize (int m, int n)
 Determine the outline from given actual dimensions. More...
 

Static Public Attributes

static const OutlineMask AnyOutline = 0x007fU
 
static const OutlineMask UncommittedOutline = 0xffffU
 

Detailed Description

Matrix "outline" refers to the characteristic relationship between the number of rows and columns of a matrix, without necessarily specifying the absolute dimensions.

There are seven possible outline attributes:

  • Rectangular (any m x n)
  • Tall (m >= n)
  • Wide (m <= n)
  • Square (m == n)
  • Column (m x 1)
  • Row (1 x n)
  • Scalar (1 x 1)

A matrix handle with no outline commitment can hold a general (rectangular) matrix, which of course includes all the other outlines as well. Vector handles are always committed to column outline, RowVector handles to row outline. Scalar matrices are also rows, columns, and square and some rows and columns are square (if they are 1x1).

Note that certain outlines imply fixed sizes of one or both dimensions.

Member Typedef Documentation

◆ OutlineMask

typedef unsigned short SimTK::MatrixOutline::OutlineMask

Member Enumeration Documentation

◆ Outline

Enumerator
NoOutline 
Scalar 
Column 
Row 
Square 
Wide 
Tall 
Rectangular 

Constructor & Destructor Documentation

◆ MatrixOutline() [1/2]

SimTK::MatrixOutline::MatrixOutline ( )
inline

Default constructor produces an object containing no outline specification.

If used as a commitment it won't accept any outline!

◆ MatrixOutline() [2/2]

SimTK::MatrixOutline::MatrixOutline ( Outline  outline)
inline

This is an implicit conversion from the Outline enum to a MatrixOutline object.

Member Function Documentation

◆ name() [1/2]

static const char* SimTK::MatrixOutline::name ( Outline  )
static

◆ name() [2/2]

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

◆ setToNone()

MatrixOutline& SimTK::MatrixOutline::setToNone ( )
inline

Set the outline back to its default-constructed value of "none".

◆ calcMask()

static OutlineMask SimTK::MatrixOutline::calcMask ( Outline  )
static

Compute a mask of acceptable Outline values given a particular value specified as a commitment.

For example, if the commitment is "Wide" then Square, Row, and Scalar outlines are also acceptable.

◆ mask()

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

When "this" outline is used as a commitment, it represents a mask of acceptable outlines.

Calculate and return that mask.

◆ isSizeOK()

bool SimTK::MatrixOutline::isSizeOK ( int  m,
int  n 
) const

Determine if the proposed shape satisfies this outline.

◆ getMinimumSize()

void SimTK::MatrixOutline::getMinimumSize ( int &  m,
int &  n 
) const

Return the minimum shape that will satisfy this outline.

◆ calcFromSize()

static MatrixOutline SimTK::MatrixOutline::calcFromSize ( int  m,
int  n 
)
static

Determine the outline from given actual dimensions.

◆ getOutline()

Outline SimTK::MatrixOutline::getOutline ( ) const
inline

Return the outline value stored in this MatrixOutline object.

Member Data Documentation

◆ AnyOutline

const OutlineMask SimTK::MatrixOutline::AnyOutline = 0x007fU
static

◆ UncommittedOutline

const OutlineMask SimTK::MatrixOutline::UncommittedOutline = 0xffffU
static

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