Simbody
Public Member Functions

SimTK::Matrix_< ELT > Class Template Reference

This is the Matrix class intended to appear in user code. More...

#include <BigMatrix.h>

Inheritance diagram for SimTK::Matrix_< ELT >:

List of all members.

Public Member Functions

 Matrix_ ()
 Matrix_ (const MatrixCommitment &mc)
 Matrix_ (const Matrix_ &src)
Matrix_operator= (const Matrix_ &src)
 Matrix_ (const Base &v)
 Matrix_ (const BaseNeg &v)
 Matrix_ (int m, int n)
 Matrix_ (int m, int n, const ELT *cppInitialValuesByRow)
 Matrix_ (int m, int n, const ELT &initialValue)
 Matrix_ (int m, int n, int leadingDim, const S *data)
 Matrix_ (int m, int n, int leadingDim, S *data)
template<int M, int N, int CS, int RS>
 Matrix_ (const Mat< M, N, ELT, CS, RS > &mat)
 Convert a Mat to a Matrix_.
Matrix_operator= (const ELT &v)
 Matrix assignment to an element sets only the *diagonal* elements to the indicated value; everything else is set to zero.
template<class EE >
Matrix_operator= (const MatrixBase< EE > &m)
template<class EE >
Matrix_operator+= (const MatrixBase< EE > &m)
template<class EE >
Matrix_operator-= (const MatrixBase< EE > &m)
Matrix_operator*= (const StdNumber &t)
Matrix_operator/= (const StdNumber &t)
Matrix_operator+= (const ELT &r)
Matrix_operator-= (const ELT &r)
const TNegnegate () const
TNegupdNegate ()
const TNegoperator- () const
TNegoperator- ()

Related Functions

(Note that these are not member functions.)
Matrix_<T> serialization and I/O

These methods are at namespace scope but are logically part of the Vector classes.

These deal with reading and writing Vectors from and to streams, which places an additional requirement on the element type T: the element must support the same operation you are trying to do on the Vector as a whole.

template<class T >
std::ostream & operator<< (std::ostream &o, const MatrixBase< T > &m)
 Output a human readable representation of a Matrix to an std::ostream (like std::cout).

Detailed Description

template<class ELT>
class SimTK::Matrix_< ELT >

This is the Matrix class intended to appear in user code.

It can be a fixed-size view of someone else's data, or can be a resizable data owner itself.


Constructor & Destructor Documentation

template<class ELT>
SimTK::Matrix_< ELT >::Matrix_ ( ) [inline]
template<class ELT>
SimTK::Matrix_< ELT >::Matrix_ ( const MatrixCommitment mc) [inline]
template<class ELT>
SimTK::Matrix_< ELT >::Matrix_ ( const Matrix_< ELT > &  src) [inline]
template<class ELT>
SimTK::Matrix_< ELT >::Matrix_ ( const Base v) [inline]
template<class ELT>
SimTK::Matrix_< ELT >::Matrix_ ( const BaseNeg v) [inline]
template<class ELT>
SimTK::Matrix_< ELT >::Matrix_ ( int  m,
int  n 
) [inline]
template<class ELT>
SimTK::Matrix_< ELT >::Matrix_ ( int  m,
int  n,
const ELT *  cppInitialValuesByRow 
) [inline]
template<class ELT>
SimTK::Matrix_< ELT >::Matrix_ ( int  m,
int  n,
const ELT &  initialValue 
) [inline]
template<class ELT>
SimTK::Matrix_< ELT >::Matrix_ ( int  m,
int  n,
int  leadingDim,
const S *  data 
) [inline]
template<class ELT>
SimTK::Matrix_< ELT >::Matrix_ ( int  m,
int  n,
int  leadingDim,
S *  data 
) [inline]
template<class ELT>
template<int M, int N, int CS, int RS>
SimTK::Matrix_< ELT >::Matrix_ ( const Mat< M, N, ELT, CS, RS > &  mat) [inline, explicit]

Convert a Mat to a Matrix_.


Member Function Documentation

template<class ELT>
Matrix_& SimTK::Matrix_< ELT >::operator= ( const Matrix_< ELT > &  src) [inline]
template<class ELT>
Matrix_& SimTK::Matrix_< ELT >::operator= ( const ELT &  t) [inline]

Matrix assignment to an element sets only the *diagonal* elements to the indicated value; everything else is set to zero.

This is particularly useful for setting a Matrix to zero or to the identity; for other values it creates a Matrix which acts like the scalar. That is, if the scalar is s and we do M=s, then multiplying another Matrix B by the resulting diagonal matrix M gives the same result as multiplying B by s. That is (M=s)*B == s*B.

NOTE: this must be overridden for Vector and RowVector since then scalar assignment is defined to copy the scalar to every element.

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
template<class EE >
Matrix_& SimTK::Matrix_< ELT >::operator= ( const MatrixBase< EE > &  m) [inline]

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
template<class EE >
Matrix_& SimTK::Matrix_< ELT >::operator+= ( const MatrixBase< EE > &  m) [inline]

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
template<class EE >
Matrix_& SimTK::Matrix_< ELT >::operator-= ( const MatrixBase< EE > &  m) [inline]

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
Matrix_& SimTK::Matrix_< ELT >::operator*= ( const StdNumber t) [inline]

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
Matrix_& SimTK::Matrix_< ELT >::operator/= ( const StdNumber t) [inline]

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
Matrix_& SimTK::Matrix_< ELT >::operator+= ( const ELT &  r) [inline]
template<class ELT>
Matrix_& SimTK::Matrix_< ELT >::operator-= ( const ELT &  r) [inline]
template<class ELT>
const TNeg& SimTK::Matrix_< ELT >::negate ( ) const [inline]

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
TNeg& SimTK::Matrix_< ELT >::updNegate ( ) [inline]

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
const TNeg& SimTK::Matrix_< ELT >::operator- ( ) const [inline]

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
TNeg& SimTK::Matrix_< ELT >::operator- ( ) [inline]

Reimplemented from SimTK::MatrixBase< ELT >.


Friends And Related Function Documentation

template<class T >
std::ostream & operator<< ( std::ostream &  o,
const MatrixBase< T > &  m 
) [related]

Output a human readable representation of a Matrix to an std::ostream (like std::cout).

The format is one row per line, with each row output as [ elements ] where elements is a space-separated list of the row's contents output by invoking the "<<" operator on the elements. This function will not compile if the element type does not support the "<<" operator. A newline is issued before each row and at the end.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines