1 #ifndef SimTK_SIMMATRIX_MATRIX_H_ 2 #define SimTK_SIMMATRIX_MATRIX_H_ 51 template <
class ELT>
class Matrix_ :
public MatrixBase<ELT> {
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_(const MatrixCommitment &mc)
Definition: Matrix_.h:69
Matrix_(int m, int n, int leadingDim, S *data)
Definition: Matrix_.h:102
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 &v)
Definition: Matrix_.h:114
Matrix_ & operator/=(const StdNumber &t)
Definition: Matrix_.h:124
K::Scalar Scalar
Definition: CompositeNumericalTypes.h:160
A MatrixCharacter is a set containing a value for each of the matrix characteristics except element t...
Definition: MatrixCharacteristics.h:597
TNeg & operator-()
Definition: Matrix_.h:132
MatrixBase & operator/=(const StdNumber &t)
Definition: MatrixBase.h:291
ELT & updElt(int i, int j)
Definition: MatrixBase.h:657
Matrix_ & operator-=(const MatrixBase< EE > &m)
Definition: Matrix_.h:120
Matrix_ & operator+=(const MatrixBase< EE > &m)
Definition: Matrix_.h:118
Matrix_(int m, int n)
Definition: Matrix_.h:92
std::string toString() const
toString() returns a string representation of the Matrix_.
Definition: Matrix_.h:136
MatrixBase & operator-=(const MatrixBase &r)
Definition: MatrixBase.h:293
MatrixBase & operator*=(const StdNumber &t)
Definition: MatrixBase.h:290
Matrix_(const BaseNeg &v)
Definition: Matrix_.h:86
Matrix_ & operator=(const MatrixBase< EE > &m)
Definition: Matrix_.h:116
Matrix_ & operator*=(const StdNumber &t)
Definition: Matrix_.h:123
Matrix_(int m, int n, int leadingDim, const S *data)
Definition: Matrix_.h:99
Matrix_ & operator=(const Matrix_ &src)
Definition: Matrix_.h:76
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 Mat< M, N, ELT, CS, RS > &mat)
Convert a Mat to a Matrix_.
Definition: Matrix_.h:108
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
This is the matrix class intended to appear in user code for large, variable size matrices...
Definition: BigMatrix.h:168
Matrix_(const Base &v)
Definition: Matrix_.h:82
MatrixBase & operator+=(const MatrixBase &r)
Definition: MatrixBase.h:292
K::StdNumber StdNumber
Definition: CompositeNumericalTypes.h:163
const TNeg & operator-() const
Definition: Matrix_.h:131
Matrix_ & operator-=(const ELT &r)
Definition: Matrix_.h:126
Matrix_(int m, int n, const ELT &initialValue)
Definition: Matrix_.h:96
MatrixBase & operator=(const MatrixBase &b)
Definition: MatrixBase.h:201
K::TNeg TNeg
Definition: CompositeNumericalTypes.h:139
Matrix_ & operator+=(const ELT &r)
Definition: Matrix_.h:125
Matrix_(int m, int n, const ELT *cppInitialValuesByRow)
Definition: Matrix_.h:94
A MatrixCommitment provides a set of acceptable matrix characteristics.
Definition: MatrixCharacteristics.h:832
TNeg & updNegate()
Definition: Matrix_.h:129
This class represents a small matrix whose size is known at compile time, containing elements of any ...
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:607
This is the common base class for Simbody's Vector_ and Matrix_ classes for handling large...
Definition: BigMatrix.h:163
K::Number Number
Definition: CompositeNumericalTypes.h:162
K::THerm THerm
Definition: CompositeNumericalTypes.h:144
Matrix_(const Matrix_ &src)
Definition: Matrix_.h:72