1 #ifndef SimTK_SIMMATRIX_MATRIX_H_
2 #define SimTK_SIMMATRIX_MATRIX_H_
51 template <
class ELT>
class Matrix_ :
public MatrixBase<ELT> {
52 typedef typename CNT<ELT>::Scalar S;
53 typedef typename CNT<ELT>::Number Number;
54 typedef typename CNT<ELT>::StdNumber StdNumber;
56 typedef typename CNT<ELT>::TNeg ENeg;
57 typedef typename CNT<ELT>::THerm EHerm;
59 typedef MatrixBase<ELT> Base;
60 typedef MatrixBase<ENeg> BaseNeg;
61 typedef MatrixBase<EHerm> BaseHerm;
63 typedef Matrix_<ELT> T;
64 typedef MatrixView_<ELT> TView;
65 typedef Matrix_<ENeg> TNeg;
94 Matrix_(
int m,
int n,
const ELT* cppInitialValuesByRow)
96 Matrix_(
int m,
int n,
const ELT& initialValue)
99 Matrix_(
int m,
int n,
int leadingDim,
const S* data)
102 Matrix_(
int m,
int n,
int leadingDim, S* data)
107 template <
int M,
int N,
int CS,
int RS>
110 {
for (
int i = 0; i < M; ++i)
111 for (
int j = 0; j < N; ++j)
112 this->
updElt(i, j) = mat(i, j); }
128 const TNeg&
negate()
const {
return *
reinterpret_cast<const TNeg*
>(
this); }
129 TNeg&
updNegate() {
return *
reinterpret_cast<TNeg*
>(
this); }
137 std::stringstream stream;
142 const ELT&
get(
int i,
int j)
const {
return this->
getElt(i,j); }
144 void set(
int i,
int j,
const ELT& value) { this->
updElt(i,j)=value; }
152 #endif // SimTK_SIMMATRIX_MATRIX_H_
Matrix_ & operator*=(const StdNumber &t)
Definition: Matrix_.h:123
Matrix_(const Mat< M, N, ELT, CS, RS > &mat)
Convert a Mat to a Matrix_.
Definition: Matrix_.h:108
Matrix_(int m, int n, int leadingDim, const S *data)
Definition: Matrix_.h:99
Matrix_ & operator=(const MatrixBase< EE > &m)
Definition: Matrix_.h:116
Matrix_ & operator=(const Matrix_ &src)
Definition: Matrix_.h:76
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
Matrix_ & operator-=(const ELT &r)
Definition: Matrix_.h:126
A MatrixCharacter is a set containing a value for each of the matrix characteristics except element t...
Definition: MatrixCharacteristics.h:596
std::string toString() const
toString() returns a string representation of the Matrix_.
Definition: Matrix_.h:136
Matrix_(int m, int n)
Definition: Matrix_.h:92
MatrixBase & operator=(const MatrixBase &b)
Definition: MatrixBase.h:201
TNeg & operator-()
Definition: Matrix_.h:132
Matrix_(const BaseNeg &v)
Definition: Matrix_.h:86
Matrix_ & operator+=(const MatrixBase< EE > &m)
Definition: Matrix_.h:118
MatrixBase & operator*=(const StdNumber &t)
Definition: MatrixBase.h:290
Matrix_(const Base &v)
Definition: Matrix_.h:82
This is the common base class for Simbody's Vector_ and Matrix_ classes for handling large...
Definition: BigMatrix.h:163
Matrix_(int m, int n, const ELT &initialValue)
Definition: Matrix_.h:96
Matrix_(const Matrix_ &src)
Definition: Matrix_.h:72
Matrix_ & operator-=(const MatrixBase< EE > &m)
Definition: Matrix_.h:120
ELT & updElt(int i, int j)
Definition: MatrixBase.h:657
MatrixBase & operator/=(const StdNumber &t)
Definition: MatrixBase.h:291
MatrixBase & operator+=(const MatrixBase &r)
Definition: MatrixBase.h:292
const TNeg & operator-() const
Definition: Matrix_.h:131
TNeg & updNegate()
Definition: Matrix_.h:129
Matrix_(int m, int n, int leadingDim, S *data)
Definition: Matrix_.h:102
VectorView_< ELT > updDiag()
Select main diagonal (of largest leading square if rectangular) and return it as a writable view of t...
Definition: BigMatrix.h:245
Matrix_(const MatrixCommitment &mc)
Definition: Matrix_.h:69
Matrix_(int m, int n, const ELT *cppInitialValuesByRow)
Definition: Matrix_.h:94
void set(int i, int j, const ELT &value)
Variant of indexing operator that's scripting friendly to set entry (i, j)
Definition: Matrix_.h:144
This class represents a small matrix whose size is known at compile time, containing elements of any ...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:591
const ELT & getElt(int i, int j) const
Element selection for stored elements.
Definition: MatrixBase.h:656
Matrix_()
Definition: Matrix_.h:68
const TNeg & negate() const
Definition: Matrix_.h:128
Matrix_ & operator+=(const ELT &r)
Definition: Matrix_.h:125
A MatrixCommitment provides a set of acceptable matrix characteristics.
Definition: MatrixCharacteristics.h:831
MatrixBase & operator-=(const MatrixBase &r)
Definition: MatrixBase.h:293
Matrix_ & operator=(const ELT &v)
Definition: Matrix_.h:114
Matrix_ & operator/=(const StdNumber &t)
Definition: Matrix_.h:124
This is the matrix class intended to appear in user code for large, variable size matrices...
Definition: BigMatrix.h:168