Simbody
Public Member Functions

SimTK::VectorView_< ELT > Class Template Reference

This class is identical to a Vector_; it is used only to manage the C++ rules for when copy constructors are called by introducing a separate type to prevent certain allowed optimizations from occuring when we don't want them. More...

#include <BigMatrix.h>

Inheritance diagram for SimTK::VectorView_< ELT >:

List of all members.

Public Member Functions

 VectorView_ (MatrixHelperRep< S > *hrep)
 VectorView_ (const VectorView_ &v)
VectorView_operator= (const VectorView_ &v)
 VectorView_ (const MatrixHelper< S > &h)
 VectorView_ (MatrixHelper< S > &h)
VectorView_operator= (const Base &b)
VectorView_operator= (const ELT &v)
 Fill current allocation with copies of element.
template<class EE >
VectorView_operator= (const VectorBase< EE > &m)
template<class EE >
VectorView_operator+= (const VectorBase< EE > &m)
template<class EE >
VectorView_operator-= (const VectorBase< EE > &m)
VectorView_operator*= (const StdNumber &t)
VectorView_operator/= (const StdNumber &t)
VectorView_operator+= (const ELT &b)
VectorView_operator-= (const ELT &b)

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 >
static std::istream & fillVectorViewFromStream (std::istream &in, VectorView_< T > &out)
 Read in a fixed number of elements from a stream into an VectorView.
template<class T >
std::istream & operator>> (std::istream &in, VectorView_< T > &out)
 Read a (fixed size n) VectorView_<T> from a stream as a sequence of space- or comma-separated values of type T, optionally delimited by parentheses or square brackets, and preceded by "~".

Detailed Description

template<class ELT>
class SimTK::VectorView_< ELT >

This class is identical to a Vector_; it is used only to manage the C++ rules for when copy constructors are called by introducing a separate type to prevent certain allowed optimizations from occuring when we don't want them.

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


Constructor & Destructor Documentation

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

Member Function Documentation

template<class ELT>
VectorView_& SimTK::VectorView_< ELT >::operator= ( const VectorView_< ELT > &  v) [inline]
template<class ELT>
VectorView_& SimTK::VectorView_< ELT >::operator= ( const Base b) [inline]
template<class ELT>
VectorView_& SimTK::VectorView_< ELT >::operator= ( const ELT &  t) [inline]

Fill current allocation with copies of element.

Note that this is not the same behavior as assignment for Matrices, where only the diagonal is set (and everything else is set to zero.)

Reimplemented from SimTK::VectorBase< ELT >.

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

Reimplemented from SimTK::VectorBase< ELT >.

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

Reimplemented from SimTK::VectorBase< ELT >.

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

Reimplemented from SimTK::VectorBase< ELT >.

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

Reimplemented from SimTK::VectorBase< ELT >.

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

Reimplemented from SimTK::VectorBase< ELT >.

template<class ELT>
VectorView_& SimTK::VectorView_< ELT >::operator+= ( const ELT &  b) [inline]
template<class ELT>
VectorView_& SimTK::VectorView_< ELT >::operator-= ( const ELT &  b) [inline]

Friends And Related Function Documentation

template<class T >
static std::istream & fillVectorViewFromStream ( std::istream &  in,
VectorView_< T > &  out 
) [related]

Read in a fixed number of elements from a stream into an VectorView.

See fillVectorFromStream() for more information; this works the same way.

See also:
fillVectorFromStream()
template<class T >
std::istream & operator>> ( std::istream &  in,
VectorView_< T > &  out 
) [related]

Read a (fixed size n) VectorView_<T> from a stream as a sequence of space- or comma-separated values of type T, optionally delimited by parentheses or square brackets, and preceded by "~".

If there are no delimiters then we will read size() values and then stop. Otherwise, there must be exactly size() values within the brackets. Each element is read in with its own operator ">>" so this won't work if no such operator is defined for type T.


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