Simbody  3.5
SimTK::MatrixView_< ELT > Class Template Reference

(Advanced) This class is identical to Matrix_ except that it has shallow (reference) copy and assignment semantics. More...

+ Inheritance diagram for SimTK::MatrixView_< ELT >:

List of all members.

Public Member Functions

 MatrixView_ (MatrixHelperRep< S > *hrep)
 MatrixView_ (const MatrixView_ &m)
MatrixView_operator= (const MatrixView_ &m)
 MatrixView_ (const MatrixHelper< S > &h)
 MatrixView_ (MatrixHelper< S > &h)
MatrixView_operator= (const Matrix_< ELT > &v)
MatrixView_operator= (const ELT &e)
 Matrix assignment to an element sets only the *diagonal* elements to the indicated value; everything else is set to zero.
template<class EE >
MatrixView_operator= (const MatrixBase< EE > &m)
template<class EE >
MatrixView_operator+= (const MatrixBase< EE > &m)
template<class EE >
MatrixView_operator-= (const MatrixBase< EE > &m)
MatrixView_operator*= (const StdNumber &t)
MatrixView_operator/= (const StdNumber &t)
MatrixView_operator+= (const ELT &r)
MatrixView_operator-= (const ELT &r)
 operator const Matrix_< ELT > & () const
 operator Matrix_< ELT > & ()

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 E >
void writeUnformatted (std::ostream &o, const MatrixView_< E > &v)
 Raw serialization of MatrixView_<E>; same as MatrixBase<E>.
template<class E >
bool readUnformatted (std::istream &in, MatrixView_< E > &v)
 Read fixed-size MatrixView in row order from unformatted (whitespace- separated) input stream.

Detailed Description

template<class ELT>
class SimTK::MatrixView_< ELT >

(Advanced) This class is identical to Matrix_ except that it has shallow (reference) copy and assignment semantics.

Despite the name, this may be an owner if a Matrix_ is recast to a MatrixView_. However, there are no owner constructors for MatrixView_.

See also:
Matrix_, MatrixBase, VectorView_

Constructor & Destructor Documentation

template<class ELT>
SimTK::MatrixView_< ELT >::MatrixView_ ( MatrixHelperRep< S > *  hrep) [inline, explicit]
template<class ELT>
SimTK::MatrixView_< ELT >::MatrixView_ ( const MatrixView_< ELT > &  m) [inline]
template<class ELT>
SimTK::MatrixView_< ELT >::MatrixView_ ( const MatrixHelper< S > &  h) [inline]
template<class ELT>
SimTK::MatrixView_< ELT >::MatrixView_ ( MatrixHelper< S > &  h) [inline]

Member Function Documentation

template<class ELT>
MatrixView_& SimTK::MatrixView_< ELT >::operator= ( const MatrixView_< ELT > &  m) [inline]
template<class ELT>
MatrixView_& SimTK::MatrixView_< ELT >::operator= ( const Matrix_< ELT > &  v) [inline]
template<class ELT>
MatrixView_& SimTK::MatrixView_< 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 >
MatrixView_& SimTK::MatrixView_< ELT >::operator= ( const MatrixBase< EE > &  m) [inline]

Reimplemented from SimTK::MatrixBase< ELT >.

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

Reimplemented from SimTK::MatrixBase< ELT >.

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

Reimplemented from SimTK::MatrixBase< ELT >.

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

Reimplemented from SimTK::MatrixBase< ELT >.

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

Reimplemented from SimTK::MatrixBase< ELT >.

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

Friends And Related Function Documentation

template<class E >
void writeUnformatted ( std::ostream &  o,
const MatrixView_< E > &  v 
) [related]

Raw serialization of MatrixView_<E>; same as MatrixBase<E>.

template<class E >
bool readUnformatted ( std::istream &  in,
MatrixView_< E > &  v 
) [related]

Read fixed-size MatrixView in row order from unformatted (whitespace- separated) input stream.

Newlines in the input have no special meaning -- we'll read them as whitespace. It is an error if there aren't enough elements.


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