Simbody  3.7
SimTK::MatrixHelper< S > Class Template Reference

Here we define class MatrixHelper<S>, the scalar-type templatized helper class for the more general, composite numerical type-templatized class MatrixBase<ELT>. More...

Classes

class  DeepCopy
 
class  DiagonalView
 
class  ShallowCopy
 
class  TransposeView
 

Public Types

typedef CNT< S >::Number Number
 
typedef CNT< S >::StdNumber StdNumber
 
typedef CNT< S >::Precision Precision
 

Public Member Functions

 ~MatrixHelper ()
 
 MatrixHelper (int esz, int cppEsz)
 
 MatrixHelper (int esz, int cppEsz, const MatrixCommitment &)
 
 MatrixHelper (int esz, int cppEsz, const MatrixCommitment &, int m, int n)
 
 MatrixHelper (const MatrixCommitment &, const MatrixHelper &source, const DeepCopy &)
 
 MatrixHelper (const MatrixCommitment &, const MatrixHelper< typename CNT< S >::TNeg > &source, const DeepCopy &)
 
 MatrixHelper (int esz, int cppEsz, const MatrixCommitment &, const MatrixCharacter &, int spacing, const S *data)
 
 MatrixHelper (int esz, int cppEsz, const MatrixCommitment &, const MatrixCharacter &, int spacing, S *data)
 
 MatrixHelper (const MatrixCommitment &, const MatrixHelper &, int i, int j, int nrow, int ncol)
 
 MatrixHelper (const MatrixCommitment &, MatrixHelper &, int i, int j, int nrow, int ncol)
 
 MatrixHelper (const MatrixCommitment &, const MatrixHelper< typename CNT< S >::THerm > &, const TransposeView &)
 
 MatrixHelper (const MatrixCommitment &, MatrixHelper< typename CNT< S >::THerm > &, const TransposeView &)
 
 MatrixHelper (const MatrixCommitment &, const MatrixHelper &, const DiagonalView &)
 
 MatrixHelper (const MatrixCommitment &, MatrixHelper &, const DiagonalView &)
 
 MatrixHelper (const MatrixCommitment &, const MatrixHelper &, int n, const int *indices)
 
 MatrixHelper (const MatrixCommitment &, MatrixHelper &, int n, const int *indices)
 
 MatrixHelper (const MatrixCommitment &mc, const MatrixHelper &h, const Array_< int > &indices)
 
 MatrixHelper (const MatrixCommitment &mc, MatrixHelper &h, const Array_< int > &indices)
 
 MatrixHelper (const MatrixCommitment &, const MatrixHelper &source, const ShallowCopy &)
 
 MatrixHelper (const MatrixCommitment &, MatrixHelper &source, const ShallowCopy &)
 
MatrixHelpercopyAssign (const MatrixHelper &source)
 
MatrixHelpernegatedCopyAssign (const MatrixHelper< typename CNT< S >::TNeg > &)
 
MatrixHelperreadOnlyViewAssign (const MatrixHelper &source)
 
MatrixHelperwritableViewAssign (MatrixHelper &source)
 
void clear ()
 
bool isClear () const
 
const S * getElt (int i, int j) const
 
S * updElt (int i, int j)
 
const S * getElt (int i) const
 
S * updElt (int i)
 
void getAnyElt (int i, int j, S *value) const
 
void getAnyElt (int i, S *value) const
 
void sum (S *eltp) const
 
void colSum (int j, S *eltp) const
 
void rowSum (int i, S *eltp) const
 
void addIn (const MatrixHelper &)
 
void addIn (const MatrixHelper< typename CNT< S >::TNeg > &)
 
void subIn (const MatrixHelper &)
 
void subIn (const MatrixHelper< typename CNT< S >::TNeg > &)
 
void fillWith (const S *eltp)
 
void copyInByRowsFromCpp (const S *elts)
 
void fillWithScalar (const StdNumber &)
 
void scaleBy (const StdNumber &)
 
void invertInPlace ()
 
void dump (const char *msg=0) const
 
int nrow () const
 
int ncol () const
 
ptrdiff_t nelt () const
 
int length () const
 
