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>
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 |
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 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, 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>.
~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 Array_< int > & | indices | |||
) | [inline] |
Referenced by MatrixHelper< Scalar >::MatrixHelper().
MatrixHelper | ( | const MatrixCommitment & | mc, | |
MatrixHelper< S > & | h, | |||
const Array_< int > & | indices | |||
) | [inline] |
Referenced by MatrixHelper< Scalar >::MatrixHelper().
MatrixHelper | ( | const MatrixCommitment & | , | |
const MatrixHelper< S > & | source, | |||
const ShallowCopy & | ||||
) |
MatrixHelper | ( | const MatrixCommitment & | , | |
MatrixHelper< S > & | source, | |||
const ShallowCopy & | ||||
) |
MatrixHelper | ( | MatrixHelperRep< S > * | ) | [explicit] |
void addIn | ( | const MatrixHelper< typename CNT< S >::TNeg > & | ) |
void addIn | ( | const MatrixHelper< S > & | ) |
Referenced by MatrixBase< Real >::operator+=().
void clear | ( | ) |
Referenced by MatrixBase< Real >::clear().
void colSum | ( | int | j, | |
S * | eltp | |||
) | const |
Referenced by MatrixBase< Real >::sum().
void commitTo | ( | const MatrixCommitment & | ) |
Referenced by MatrixBase< Real >::commitTo().
MatrixHelper& copyAssign | ( | const MatrixHelper< S > & | source | ) |
Referenced by MatrixBase< Real >::copyAssign().
void copyInByRowsFromCpp | ( | const S * | elts | ) |
Referenced by MatrixBase< Real >::MatrixBase().
void deleteRepIfOwner | ( | ) |
void dump | ( | const char * | msg = 0 |
) | const |
Referenced by MatrixBase< Real >::dump().
void fillWith | ( | const S * | eltp | ) |
Referenced by MatrixBase< Real >::MatrixBase(), and MatrixBase< Real >::setTo().
void fillWithScalar | ( | const StdNumber & | ) |
Referenced by MatrixBase< Real >::setToNaN(), and MatrixBase< Real >::setToZero().
void getAnyElt | ( | int | i, | |
S * | value | |||
) | const |
void getAnyElt | ( | int | i, | |
int | j, | |||
S * | value | |||
) | const |
Referenced by MatrixBase< Real >::getAnyElt().
const MatrixCommitment& getCharacterCommitment | ( | ) | const |
Referenced by MatrixBase< Real >::getCharacterCommitment().
const S* getContiguousData | ( | ) | const |
Referenced by MatrixBase< Real >::getContiguousScalarData().
ptrdiff_t getContiguousDataLength | ( | ) | const |
Referenced by MatrixBase< Real >::getContiguousScalarDataLength().
const S* getElt | ( | int | i | ) | const |
const S* getElt | ( | int | i, | |
int | j | |||
) | const |
const MatrixCharacter& getMatrixCharacter | ( | ) | const |
Referenced by MatrixBase< Real >::getMatrixCharacter().
const MatrixHelperRep<S>& getRep | ( | ) | const [inline] |
bool hasContiguousData | ( | ) | const |
Referenced by MatrixBase< Real >::hasContiguousData().
void invertInPlace | ( | ) |
Referenced by MatrixBase< Real >::invert(), and MatrixBase< Real >::invertInPlace().
bool isClear | ( | ) | const |
int length | ( | ) | const |
void lockShape | ( | ) |
Referenced by MatrixBase< Real >::lockShape().
void matmul | ( | const StdNumber & | beta, | |
const StdNumber & | alpha, | |||
const MatrixHelper< SA > & | A, | |||
const MatrixHelper< SB > & | B | |||
) | [inline] |
Referenced by MatrixBase< Real >::matmul().
int ncol | ( | ) | const |
Referenced by MatrixBase< Real >::ncol().
MatrixHelper& negatedCopyAssign | ( | const MatrixHelper< typename CNT< S >::TNeg > & | ) |
ptrdiff_t nelt | ( | ) | const |
Referenced by MatrixBase< Real >::nelt().
int nrow | ( | ) | const |
Referenced by MatrixBase< Real >::nrow().
MatrixHelper& readOnlyViewAssign | ( | const MatrixHelper< S > & | source | ) |
void replaceContiguousData | ( | const S * | newData, | |
ptrdiff_t | length | |||
) |
void replaceContiguousData | ( | S * | newData, | |
ptrdiff_t | length, | |||
bool | takeOwnership | |||
) |
Referenced by MatrixBase< Real >::replaceContiguousScalarData().
void replaceRep | ( | MatrixHelperRep< S > * | ) |
Referenced by MatrixView_< ELT >::operator=().
void resize | ( | int | m, | |
int | n | |||
) |
Referenced by MatrixBase< Real >::resize().
void resizeKeep | ( | int | m, | |
int | n | |||
) |
Referenced by MatrixBase< Real >::resizeKeep().
void rowSum | ( | int | i, | |
S * | eltp | |||
) | const |
void scaleBy | ( | const StdNumber & | ) |
Referenced by MatrixBase< Real >::operator*=(), and MatrixBase< Real >::operator/=().
void setRep | ( | MatrixHelperRep< S > * | hrep | ) | [inline] |
MatrixHelperRep<S>* stealRep | ( | ) | [inline] |
Referenced by MatrixBase< ELT >::block(), MatrixBase< ELT >::col(), MatrixBase< ELT >::diag(), MatrixView_< ELT >::operator=(), MatrixBase< ELT >::row(), MatrixBase< ELT >::transpose(), MatrixBase< ELT >::updBlock(), MatrixBase< ELT >::updCol(), MatrixBase< ELT >::updDiag(), MatrixBase< ELT >::updRow(), and MatrixBase< ELT >::updTranspose().
void subIn | ( | const MatrixHelper< typename CNT< S >::TNeg > & | ) |
void subIn | ( | const MatrixHelper< S > & | ) |
Referenced by MatrixBase< Real >::operator-=().
void sum | ( | S * | eltp | ) | const |
Referenced by VectorBase< Real >::sum(), and RowVectorBase< ELT >::sum().
void swapOwnedContiguousData | ( | S * | newData, | |
ptrdiff_t | length, | |||
S *& | oldData | |||
) |
Referenced by MatrixBase< Real >::swapOwnedContiguousScalarData().
void unlockShape | ( | ) |
Referenced by MatrixBase< Real >::unlockShape().
S* updContiguousData | ( | ) |
Referenced by MatrixBase< Real >::updContiguousScalarData().
S* updElt | ( | int | i | ) |
S* updElt | ( | int | i, | |
int | j | |||
) |
MatrixHelperRep<S>& updRep | ( | ) | [inline] |
MatrixHelper& writableViewAssign | ( | MatrixHelper< S > & | source | ) |
Referenced by MatrixBase< Real >::viewAssign().
friend class MatrixHelper< typename CNT< S >::THerm > [friend] |
friend class MatrixHelper< typename CNT< S >::TNeg > [friend] |