Simbody
Classes | Public Types | Public Member Functions | Friends

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...

#include <MatrixHelper.h>

List of all members.

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
template<class SA , class SB >
void matmul (const StdNumber &beta, const StdNumber &alpha, const MatrixHelper< SA > &A, const MatrixHelper< SB > &B)
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, long double and the associated complex and conjugate types, and their negators (a total of 18 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

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

Constructor & Destructor Documentation

template<class S>
SimTK::MatrixHelper< S >::~MatrixHelper ( ) [inline]
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( int  esz,
int  cppEsz 
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( int  esz,
int  cppEsz,
const MatrixCommitment  
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( int  esz,
int  cppEsz,
const MatrixCommitment ,
int  m,
int  n 
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< S > &  source,
const DeepCopy  
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< typename CNT< S >::TNeg > &  source,
const DeepCopy  
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( int  esz,
int  cppEsz,
const MatrixCommitment ,
const MatrixCharacter ,
int  spacing,
const S *  data 
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( int  esz,
int  cppEsz,
const MatrixCommitment ,
const MatrixCharacter ,
int  spacing,
S *  data 
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< S > &  ,
int  i,
int  j,
int  nrow,
int  ncol 
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
MatrixHelper< S > &  ,
int  i,
int  j,
int  nrow,
int  ncol 
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< typename CNT< S >::THerm > &  ,
const TransposeView  
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
MatrixHelper< typename CNT< S >::THerm > &  ,
const TransposeView  
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< S > &  ,
const DiagonalView  
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
MatrixHelper< S > &  ,
const DiagonalView  
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< S > &  ,
int  n,
const int *  indices 
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
MatrixHelper< S > &  ,
int  n,
const int *  indices 
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment mc,
const MatrixHelper< S > &  h,
const Array_< int > &  indices 
) [inline]
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment mc,
MatrixHelper< S > &  h,
const Array_< int > &  indices 
) [inline]
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< S > &  source,
const ShallowCopy  
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( const MatrixCommitment ,
MatrixHelper< S > &  source,
const ShallowCopy  
)
template<class S>
SimTK::MatrixHelper< S >::MatrixHelper ( MatrixHelperRep< S > *  ) [explicit]

Member Function Documentation

template<class S>
MatrixHelper& SimTK::MatrixHelper< S >::copyAssign ( const MatrixHelper< S > &  source)
template<class S>
MatrixHelper& SimTK::MatrixHelper< S >::negatedCopyAssign ( const MatrixHelper< typename CNT< S >::TNeg > &  )
template<class S>
MatrixHelper& SimTK::MatrixHelper< S >::readOnlyViewAssign ( const MatrixHelper< S > &  source)
template<class S>
MatrixHelper& SimTK::MatrixHelper< S >::writableViewAssign ( MatrixHelper< S > &  source)
template<class S>
void SimTK::MatrixHelper< S >::clear ( )
template<class S>
bool SimTK::MatrixHelper< S >::isClear ( ) const
template<class S>
const S* SimTK::MatrixHelper< S >::getElt ( int  i,
int  j 
) const
template<class S>
S* SimTK::MatrixHelper< S >::updElt ( int  i,
int  j 
)
template<class S>
const S* SimTK::MatrixHelper< S >::getElt ( int  i) const
template<class S>
S* SimTK::MatrixHelper< S >::updElt ( int  i)
template<class S>
void SimTK::MatrixHelper< S >::getAnyElt ( int  i,
int  j,
S *  value 
) const
template<class S>
void SimTK::MatrixHelper< S >::getAnyElt ( int  i,
S *  value 
) const
template<class S>
void SimTK::MatrixHelper< S >::sum ( S *  eltp) const
template<class S>
void SimTK::MatrixHelper< S >::colSum ( int  j,
S *  eltp 
) const
template<class S>
void SimTK::MatrixHelper< S >::rowSum ( int  i,
S *  eltp 
) const
template<class S>
void SimTK::MatrixHelper< S >::addIn ( const MatrixHelper< S > &  )
template<class S>
void SimTK::MatrixHelper< S >::addIn ( const MatrixHelper< typename CNT< S >::TNeg > &  )
template<class S>
void SimTK::MatrixHelper< S >::subIn ( const MatrixHelper< S > &  )
template<class S>
void SimTK::MatrixHelper< S >::subIn ( const MatrixHelper< typename CNT< S >::TNeg > &  )
template<class S>
void SimTK::MatrixHelper< S >::fillWith ( const S *  eltp)
template<class S>
void SimTK::MatrixHelper< S >::copyInByRowsFromCpp ( const S *  elts)
template<class S>
void SimTK::MatrixHelper< S >::fillWithScalar ( const StdNumber )
template<class S>
void SimTK::MatrixHelper< S >::scaleBy ( const StdNumber )
template<class S>
void SimTK::MatrixHelper< S >::invertInPlace ( )
template<class S>
void SimTK::MatrixHelper< S >::dump ( const char *  msg = 0) const
template<class S>
template<class SA , class SB >
void SimTK::MatrixHelper< S >::matmul ( const StdNumber beta,
const StdNumber alpha,
const MatrixHelper< SA > &  A,
const MatrixHelper< SB > &  B 
)
template<class S>
int SimTK::MatrixHelper< S >::nrow ( ) const
template<class S>
int SimTK::MatrixHelper< S >::ncol ( ) const
template<class S>
ptrdiff_t SimTK::MatrixHelper< S >::nelt ( ) const
template<class S>
int SimTK::MatrixHelper< S >::length ( ) const
template<class S>
void SimTK::MatrixHelper< S >::resize ( int  m,
int  n 
)
template<class S>
void SimTK::MatrixHelper< S >::resizeKeep ( int  m,
int  n 
)
template<class S>
void SimTK::MatrixHelper< S >::lockShape ( )
template<class S>
void SimTK::MatrixHelper< S >::unlockShape ( )
template<class S>
const MatrixCommitment& SimTK::MatrixHelper< S >::getCharacterCommitment ( ) const
template<class S>
const MatrixCharacter& SimTK::MatrixHelper< S >::getMatrixCharacter ( ) const
template<class S>
void SimTK::MatrixHelper< S >::commitTo ( const MatrixCommitment )
template<class S>
bool SimTK::MatrixHelper< S >::hasContiguousData ( ) const
template<class S>
ptrdiff_t SimTK::MatrixHelper< S >::getContiguousDataLength ( ) const
template<class S>
const S* SimTK::MatrixHelper< S >::getContiguousData ( ) const
template<class S>
S* SimTK::MatrixHelper< S >::updContiguousData ( )
template<class S>
void SimTK::MatrixHelper< S >::replaceContiguousData ( S *  newData,
ptrdiff_t  length,
bool  takeOwnership 
)
template<class S>
void SimTK::MatrixHelper< S >::replaceContiguousData ( const S *  newData,
ptrdiff_t  length 
)
template<class S>
void SimTK::MatrixHelper< S >::swapOwnedContiguousData ( S *  newData,
ptrdiff_t  length,
S *&  oldData 
)
template<class S>
const MatrixHelperRep<S>& SimTK::MatrixHelper< S >::getRep ( ) const [inline]
template<class S>
MatrixHelperRep<S>& SimTK::MatrixHelper< S >::updRep ( ) [inline]
template<class S>
void SimTK::MatrixHelper< S >::setRep ( MatrixHelperRep< S > *  hrep) [inline]
template<class S>
MatrixHelperRep<S>* SimTK::MatrixHelper< S >::stealRep ( ) [inline]
template<class S>
void SimTK::MatrixHelper< S >::deleteRepIfOwner ( )
template<class S>
void SimTK::MatrixHelper< S >::replaceRep ( MatrixHelperRep< S > *  )

Friends And Related Function Documentation

template<class S>
friend class MatrixHelper< typename CNT< S >::TNeg > [friend]
template<class S>
friend class MatrixHelper< typename CNT< S >::THerm > [friend]

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