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 std::vector< int > &indices)
 MatrixHelper (const MatrixCommitment &mc, MatrixHelper &h, const std::vector< 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

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

Constructor & Destructor Documentation

~MatrixHelper (  )  [inline]
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< S > &  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< S > &  ,
int  i,
int  j,
int  nrow,
int  ncol 
)
MatrixHelper ( const MatrixCommitment ,
MatrixHelper< S > &  ,
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< S > &  ,
const DiagonalView  
)
MatrixHelper ( const MatrixCommitment ,
MatrixHelper< S > &  ,
const DiagonalView  
)
MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< S > &  ,
int  n,
const int *  indices 
)
MatrixHelper ( const MatrixCommitment ,
MatrixHelper< S > &  ,
int  n,
const int *  indices 
)
MatrixHelper ( const MatrixCommitment mc,
const MatrixHelper< S > &  h,
const std::vector< int > &  indices 
) [inline]
MatrixHelper ( const MatrixCommitment mc,
MatrixHelper< S > &  h,
const std::vector< int > &  indices 
) [inline]
MatrixHelper ( const MatrixCommitment ,
const MatrixHelper< S > &  source,
const ShallowCopy  
)
MatrixHelper ( const MatrixCommitment ,
MatrixHelper< S > &  source,
const ShallowCopy  
)
MatrixHelper ( MatrixHelperRep< S > *   )  [explicit]

Member Function Documentation

void addIn ( const MatrixHelper< typename CNT< S >::TNeg > &   ) 
void addIn ( const MatrixHelper< S > &   ) 
void clear (  ) 
void colSum ( int  j,
S *  eltp 
) const

Referenced by MatrixBase< Real >::sum().

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

Friends And Related Function Documentation

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

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

Generated on Wed Dec 30 11:05:26 2009 for SimTKcore by  doxygen 1.6.1