void resize (int m, int n)
 
void resizeKeep (int m, int n)
 
void lockShape ()
 
void unlockShape ()
 
const MatrixCommitmentgetCharacterCommitment () const
 
const MatrixCharactergetMatrixCharacter () const
 
void commitTo (const MatrixCommitment &)
 
bool hasContiguousData () const
 
ptrdiff_t getContiguousDataLength () const
 
const S * getContiguousData () const
 
S * updContiguousData ()
 
void replaceContiguousData (S *newData, ptrdiff_t length, bool takeOwnership)
 
void replaceContiguousData (const S *newData, ptrdiff_t length)
 
void swapOwnedContiguousData (S *newData, ptrdiff_t length, S *&oldData)
 
const MatrixHelperRep< S > & getRep () const
 
MatrixHelperRep< S > & updRep ()
 
void setRep (MatrixHelperRep< S > *hrep)
 
MatrixHelperRep< S > * stealRep ()
 
void deleteRepIfOwner ()
 
void replaceRep (MatrixHelperRep< S > *)
 
 MatrixHelper (MatrixHelperRep< S > *)
 

Friends

class MatrixHelper< typename CNT< S >::TNeg >
 
class MatrixHelper< typename CNT< S >::THerm >
 

Detailed Description

template<class S>
class SimTK::MatrixHelper< S >

Here we define class MatrixHelper<S>, the scalar-type templatized helper class for the more general, composite numerical type-templatized class MatrixBase<ELT>.

The helper class is not intended to appear directly in user programs; it is client-side code used by the client-side Matrix<CNT>, Vector<CNT>, etc. templates to reduce the infinite set of possible CNT templates to a finite set of scalar templates which can then have hidden implementations in the Simmatrix library. The hidden implementation class will be instantiated once each for float, double and the associated complex and conjugate types, and their negators (a total of 12 types). Element size is dealt with at run time; otherwise the helper knows nothing about the structure of the elements.

The constructors for numerical types should not initialize the numerical values. We take advantage of that here – this class assumes it can simply allocate the appropriate amount of data as an array of the underlying scalar type, with no implicit initialization. We'll fill uninitialized data with NaNs when debugging or if specifically requested; otherwise it will contain garbage initially.

Note that this is just a templatized handle class. The implementation is private, in the undefined class MatrixHelperRep<S>.

Member Typedef Documentation

◆ Number

template<class S>
typedef CNT<S>::Number SimTK::MatrixHelper< S >::Number

◆ StdNumber

template<class S>
typedef CNT<S>::StdNumber SimTK::MatrixHelper< S >::StdNumber

◆ Precision

template<class S>
typedef CNT<S>::Precision SimTK::MatrixHelper< S >::Precision

Constructor & Destructor Documentation

◆ ~MatrixHelper()

template<class S>
SimTK::MatrixHelper< S >::~MatrixHelper ( )
inline

