1 #ifndef SimTK_SIMMATRIX_MATRIX_HELPER_H_
2 #define SimTK_SIMMATRIX_MATRIX_HELPER_H_
175 int n,
const int* indices);
177 int n,
const int* indices);
231 bool isClear()
const;
238 const S* getElt(
int i,
int j)
const;
239 S* updElt(
int i,
int j);
242 const S* getElt(
int i)
const;
248 void getAnyElt(
int i,
int j, S* value)
const;
251 void getAnyElt(
int i, S* value)
const;
255 void sum(S* eltp)
const;
256 void colSum(
int j, S* eltp)
const;
257 void rowSum(
int i, S* eltp)
const;
266 void fillWith(
const S* eltp);
271 void copyInByRowsFromCpp(
const S* elts);
276 void fillWithScalar(
const StdNumber&);
280 void scaleBy(
const StdNumber&);
285 void invertInPlace();
287 void dump(
const char* msg=0)
const;
290 template <
class SA,
class SB>
291 void matmul(
const StdNumber& beta,
301 ptrdiff_t nelt()
const;
312 void resize(
int m,
int n);
318 void resizeKeep(
int m,
int n);
329 bool hasContiguousData()
const;
330 ptrdiff_t getContiguousDataLength()
const;
331 const S* getContiguousData()
const;
332 S* updContiguousData();
334 void replaceContiguousData(S* newData, ptrdiff_t length,
bool takeOwnership);
335 void replaceContiguousData(
const S* newData, ptrdiff_t length);
336 void swapOwnedContiguousData(S* newData, ptrdiff_t length, S*& oldData);
344 void deleteRepIfOwner();
365 #endif // SimTK_SIMMATRIX_MATRIX_HELPER_H_
Here we define class MatrixHelper<S>, the scalar-type templatized helper class for the more general...
Definition: MatrixHelper.h:79
MatrixHelper(const MatrixCommitment &mc, const MatrixHelper &h, const Array_< int > &indices)
Definition: MatrixHelper.h:180
#define SimTK_SimTKCOMMON_EXPORT
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:202
Definition: MatrixHelper.h:48
A MatrixCharacter is a set containing a value for each of the matrix characteristics except element t...
Definition: MatrixCharacteristics.h:603
Definition: MatrixHelper.h:95
size_type size() const
Return the current number of elements stored in this array.
Definition: Array.h:2014
const T * cbegin() const
Return a const pointer to the first element of this array if any, otherwise cend(), which may be null (0) in that case but does not have to be.
Definition: Array.h:2148
ELEM sum(const VectorBase< ELEM > &v)
Definition: VectorMath.h:147
MatrixHelper(const MatrixCommitment &mc, MatrixHelper &h, const Array_< int > &indices)
Definition: MatrixHelper.h:183
K::Precision Precision
Definition: CompositeNumericalTypes.h:164
CNT< S >::Precision Precision
Definition: MatrixHelper.h:86
CNT< S >::StdNumber StdNumber
Definition: MatrixHelper.h:85
This is a user-includable header which includes everything needed to make use of SimMatrix Scalar cod...
MatrixHelperRep< S > * stealRep()
Definition: MatrixHelper.h:341
CNT< S >::Number Number
Definition: MatrixHelper.h:84
~MatrixHelper()
Definition: MatrixHelper.h:92
K::StdNumber StdNumber
Definition: CompositeNumericalTypes.h:163
MatrixHelperRep< S > & updRep()
Definition: MatrixHelper.h:339
const MatrixHelperRep< S > & getRep() const
Definition: MatrixHelper.h:338
Specialized information about Composite Numerical Types which allows us to define appropriate templat...
Definition: CompositeNumericalTypes.h:136
Definition: MatrixHelper.h:98
K::TNeg TNeg
Definition: CompositeNumericalTypes.h:139
void setRep(MatrixHelperRep< S > *hrep)
Definition: MatrixHelper.h:340
A MatrixCommitment provides a set of acceptable matrix characteristics.
Definition: MatrixCharacteristics.h:837
Definition: MatrixHelper.h:97
K::Number Number
Definition: CompositeNumericalTypes.h:162
K::THerm THerm
Definition: CompositeNumericalTypes.h:144
Definition: MatrixHelper.h:96