Simbody
3.7
|
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 &) | |
MatrixHelper & | copyAssign (const MatrixHelper &source) |
MatrixHelper & | negatedCopyAssign (const MatrixHelper< typename CNT< S >::TNeg > &) |
MatrixHelper & | readOnlyViewAssign (const MatrixHelper &source) |
MatrixHelper & | writableViewAssign (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 MatrixCommitment & | getCharacterCommitment () const |
const MatrixCharacter & | getMatrixCharacter () 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 > |
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>.
typedef CNT<S>::Number SimTK::MatrixHelper< S >::Number |
typedef CNT<S>::StdNumber SimTK::MatrixHelper< S >::StdNumber |
typedef CNT<S>::Precision SimTK::MatrixHelper< S >::Precision |
|
inline |
SimTK::MatrixHelper< S >::MatrixHelper | ( | int | esz, |
int | cppEsz | ||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | int | esz, |
int | cppEsz, | ||
const MatrixCommitment & | |||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | int | esz, |
int | cppEsz, | ||
const MatrixCommitment & | , | ||
int | m, | ||
int | n | ||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | const MatrixCommitment & | , |
const MatrixHelper< S > & | source, | ||
const DeepCopy & | |||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | const MatrixCommitment & | , |
const MatrixHelper< typename CNT< S >::TNeg > & | source, | ||
const DeepCopy & | |||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | int | esz, |
int | cppEsz, | ||
const MatrixCommitment & | , | ||
const MatrixCharacter & | , | ||
int | spacing, | ||
const S * | data | ||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | int | esz, |
int | cppEsz, | ||
const MatrixCommitment & | , | ||
const MatrixCharacter & | , | ||
int | spacing, | ||
S * | data | ||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | const MatrixCommitment & | , |
const MatrixHelper< S > & | , | ||
int | i, | ||
int | j, | ||
int | nrow, | ||
int | ncol | ||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | const MatrixCommitment & | , |
MatrixHelper< S > & | , | ||
int | i, | ||
int | j, | ||
int | nrow, | ||
int | ncol | ||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | const MatrixCommitment & | , |
const MatrixHelper< typename CNT< S >::THerm > & | , | ||
const TransposeView & | |||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | const MatrixCommitment & | , |
MatrixHelper< typename CNT< S >::THerm > & | , | ||
const TransposeView & | |||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | const MatrixCommitment & | , |
const MatrixHelper< S > & | , | ||
const DiagonalView & | |||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | const MatrixCommitment & | , |
MatrixHelper< S > & | , | ||
const DiagonalView & | |||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | const MatrixCommitment & | , |
const MatrixHelper< S > & | , | ||
int | n, | ||
const int * | indices | ||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | const MatrixCommitment & | , |
MatrixHelper< S > & | , | ||
int | n, | ||
const int * | indices | ||
) |
|
inline |
|
inline |
SimTK::MatrixHelper< S >::MatrixHelper | ( | const MatrixCommitment & | , |
const MatrixHelper< S > & | source, | ||
const ShallowCopy & | |||
) |
SimTK::MatrixHelper< S >::MatrixHelper | ( | const MatrixCommitment & | , |
MatrixHelper< S > & | source, | ||
const ShallowCopy & | |||
) |
|
explicit |
MatrixHelper& SimTK::MatrixHelper< S >::copyAssign | ( | const MatrixHelper< S > & | source | ) |
MatrixHelper& SimTK::MatrixHelper< S >::negatedCopyAssign | ( | const MatrixHelper< typename CNT< S >::TNeg > & | ) |
MatrixHelper& SimTK::MatrixHelper< S >::readOnlyViewAssign | ( | const MatrixHelper< S > & | source | ) |
MatrixHelper& SimTK::MatrixHelper< S >::writableViewAssign | ( | MatrixHelper< S > & | source | ) |
void SimTK::MatrixHelper< S >::clear | ( | ) |
bool SimTK::MatrixHelper< S >::isClear | ( | ) | const |
const S* SimTK::MatrixHelper< S >::getElt | ( | int | i, |
int | j | ||
) | const |
S* SimTK::MatrixHelper< S >::updElt | ( | int | i, |
int | j | ||
) |
const S* SimTK::MatrixHelper< S >::getElt | ( | int | i | ) | const |
S* SimTK::MatrixHelper< S >::updElt | ( | int | i | ) |
void SimTK::MatrixHelper< S >::getAnyElt | ( | int | i, |
int | j, | ||
S * | value | ||
) | const |
void SimTK::MatrixHelper< S >::getAnyElt | ( | int | i, |
S * | value | ||
) | const |
void SimTK::MatrixHelper< S >::sum | ( | S * | eltp | ) | const |
void SimTK::MatrixHelper< S >::colSum | ( | int | j, |
S * | eltp | ||
) | const |
void SimTK::MatrixHelper< S >::rowSum | ( | int | i, |
S * | eltp | ||
) | const |
void SimTK::MatrixHelper< S >::addIn | ( | const MatrixHelper< S > & | ) |
void SimTK::MatrixHelper< S >::addIn | ( | const MatrixHelper< typename CNT< S >::TNeg > & | ) |
void SimTK::MatrixHelper< S >::subIn | ( | const MatrixHelper< S > & | ) |
void SimTK::MatrixHelper< S >::subIn | ( | const MatrixHelper< typename CNT< S >::TNeg > & | ) |
void SimTK::MatrixHelper< S >::fillWith | ( | const S * | eltp | ) |
void SimTK::MatrixHelper< S >::copyInByRowsFromCpp | ( | const S * | elts | ) |
void SimTK::MatrixHelper< S >::fillWithScalar | ( | const StdNumber & | ) |
void SimTK::MatrixHelper< S >::scaleBy | ( | const StdNumber & | ) |
void SimTK::MatrixHelper< S >::invertInPlace | ( | ) |
void SimTK::MatrixHelper< S >::dump | ( | const char * | msg = 0 | ) | const |
int SimTK::MatrixHelper< S >::nrow | ( | ) | const |
int SimTK::MatrixHelper< S >::ncol | ( | ) | const |
ptrdiff_t SimTK::MatrixHelper< S >::nelt | ( | ) | const |
int SimTK::MatrixHelper< S >::length | ( | ) | const |
void SimTK::MatrixHelper< S >::resize | ( | int | m, |
int | n | ||
) |
void SimTK::MatrixHelper< S >::resizeKeep | ( | int | m, |
int | n | ||
) |
void SimTK::MatrixHelper< S >::lockShape | ( | ) |
void SimTK::MatrixHelper< S >::unlockShape | ( | ) |
const MatrixCommitment& SimTK::MatrixHelper< S >::getCharacterCommitment | ( | ) | const |
const MatrixCharacter& SimTK::MatrixHelper< S >::getMatrixCharacter | ( | ) | const |
void SimTK::MatrixHelper< S >::commitTo | ( | const MatrixCommitment & | ) |
bool SimTK::MatrixHelper< S >::hasContiguousData | ( | ) | const |
ptrdiff_t SimTK::MatrixHelper< S >::getContiguousDataLength | ( | ) | const |
const S* SimTK::MatrixHelper< S >::getContiguousData | ( | ) | const |
S* SimTK::MatrixHelper< S >::updContiguousData | ( | ) |
void SimTK::MatrixHelper< S >::replaceContiguousData | ( | S * | newData, |
ptrdiff_t | length, | ||
bool | takeOwnership | ||
) |
void SimTK::MatrixHelper< S >::replaceContiguousData | ( | const S * | newData, |
ptrdiff_t | length | ||
) |
void SimTK::MatrixHelper< S >::swapOwnedContiguousData | ( | S * | newData, |
ptrdiff_t | length, | ||
S *& | oldData | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
void SimTK::MatrixHelper< S >::deleteRepIfOwner | ( | ) |
void SimTK::MatrixHelper< S >::replaceRep | ( | MatrixHelperRep< S > * | ) |
|
friend |
|
friend |