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

Represents a variable size row vector; much less common than the column vector type Vector_. More...

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

List of all members.

Public Member Functions

 RowVector_ ()
 RowVector_ (const RowVector_ &src)
 RowVector_ (const Base &src)
 RowVector_ (const BaseNeg &src)
RowVector_operator= (const RowVector_ &src)
 RowVector_ (int n)
 RowVector_ (int n, const ELT *cppInitialValues)
 RowVector_ (int n, const ELT &initialValue)
 RowVector_ (int n, const S *cppData, bool)
 Construct a Vector which uses borrowed space with assumed element-to-element stride equal to the C++ element spacing.
 RowVector_ (int n, S *cppData, bool)
 RowVector_ (int n, int stride, const S *data, bool)
 Borrowed-space construction with explicit stride supplied as "number of scalars between elements".
 RowVector_ (int n, int stride, S *data, bool)
template<int M>
 RowVector_ (const Row< M, ELT > &v)
 Convert a Row to a RowVector_.
RowVector_operator= (const ELT &v)
 Fill current allocation with copies of element.
template<class EE >
RowVector_operator= (const RowVectorBase< EE > &b)
template<class EE >
RowVector_operator+= (const RowVectorBase< EE > &b)
template<class EE >
RowVector_operator-= (const RowVectorBase< EE > &b)
RowVector_operator*= (const StdNumber &t)
RowVector_operator/= (const StdNumber &t)
RowVector_operator+= (const ELT &b)
RowVector_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 E >
void writeUnformatted (std::ostream &o, const RowVector_< E > &v)
 Raw serialization of RowVector_<E>; same as Vector_<E>.
template<class E >
bool readUnformatted (std::istream &in, RowVector_< E > &v)
 Read variable-size RowVector from unformatted (whitespace-separated) input stream.
template<class T >
std::ostream & operator<< (std::ostream &o, const RowVectorBase< T > &v)
 Output a human readable representation of a RowVector to an std::ostream (like std::cout).

Detailed Description

template<class ELT>
class SimTK::RowVector_< ELT >

Represents a variable size row vector; much less common than the column vector type Vector_.

Row vectors are much less commonly used than column vectors; they mostly arise implicitly as the type of a transposed column vector (represented by Simbody's Vector_ class). However, you want to use rows this is the 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, although of course it will always have just one row.

See also:
Row for handling of small, fixed-size row vectors with no runtime overhead
Matrix_ for variable size, two-dimensional matrix.
RowVectorView_, RowVectorBase

Constructor & Destructor Documentation

template<class ELT>
SimTK::RowVector_< ELT >::RowVector_ ( ) [inline]
template<class ELT>
SimTK::RowVector_< ELT >::RowVector_ ( const RowVector_< ELT > &  src) [inline]
template<class ELT>
SimTK::RowVector_< ELT >::RowVector_ ( const Base src) [inline]
template<class ELT>
SimTK::RowVector_< ELT >::RowVector_ ( const BaseNeg src) [inline]
template<class ELT>
SimTK::RowVector_< ELT >::RowVector_ ( int  n) [inline, explicit]
template<class ELT>
SimTK::RowVector_< ELT >::RowVector_ ( int  n,
const ELT *  cppInitialValues 
) [inline]
template<class ELT>
SimTK::RowVector_< ELT >::RowVector_ ( int  n,
const ELT &  initialValue 
) [inline]
template<class ELT>
SimTK::RowVector_< ELT >::RowVector_ ( int  n,
const S *  cppData,
bool   
) [inline]

Construct a Vector which uses borrowed space with assumed element-to-element stride equal to the C++ element spacing.

Last parameter is a dummy to avoid overload conflicts when ELT=S; pass it as "true".

template<class ELT>
SimTK::RowVector_< ELT >::RowVector_ ( int  n,
S *  cppData,
bool   
) [inline]
template<class ELT>
SimTK::RowVector_< ELT >::RowVector_ ( int  n,
int  stride,
const S *  data,
bool   
) [inline]

Borrowed-space construction with explicit stride supplied as "number of scalars between elements".

Last parameter is a dummy to avoid overload conflicts; pass it as "true".

template<class ELT>
SimTK::RowVector_< ELT >::RowVector_ ( int  n,
int  stride,
S *  data,
bool   
) [inline]
template<class ELT>
template<int M>
SimTK::RowVector_< ELT >::RowVector_ ( const Row< M, ELT > &  v) [inline, explicit]

Convert a Row to a RowVector_.


Member Function Documentation

template<class ELT>
RowVector_& SimTK::RowVector_< ELT >::operator= ( const RowVector_< ELT > &  src) [inline]
template<class ELT>
RowVector_& SimTK::RowVector_< 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::RowVectorBase< ELT >.

template<class ELT>
template<class EE >
RowVector_& SimTK::RowVector_< ELT >::operator= ( const RowVectorBase< EE > &  b) [inline]

Reimplemented from SimTK::RowVectorBase< ELT >.

template<class ELT>
template<class EE >
RowVector_& SimTK::RowVector_< ELT >::operator+= ( const RowVectorBase< EE > &  b) [inline]

Reimplemented from SimTK::RowVectorBase< ELT >.

template<class ELT>
template<class EE >
RowVector_& SimTK::RowVector_< ELT >::operator-= ( const RowVectorBase< EE > &  b) [inline]

Reimplemented from SimTK::RowVectorBase< ELT >.

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

Reimplemented from SimTK::RowVectorBase< ELT >.

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

Reimplemented from SimTK::RowVectorBase< ELT >.

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

Friends And Related Function Documentation

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

Raw serialization of RowVector_<E>; same as Vector_<E>.

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

Read variable-size RowVector from unformatted (whitespace-separated) input stream.

Reads until error or eof.

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

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

The format is [ elements ] where elements is a space-separated list of the RowVector's contents output by invoking the "<<" operator on the elements. This function will not compile if the element type does not support the "<<" operator. No newline is issued before or after the output.


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