◆ MatrixHelper() [1/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( int  esz,
int  cppEsz 
)

◆ MatrixHelper() [2/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( int  esz,
int  cppEsz,
const MatrixCommitment  
)

◆ MatrixHelper() [3/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( int  esz,
int  cppEsz,
const MatrixCommitment ,
int  m,
int  n 
)

◆ MatrixHelper() [4/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< S > &  source,
const DeepCopy  
)

◆ MatrixHelper() [5/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< typename CNT< S >::TNeg > &  source,
const DeepCopy  
)

◆ MatrixHelper() [6/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( int  esz,
int  cppEsz,
const MatrixCommitment ,
const MatrixCharacter ,
int  spacing,
const S *  data 
)

◆ MatrixHelper() [7/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( int  esz,
int  cppEsz,
const MatrixCommitment ,
const MatrixCharacter ,
int  spacing,
S *  data 
)

◆ MatrixHelper() [8/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< S > &  ,
int  i,
int  j,
int  nrow,
int  ncol 
)

◆ MatrixHelper() [9/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
MatrixHelper< S > &  ,
int  i,
int  j,
int  nrow,
int  ncol 
)

◆ MatrixHelper() [10/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< typename CNT< S >::THerm > &  ,
const TransposeView  
)

◆ MatrixHelper() [11/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
MatrixHelper< typename CNT< S >::THerm > &  ,
const TransposeView  
)

◆ MatrixHelper() [12/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< S > &  ,
const DiagonalView  
)

◆ MatrixHelper() [13/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
MatrixHelper< S > &  ,
const DiagonalView  
)

◆ MatrixHelper() [14/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< S > &  ,
int  n,
const int *  indices 
)

◆ MatrixHelper() [15/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
MatrixHelper< S > &  ,
int  n,
const int *  indices 
)

◆ MatrixHelper() [16/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment mc,
const MatrixHelper< S > &  h,
const Array_< int > &  indices 
)
inline

◆ MatrixHelper() [17/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment mc,
MatrixHelper< S > &  h,
const Array_< int > &  indices 
)
inline

◆ MatrixHelper() [18/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< S > &  source,
const ShallowCopy  
)

◆ MatrixHelper() [19/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
MatrixHelper< S > &  source,
const ShallowCopy  
)

◆ MatrixHelper() [20/20]

template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( MatrixHelperRep< S > *  )
explicit

Member Function Documentation

◆ copyAssign()

template<class S>
MatrixHelper& SimTK::MatrixHelper< S >::copyAssign ( const MatrixHelper< S > &  source)

◆ negatedCopyAssign()

template<class S>
MatrixHelper& SimTK::MatrixHelper< S >::negatedCopyAssign ( const MatrixHelper< typename CNT< S >::TNeg > &  )

◆ readOnlyViewAssign()

template<class S>
MatrixHelper& SimTK::MatrixHelper< S >::readOnlyViewAssign ( const MatrixHelper< S > &  source)

◆ writableViewAssign()

template<class S>
MatrixHelper& SimTK::MatrixHelper< S >::writableViewAssign ( MatrixHelper< S > &  source)

◆ clear()

template<class S>
void SimTK::MatrixHelper< S >::clear ( )

◆ isClear()

template<class S>
bool SimTK::MatrixHelper< S >::isClear ( ) const

◆ getElt() [1/2]

template<class S>
const S* SimTK::MatrixHelper< S >::getElt ( int  i,
int  j 
) const

◆ updElt() [1/2]

template<class S>
S* SimTK::MatrixHelper< S >::updElt ( int  i,
int  j 
)

◆ getElt() [2/2]

template<class S>
const S* SimTK::MatrixHelper< S >::getElt ( int  i) const

◆ updElt() [2/2]

template<class S>
S* SimTK::MatrixHelper< S >::updElt ( int  i)

◆ getAnyElt() [1/2]

template<class S>
void SimTK::MatrixHelper< S >::getAnyElt ( int  i,
int  j,
S *  value 
) const

◆ getAnyElt() [2/2]

template<class S>
void SimTK::MatrixHelper< S >::getAnyElt ( int  i,
S *  value 
) const

◆ sum()

template<class S>
void SimTK::MatrixHelper< S >::sum ( S *  eltp) const

◆ colSum()

template<class S>
void SimTK::MatrixHelper< S >::colSum ( int  j,
S *  eltp 
) const

◆ rowSum()

template<class S>
void SimTK::MatrixHelper< S >::rowSum ( int  i,
S *  eltp 
) const

◆ addIn() [1/2]

template<class S>
void SimTK::MatrixHelper< S >::addIn ( const MatrixHelper< S > &  )

◆ addIn() [2/2]

template<class S>
void SimTK::MatrixHelper< S >::addIn ( const MatrixHelper< typename CNT< S >::TNeg > &  )

◆ subIn() [1/2]

template<class S>
void SimTK::MatrixHelper< S >::subIn ( const MatrixHelper< S > &  )

◆ subIn() [2/2]

template<class S>
void SimTK::MatrixHelper< S >::subIn ( const MatrixHelper< typename CNT< S >::TNeg > &  )

◆ fillWith()

template<class S>
void SimTK::MatrixHelper< S >::fillWith ( const S *  eltp)

◆ copyInByRowsFromCpp()

template<class S>
void SimTK::MatrixHelper< S >::copyInByRowsFromCpp ( const S *  elts)

◆ fillWithScalar()

template<class S>
void SimTK::MatrixHelper< S >::fillWithScalar ( const StdNumber )

◆ scaleBy()

template<class S>
void SimTK::MatrixHelper< S >::scaleBy ( const StdNumber )

◆ invertInPlace()

template<class S>
void SimTK::MatrixHelper< S >::invertInPlace ( )

◆ dump()

template<class S>
void SimTK::MatrixHelper< S >::dump ( const char *  msg = 0) const

◆ nrow()

template<class S>
int SimTK::MatrixHelper< S >::nrow ( ) const

◆ ncol()

template<class S>
int SimTK::MatrixHelper< S >::ncol ( ) const

◆ nelt()

template<class S>
ptrdiff_t SimTK::MatrixHelper< S >::nelt ( ) const

◆ length()

template<class S>
int SimTK::MatrixHelper< S >::length ( ) const

◆ resize()

template<class S>
void SimTK::MatrixHelper< S >::resize ( int  m,
int  n 
)

◆ resizeKeep()

template<class S>
void SimTK::MatrixHelper< S >::resizeKeep ( int  m,
int  n 
)

◆ lockShape()

template<class S>
void SimTK::MatrixHelper< S >::lockShape ( )

◆ unlockShape()

template<class S>
void SimTK::MatrixHelper< S >::unlockShape ( )

◆ getCharacterCommitment()

template<class S>
const MatrixCommitment& SimTK::MatrixHelper< S >::getCharacterCommitment ( ) const

◆ getMatrixCharacter()

template<class S>
const MatrixCharacter& SimTK::MatrixHelper< S >::getMatrixCharacter ( ) const

◆ commitTo()

template<class S>
void SimTK::MatrixHelper< S >::commitTo ( const MatrixCommitment )

◆ hasContiguousData()

template<class S>
bool SimTK::MatrixHelper< S >::hasContiguousData ( ) const

◆ getContiguousDataLength()

template<class S>
ptrdiff_t SimTK::MatrixHelper< S >::getContiguousDataLength ( ) const

◆ getContiguousData()

template<class S>
const S* SimTK::MatrixHelper< S >::getContiguousData ( ) const

◆ updContiguousData()

template<class S>
S* SimTK::MatrixHelper< S >::updContiguousData ( )

◆ replaceContiguousData() [1/2]

template<class S>
void SimTK::MatrixHelper< S >::replaceContiguousData ( S *  newData,
ptrdiff_t  length,
bool  takeOwnership 
)

◆ replaceContiguousData() [2/2]

template<class S>
void SimTK::MatrixHelper< S >::replaceContiguousData ( const S *  newData,
ptrdiff_t  length 
)

◆ swapOwnedContiguousData()

template<class S>
void SimTK::MatrixHelper< S >::swapOwnedContiguousData ( S *  newData,
ptrdiff_t  length,
S *&  oldData 
)

◆ getRep()

template<class S>
const MatrixHelperRep<S>& SimTK::MatrixHelper< S >::getRep ( ) const
inline

◆ updRep()

template<class S>
MatrixHelperRep<S>& SimTK::MatrixHelper< S >::updRep ( )
inline

◆ setRep()

template<class S>
void SimTK::MatrixHelper< S >::setRep ( MatrixHelperRep< S > *  hrep)
inline

◆ stealRep()

template<class S>
MatrixHelperRep<S>* SimTK::MatrixHelper< S >::stealRep ( )
inline

◆ deleteRepIfOwner()

template<class S>
void SimTK::MatrixHelper< S >::deleteRepIfOwner ( )

◆ replaceRep()

template<class S>
void SimTK::MatrixHelper< S >::replaceRep ( MatrixHelperRep< S > *  )

Friends And Related Function Documentation

◆ MatrixHelper< typename CNT< S >::TNeg >

template<class S>
friend class MatrixHelper< typename CNT< S >::TNeg >
friend

◆ MatrixHelper< typename CNT< S >::THerm >

template<class S>
friend class MatrixHelper< typename CNT< S >::THerm >
friend

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