Simbody  3.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimTK::RowVectorBase< ELT > Class Template Reference

This is a dataless rehash of the MatrixBase class to specialize it for RowVectors. More...

#include <RowVectorBase.h>

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

Classes

struct  EltResult

Public Member Functions

RowVectorBaseoperator= (const RowVectorBase &b)
 Copy assignment is deep copy but behavior depends on type of lhs: if view, rhs must match.
RowVectorBaseoperator*= (const StdNumber &t)
RowVectorBaseoperator/= (const StdNumber &t)
RowVectorBaseoperator+= (const RowVectorBase &r)
RowVectorBaseoperator-= (const RowVectorBase &r)
template<class EE >
RowVectorBaseoperator= (const RowVectorBase< EE > &b)
template<class EE >
RowVectorBaseoperator+= (const RowVectorBase< EE > &b)
template<class EE >
RowVectorBaseoperator-= (const RowVectorBase< EE > &b)
RowVectorBaseoperator= (const ELT &t)
 Fill current allocation with copies of element.
template<class EE >
RowVectorBasecolScaleInPlace (const VectorBase< EE > &v)
 There's only one row here so it's a bit wierd to use colScale rather than elementwiseMultiply, but there's nothing really wrong with it.
template<class EE >
void colScale (const VectorBase< EE > &v, typename EltResult< EE >::Mul &out) const
template<class EE >
EltResult< EE >::Mul colScale (const VectorBase< EE > &v) const
template<class EE >
RowVectorBaseelementwiseMultiplyInPlace (const RowVectorBase< EE > &r)
template<class EE >
void elementwiseMultiply (const RowVectorBase< EE > &v, typename EltResult< EE >::Mul &out) const
template<class EE >
EltResult< EE >::Mul elementwiseMultiply (const RowVectorBase< EE > &v) const
template<class EE >
RowVectorBaseelementwiseMultiplyFromLeftInPlace (const RowVectorBase< EE > &r)
template<class EE >
void elementwiseMultiplyFromLeft (const RowVectorBase< EE > &v, typename RowVectorBase< EE >::template EltResult< ELT >::Mul &out) const
template<class EE >
RowVectorBase< EE >::template
EltResult< ELT >::Mul 
elementwiseMultiplyFromLeft (const RowVectorBase< EE > &v) const
template<class EE >
RowVectorBaseelementwiseDivideInPlace (const RowVectorBase< EE > &r)
template<class EE >
void elementwiseDivide (const RowVectorBase< EE > &v, typename EltResult< EE >::Dvd &out) const
template<class EE >
EltResult< EE >::Dvd elementwiseDivide (const RowVectorBase< EE > &v) const
template<class EE >
RowVectorBaseelementwiseDivideFromLeftInPlace (const RowVectorBase< EE > &r)
template<class EE >
void elementwiseDivideFromLeft (const RowVectorBase< EE > &v, typename RowVectorBase< EE >::template EltResult< ELT >::Dvd &out) const
template<class EE >
RowVectorBase< EE >::template
EltResult< ELT >::Dvd 
elementwiseDivideFromLeft (const RowVectorBase< EE > &v) const
 operator const RowVector_< ELT > & () const
 operator RowVector_< ELT > & ()
 operator const RowVectorView_< ELT > & () const
 operator RowVectorView_< ELT > & ()
 operator const Matrix_< ELT > & () const
 operator Matrix_< ELT > & ()
 operator const MatrixView_< ELT > & () const
 operator MatrixView_< ELT > & ()
int size () const
int nrow () const
 Return the number of rows m in the logical shape of this matrix.
int ncol () const
 Return the number of columns n in the logical shape of this matrix.
ptrdiff_t nelt () const
 Return the number of elements in the logical shape of this matrix.
TAbs abs () const
 abs() with the result as a function return.
const ELT & operator[] (int j) const
ELT & operator[] (int j)
const ELT & operator() (int j) const
ELT & operator() (int j)
RowVectorView_< ELT > operator() (int j, int n) const
RowVectorView_< ELT > operator() (int j, int n)
RowVectorView_< ELT > index (const Array_< int > &indices) const
RowVectorView_< ELT > updIndex (const Array_< int > &indices)
RowVectorView_< ELT > operator() (const Array_< int > &indices) const
RowVectorView_< ELT > operator() (const Array_< int > &indices)
THerm transpose () const
THerm updTranspose ()
THerm operator~ () const
THerm operator~ ()
const RowVectorBaseoperator+ () const
const TNegnegate () const
TNegupdNegate ()
const TNegoperator- () const
TNegoperator- ()
RowVectorBaseresize (int n)
RowVectorBaseresizeKeep (int n)
void clear ()
 This restores the MatrixBase to the state it would be in had it been constructed specifying only its handle commitment.
ELT sum () const
 Alternate name for colSum(); behaves like the Matlab function sum().
VectorIterator< ELT,
RowVectorBase< ELT > > 
begin ()
VectorIterator< ELT,
RowVectorBase< ELT > > 
end ()
RowVectorBase "owner" construction

These constructors create new RowVectorBase objects which own their own data and are (at least by default) resizable.

The resulting matrices are 1 x n with the number of rows locked at 1. If there is any data allocated but not explicitly initialized, that data will be uninitialized garbage in Release builds but will be initialized to NaN (at a performance cost) in Debug builds.

 RowVectorBase (int n=0)
 Default constructor makes a 1x0 matrix locked at 1 row; you can provide an initial allocation if you want.
 RowVectorBase (const RowVectorBase &source)
 Copy constructor is a deep copy (not appropriate for views!).
 RowVectorBase (const TNeg &source)
 Implicit conversion from compatible row vector with negated elements.
 RowVectorBase (int n, const ELT &initialValue)
 Construct an owner row vector of length n, with each element initialized to the given value.
 RowVectorBase (int n, const ELT *cppInitialValues)
 Construct an owner vector of length n, with the elements initialized sequentially from a C++ array of elements which is assumed to be of length n.
RowVectorBase construction from pre-existing data

Construct a non-resizeable, RowVectorBase view of externally supplied data.

Note that stride should be interpreted as "the number of scalars between elements" and for composite elements may have a different value if the source is a C++ array of elements vs. a Simmatrix packed data array. We provide constructors for both read-only and writable external data.

 RowVectorBase (int n, int stride, const Scalar *s)
 Construct a read-only view of existing data.
 RowVectorBase (int n, int stride, Scalar *s)
 Construct a writable view into existing data.
RowVectorBase construction from an existing Helper.

Create a new RowVectorBase from an existing helper.

Both shallow (view) and deep copies are possible. For shallow copies, there is a constructor providing a read-only view of the original data and one providing a writable view into the original data.

 RowVectorBase (MatrixHelper< Scalar > &h, const typename MatrixHelper< Scalar >::ShallowCopy &s)
 Construct a writable view into the source data.
 RowVectorBase (const MatrixHelper< Scalar > &h, const typename MatrixHelper< Scalar >::ShallowCopy &s)
 Construct a read-only view of the source data.
 RowVectorBase (const MatrixHelper< Scalar > &h, const typename MatrixHelper< Scalar >::DeepCopy &d)
 Construct a new owner vector initialized with the data from the source.
- Public Member Functions inherited from SimTK::MatrixBase< ELT >
const MatrixCommitmentgetCharacterCommitment () const
const MatrixCharactergetMatrixCharacter () const
void commitTo (const MatrixCommitment &mc)
 Change the handle commitment for this matrix handle; only allowed if the handle is currently clear.
bool isResizeable () const
 Return true if either dimension of this Matrix is resizable.
 MatrixBase ()
 The default constructor builds a 0x0 matrix managed by a helper that understands how many scalars there are in one of our elements but is otherwise uncommitted.
 MatrixBase (int m, int n)
 This constructor allocates the default matrix a completely uncommitted matrix commitment, given particular initial dimensions.
 MatrixBase (const MatrixCommitment &commitment)
 This constructor takes a handle commitment and allocates the default matrix for that kind of commitment.
 MatrixBase (const MatrixCommitment &commitment, int m, int n)
 This constructor takes a handle commitment and allocates the default matrix for that kind of commitment given particular initial minimum dimensions, which cannot be larger than those permitted by the commitment.
 MatrixBase (const MatrixBase &b)
 Copy constructor is a deep copy (not appropriate for views!).
 MatrixBase (const TNeg &b)
 Implicit conversion from matrix with negated elements (otherwise this is just like the copy constructor.
MatrixBasecopyAssign (const MatrixBase &b)
 Copy assignment is a deep copy but behavior depends on type of lhs: if view, rhs must match.
MatrixBaseoperator= (const MatrixBase &b)
MatrixBaseviewAssign (const MatrixBase &src)
 View assignment is a shallow copy, meaning that we disconnect the MatrixBase from whatever it used to refer to (destructing as necessary), then make it a new view for the data descriptor referenced by the source.
 MatrixBase (const MatrixCommitment &commitment, int m, int n, const ELT &initialValue)
 Initializing constructor with all of the initially-allocated elements initialized to the same value.
 MatrixBase (const MatrixCommitment &commitment, int m, int n, const ELT *cppInitialValuesByRow)
 Initializing constructor with the initially-allocated elements initialized from a C++ array of elements, which is provided in row major order.
 MatrixBase (const MatrixCommitment &commitment, MatrixHelper< Scalar > &source, const typename MatrixHelper< Scalar >::ShallowCopy &shallow)
 MatrixBase (const MatrixCommitment &commitment, const MatrixHelper< Scalar > &source, const typename MatrixHelper< Scalar >::ShallowCopy &shallow)
 MatrixBase (const MatrixCommitment &commitment, const MatrixHelper< Scalar > &source, const typename MatrixHelper< Scalar >::DeepCopy &deep)
MatrixBaseoperator+= (const MatrixBase &r)
MatrixBaseoperator-= (const MatrixBase &r)
template<class EE >
 MatrixBase (const MatrixBase< EE > &b)
template<class EE >
MatrixBaseoperator= (const MatrixBase< EE > &b)
template<class EE >
MatrixBaseoperator+= (const MatrixBase< EE > &b)
template<class EE >
MatrixBaseoperator-= (const MatrixBase< EE > &b)
template<class S >
MatrixBasescalarAssign (const S &s)
 Set M's diagonal elements to a "scalar" value S, and all off-diagonal elements to zero.
template<class S >
MatrixBasescalarAddInPlace (const S &s)
 Add a scalar to M's diagonal.
template<class S >
MatrixBasescalarSubtractInPlace (const S &s)
 Subtract a scalar from M's diagonal.
template<class S >
MatrixBasescalarSubtractFromLeftInPlace (const S &s)
 Set M(i,i) = S - M(i,i), M(i,j) = -M(i,j) for i!=j.
template<class S >
MatrixBasescalarMultiplyInPlace (const S &)
 Set M(i,j) = M(i,j)*S for some "scalar" S.
template<class S >
MatrixBasescalarMultiplyFromLeftInPlace (const S &)
 Set M(i,j) = S * M(i,j) for some "scalar" S.
template<class S >
MatrixBasescalarDivideInPlace (const S &)
 Set M(i,j) = M(i,j)/S for some "scalar" S.
template<class S >
MatrixBasescalarDivideFromLeftInPlace (const S &)
 Set M(i,j) = S/M(i,j) for some "scalar" S.
template<class EE >
MatrixBaserowScaleInPlace (const VectorBase< EE > &)
 M = diag(r) * M; r must have nrow() elements.
template<class EE >
void rowScale (const VectorBase< EE > &r, typename EltResult< EE >::Mul &out) const
 Return type is a new matrix which will have the same dimensions as 'this' but will have element types appropriate for the elementwise multiply being performed.
template<class EE >
EltResult< EE >::Mul rowScale (const VectorBase< EE > &r) const
template<class ER , class EC >
MatrixBaserowAndColScaleInPlace (const VectorBase< ER > &r, const VectorBase< EC > &c)
 M = diag(r) * M * diag(c); r must have nrow() elements; must have ncol() elements.
template<class ER , class EC >
void rowAndColScale (const VectorBase< ER > &r, const VectorBase< EC > &c, typename EltResult< typename VectorBase< ER >::template EltResult< EC >::Mul >::Mul &out) const
template<class ER , class EC >
EltResult< typename VectorBase
< ER >::template EltResult< EC >
::Mul >::Mul 
rowAndColScale (const VectorBase< ER > &r, const VectorBase< EC > &c) const
template<class S >
MatrixBaseelementwiseAssign (const S &s)
 Set M(i,j)=s for every element of M and some value s.
MatrixBaseelementwiseAssign (int s)
 Overloaded to allow an integer argument, which is converted to Real.
MatrixBaseelementwiseInvertInPlace ()
 Set M(i,j) = M(i,j)^-1.
void elementwiseInvert (MatrixBase< typename CNT< E >::TInvert > &out) const
MatrixBase< typename CNT< E >
::TInvert
elementwiseInvert () const
template<class S >
MatrixBaseelementwiseAddScalarInPlace (const S &s)
 Set M(i,j)+=s for every element of M and some value s.
template<class S >
void elementwiseAddScalar (const S &s, typename EltResult< S >::Add &) const
template<class S >
EltResult< S >::Add elementwiseAddScalar (const S &s) const
template<class S >
MatrixBaseelementwiseSubtractScalarInPlace (const S &s)
 Set M(i,j)-=s for every element of M and some value s.
template<class S >
void elementwiseSubtractScalar (const S &s, typename EltResult< S >::Sub &) const
template<class S >
EltResult< S >::Sub elementwiseSubtractScalar (const S &s) const
template<class S >
MatrixBaseelementwiseSubtractFromScalarInPlace (const S &s)
 Set M(i,j) = s - M(i,j) for every element of M and some value s.
template<class S >
void elementwiseSubtractFromScalar (const S &, typename MatrixBase< S >::template EltResult< E >::Sub &) const
template<class S >
MatrixBase< S >::template
EltResult< E >::Sub 
elementwiseSubtractFromScalar (const S &s) const
template<class EE >
MatrixBaseelementwiseMultiplyInPlace (const MatrixBase< EE > &)
 M(i,j) *= R(i,j); R must have same dimensions as this.
template<class EE >
void elementwiseMultiply (const MatrixBase< EE > &, typename EltResult< EE >::Mul &) const
template<class EE >
EltResult< EE >::Mul elementwiseMultiply (const MatrixBase< EE > &m) const
template<class EE >
MatrixBaseelementwiseMultiplyFromLeftInPlace (const MatrixBase< EE > &)
 M(i,j) = R(i,j) * M(i,j); R must have same dimensions as this.
template<class EE >
void elementwiseMultiplyFromLeft (const MatrixBase< EE > &, typename MatrixBase< EE >::template EltResult< E >::Mul &) const
template<class EE >
MatrixBase< EE >::template
EltResult< E >::Mul 
elementwiseMultiplyFromLeft (const MatrixBase< EE > &m) const
template<class EE >
MatrixBaseelementwiseDivideInPlace (const MatrixBase< EE > &)
 M(i,j) /= R(i,j); R must have same dimensions as this.
template<class EE >
void elementwiseDivide (const MatrixBase< EE > &, typename EltResult< EE >::Dvd &) const
template<class EE >
EltResult< EE >::Dvd elementwiseDivide (const MatrixBase< EE > &m) const
template<class EE >
MatrixBaseelementwiseDivideFromLeftInPlace (const MatrixBase< EE > &)
 M(i,j) = R(i,j) / M(i,j); R must have same dimensions as this.
template<class EE >
void elementwiseDivideFromLeft (const MatrixBase< EE > &, typename MatrixBase< EE >::template EltResult< E >::Dvd &) const
template<class EE >
MatrixBase< EE >::template
EltResult< EE >::Dvd 
elementwiseDivideFromLeft (const MatrixBase< EE > &m) const
MatrixBasesetTo (const ELT &t)
 Fill every element in current allocation with given element (or NaN or 0).
MatrixBasesetToNaN ()
MatrixBasesetToZero ()
RowVectorView_< ELT > row (int i) const
RowVectorView_< ELT > updRow (int i)
VectorView_< ELT > col (int j) const
VectorView_< ELT > updCol (int j)
MatrixView_< ELT > block (int i, int j, int m, int n) const
MatrixView_< ELT > updBlock (int i, int j, int m, int n)
MatrixView_< ELT > operator() (int i, int j, int m, int n) const
MatrixView_< ELT > operator() (int i, int j, int m, int n)
VectorView_< ELT > diag () const
 Select main diagonal (of largest leading square if rectangular) and return it as a read-only view of the diagonal elements of this Matrix.
VectorView_< ELT > updDiag ()
 Select main diagonal (of largest leading square if rectangular) and return it as a writable view of the diagonal elements of this Matrix.
VectorView_< ELT > diag ()
 This non-const version of diag() is an alternate name for updDiag() available for historical reasons.
TInvert invert () const
void invertInPlace ()
void dump (const char *msg=0) const
 Matlab-compatible debug output.
template<class ELT_A , class ELT_B >
MatrixBasematmul (const StdNumber &beta, const StdNumber &alpha, const MatrixBase< ELT_A > &A, const MatrixBase< ELT_B > &B)
const ELT & getElt (int i, int j) const
 Element selection for stored elements.
ELT & updElt (int i, int j)
void getAnyElt (int i, int j, ELT &value) const
 This returns a copy of the element value for any position in the logical matrix, regardless of whether it is stored in memory.
ELT getAnyElt (int i, int j) const
ScalarNormSq scalarNormSqr () const
 Scalar norm square is sum( squares of all scalars ).
void abs (TAbs &mabs) const
 abs() is elementwise absolute value; that is, the return value has the same dimension as this Matrix but with each element replaced by whatever it thinks its absolute value is.
TStandard standardize () const
 Return a Matrix of the same shape and contents as this one but with the element type converted to one based on the standard C++ scalar types: float, double, complex<float>, complex<double>.
ScalarNormSq normSqr () const
 This is the scalar Frobenius norm, and its square.
CNT< ScalarNormSq >::TSqrt norm () const
CNT< ScalarNormSq >::TSqrt normRMS () const
 We only allow RMS norm if the elements are scalars.
RowVector_< ELT > colSum () const
 Form the column sums of this matrix, returned as a RowVector.
Vector_< ELT > rowSum () const
 Form the row sums of this matrix, returned as a Vector.
MatrixBasenegateInPlace ()
MatrixBaseresize (int m, int n)
 Change the size of this matrix.
MatrixBaseresizeKeep (int m, int n)
 Change the size of this matrix, retaining as much of the old data as will fit.
void lockShape ()
void unlockShape ()
const MatrixView_< ELT > & getAsMatrixView () const
MatrixView_< ELT > & updAsMatrixView ()
const Matrix_< ELT > & getAsMatrix () const
Matrix_< ELT > & updAsMatrix ()
const VectorView_< ELT > & getAsVectorView () const
VectorView_< ELT > & updAsVectorView ()
const Vector_< ELT > & getAsVector () const
Vector_< ELT > & updAsVector ()
const VectorBase< ELT > & getAsVectorBase () const
VectorBase< ELT > & updAsVectorBase ()
const RowVectorView_< ELT > & getAsRowVectorView () const
RowVectorView_< ELT > & updAsRowVectorView ()
const RowVector_< ELT > & getAsRowVector () const
RowVector_< ELT > & updAsRowVector ()
const RowVectorBase< ELT > & getAsRowVectorBase () const
RowVectorBase< ELT > & updAsRowVectorBase ()
int getNScalarsPerElement () const
 This is the number of consecutive scalars used to represent one element of type ELT.
int getPackedSizeofElement () const
 This is like sizeof(ELT), but returning the number of bytes we use to store the element which may be fewer than what C++ would use.
bool hasContiguousData () const
ptrdiff_t getContiguousScalarDataLength () const
const ScalargetContiguousScalarData () const
ScalarupdContiguousScalarData ()
void replaceContiguousScalarData (Scalar *newData, ptrdiff_t length, bool takeOwnership)
void replaceContiguousScalarData (const Scalar *newData, ptrdiff_t length)
void swapOwnedContiguousScalarData (Scalar *newData, ptrdiff_t length, Scalar *&oldData)
 MatrixBase (MatrixHelperRep< Scalar > *hrep)
 Helper rep-stealing constructor.
template<class EE >
void rowScale (const VectorBase< EE > &v, typename MatrixBase< ELT >::template EltResult< EE >::Mul &out) const
template<class EE >
void colScale (const VectorBase< EE > &v, typename MatrixBase< ELT >::template EltResult< EE >::Mul &out) const
template<class S >
void elementwiseAddScalar (const S &s, typename MatrixBase< ELT >::template EltResult< S >::Add &out) const
template<class S >
void elementwiseSubtractScalar (const S &s, typename MatrixBase< ELT >::template EltResult< S >::Sub &out) const
template<class EE >
void elementwiseMultiply (const MatrixBase< EE > &r, typename MatrixBase< ELT >::template EltResult< EE >::Mul &out) const
template<class EE >
void elementwiseDivide (const MatrixBase< EE > &r, typename MatrixBase< ELT >::template EltResult< EE >::Dvd &out) const
 MatrixBase (const MatrixCommitment &commitment, const MatrixCharacter &character, int spacing, const Scalar *data)
 Construct a read-only view of pre-existing data.
 MatrixBase (const MatrixCommitment &commitment, const MatrixCharacter &character, int spacing, Scalar *data)
 Construct a writable view of pre-existing data.

Protected Member Functions

 RowVectorBase (MatrixHelperRep< Scalar > *hrep)
- Protected Member Functions inherited from SimTK::MatrixBase< ELT >
const MatrixHelper< Scalar > & getHelper () const
MatrixHelper< Scalar > & updHelper ()

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 RowVectorBase< E > &v)
 Specialize for RowVectorBase<E> to delegate to element type E, with spaces separating the elements; raw output is same as VectorBase.
void writeUnformatted (std::ostream &o, const MatrixBase< E > &v)

Additional Inherited Members

- Public Types inherited from SimTK::MatrixBase< ELT >
enum  {
  NScalarsPerElement = CNT<E>::NActualScalars,
  CppNScalarsPerElement = sizeof(E) / sizeof(Scalar)
}
typedef ELT E
typedef CNT< E >::TNeg ENeg
typedef CNT< E >::TWithoutNegator EWithoutNegator
typedef CNT< E >::TReal EReal
typedef CNT< E >::TImag EImag
typedef CNT< E >::TComplex EComplex
typedef CNT< E >::THerm EHerm
typedef CNT< E >::TPosTrans EPosTrans
typedef CNT< E >::TAbs EAbs
typedef CNT< E >::TStandard EStandard
typedef CNT< E >::TInvert EInvert
typedef CNT< E >::TNormalize ENormalize
typedef CNT< E >::TSqHermT ESqHermT
typedef CNT< E >::TSqTHerm ESqTHerm
typedef CNT< E >::Scalar EScalar
typedef CNT< E >::Number ENumber
typedef CNT< E >::StdNumber EStdNumber
typedef CNT< E >::Precision EPrecision
typedef CNT< E >::ScalarNormSq EScalarNormSq
typedef EScalar Scalar
typedef ENumber Number
typedef EStdNumber StdNumber
typedef EPrecision Precision
typedef EScalarNormSq ScalarNormSq
typedef MatrixBase< ET
typedef MatrixBase< ENegTNeg
typedef MatrixBase
< EWithoutNegator
TWithoutNegator
typedef MatrixBase< ERealTReal
typedef MatrixBase< EImagTImag
typedef MatrixBase< EComplexTComplex
typedef MatrixBase< EHermTHerm
typedef MatrixBase< ETPosTrans
typedef MatrixBase< EAbsTAbs
typedef MatrixBase< EStandardTStandard
typedef MatrixBase< EInvertTInvert
typedef MatrixBase< ENormalizeTNormalize
typedef MatrixBase< ESqHermTTSqHermT
typedef MatrixBase< ESqTHermTSqTHerm

Detailed Description

template<class ELT>
class SimTK::RowVectorBase< ELT >

This is a dataless rehash of the MatrixBase class to specialize it for RowVectors.

This mostly entails overriding a few of the methods. Note that all the MatrixBase operations remain available if you static_cast this up to a MatrixBase.

Constructor & Destructor Documentation

template<class ELT>
SimTK::RowVectorBase< ELT >::RowVectorBase ( int  n = 0)
inlineexplicit

Default constructor makes a 1x0 matrix locked at 1 row; you can provide an initial allocation if you want.

template<class ELT>
SimTK::RowVectorBase< ELT >::RowVectorBase ( const RowVectorBase< ELT > &  source)
inline

Copy constructor is a deep copy (not appropriate for views!).

That means it creates a new, densely packed vector whose elements are initialized from the source object.

template<class ELT>
SimTK::RowVectorBase< ELT >::RowVectorBase ( const TNeg source)
inline

Implicit conversion from compatible row vector with negated elements.

template<class ELT>
SimTK::RowVectorBase< ELT >::RowVectorBase ( int  n,
const ELT &  initialValue 
)
inline

Construct an owner row vector of length n, with each element initialized to the given value.

template<class ELT>
SimTK::RowVectorBase< ELT >::RowVectorBase ( int  n,
const ELT *  cppInitialValues 
)
inline

Construct an owner vector of length n, with the elements initialized sequentially from a C++ array of elements which is assumed to be of length n.

Note that we are expecting C++ packing; don't use this to initialize one Simmatrix vector from another because Simmatrix may pack its elements more densely than C++.

template<class ELT>
SimTK::RowVectorBase< ELT >::RowVectorBase ( int  n,
int  stride,
const Scalar s 
)
inline

Construct a read-only view of existing data.

template<class ELT>
SimTK::RowVectorBase< ELT >::RowVectorBase ( int  n,
int  stride,
Scalar s 
)
inline

Construct a writable view into existing data.

template<class ELT>
SimTK::RowVectorBase< ELT >::RowVectorBase ( MatrixHelper< Scalar > &  h,
const typename MatrixHelper< Scalar >::ShallowCopy &  s 
)
inline

Construct a writable view into the source data.

template<class ELT>
SimTK::RowVectorBase< ELT >::RowVectorBase ( const MatrixHelper< Scalar > &  h,
const typename MatrixHelper< Scalar >::ShallowCopy &  s 
)
inline

Construct a read-only view of the source data.

template<class ELT>
SimTK::RowVectorBase< ELT >::RowVectorBase ( const MatrixHelper< Scalar > &  h,
const typename MatrixHelper< Scalar >::DeepCopy &  d 
)
inline

Construct a new owner vector initialized with the data from the source.

template<class ELT>
SimTK::RowVectorBase< ELT >::RowVectorBase ( MatrixHelperRep< Scalar > *  hrep)
inlineexplicitprotected

Member Function Documentation

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

Copy assignment is deep copy but behavior depends on type of lhs: if view, rhs must match.

If owner, we reallocate and copy rhs.

template<class ELT>
RowVectorBase& SimTK::RowVectorBase< ELT >::operator*= ( const StdNumber t)
inline
template<class ELT>
RowVectorBase& SimTK::RowVectorBase< ELT >::operator/= ( const StdNumber t)
inline
template<class ELT>
RowVectorBase& SimTK::RowVectorBase< ELT >::operator+= ( const RowVectorBase< ELT > &  r)
inline
template<class ELT>
RowVectorBase& SimTK::RowVectorBase< ELT >::operator-= ( const RowVectorBase< ELT > &  r)
inline
template<class ELT>
template<class EE >
RowVectorBase& SimTK::RowVectorBase< ELT >::operator= ( const RowVectorBase< EE > &  b)
inline
template<class ELT>
template<class EE >
RowVectorBase& SimTK::RowVectorBase< ELT >::operator+= ( const RowVectorBase< EE > &  b)
inline
template<class ELT>
template<class EE >
RowVectorBase& SimTK::RowVectorBase< ELT >::operator-= ( const RowVectorBase< EE > &  b)
inline
template<class ELT>
RowVectorBase& SimTK::RowVectorBase< 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::MatrixBase< ELT >.

Reimplemented in SimTK::RowVector_< ELT >, and SimTK::RowVectorView_< ELT >.

template<class ELT>
template<class EE >
RowVectorBase& SimTK::RowVectorBase< ELT >::colScaleInPlace ( const VectorBase< EE > &  v)
inline

There's only one row here so it's a bit wierd to use colScale rather than elementwiseMultiply, but there's nothing really wrong with it.

Using rowScale would be really wacky since it is the same as a scalar multiply. We won't support rowScale here except through inheritance where it will not be much use.

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
template<class EE >
void SimTK::RowVectorBase< ELT >::colScale ( const VectorBase< EE > &  v,
typename EltResult< EE >::Mul &  out 
) const
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
template<class EE >
EltResult<EE>::Mul SimTK::RowVectorBase< ELT >::colScale ( const VectorBase< EE > &  v) const
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
template<class EE >
RowVectorBase& SimTK::RowVectorBase< ELT >::elementwiseMultiplyInPlace ( const RowVectorBase< EE > &  r)
inline
template<class ELT>
template<class EE >
void SimTK::RowVectorBase< ELT >::elementwiseMultiply ( const RowVectorBase< EE > &  v,
typename EltResult< EE >::Mul &  out 
) const
inline
template<class ELT>
template<class EE >
EltResult<EE>::Mul SimTK::RowVectorBase< ELT >::elementwiseMultiply ( const RowVectorBase< EE > &  v) const
inline
template<class ELT>
template<class EE >
RowVectorBase& SimTK::RowVectorBase< ELT >::elementwiseMultiplyFromLeftInPlace ( const RowVectorBase< EE > &  r)
inline
template<class ELT>
template<class EE >
void SimTK::RowVectorBase< ELT >::elementwiseMultiplyFromLeft ( const RowVectorBase< EE > &  v,
typename RowVectorBase< EE >::template EltResult< ELT >::Mul &  out 
) const
inline
template<class ELT>
template<class EE >
RowVectorBase<EE>::template EltResult<ELT>::Mul SimTK::RowVectorBase< ELT >::elementwiseMultiplyFromLeft ( const RowVectorBase< EE > &  v) const
inline
template<class ELT>
template<class EE >
RowVectorBase& SimTK::RowVectorBase< ELT >::elementwiseDivideInPlace ( const RowVectorBase< EE > &  r)
inline
template<class ELT>
template<class EE >
void SimTK::RowVectorBase< ELT >::elementwiseDivide ( const RowVectorBase< EE > &  v,
typename EltResult< EE >::Dvd &  out 
) const
inline
template<class ELT>
template<class EE >
EltResult<EE>::Dvd SimTK::RowVectorBase< ELT >::elementwiseDivide ( const RowVectorBase< EE > &  v) const
inline
template<class ELT>
template<class EE >
RowVectorBase& SimTK::RowVectorBase< ELT >::elementwiseDivideFromLeftInPlace ( const RowVectorBase< EE > &  r)
inline
template<class ELT>
template<class EE >
void SimTK::RowVectorBase< ELT >::elementwiseDivideFromLeft ( const RowVectorBase< EE > &  v,
typename RowVectorBase< EE >::template EltResult< ELT >::Dvd &  out 
) const
inline
template<class ELT>
template<class EE >
RowVectorBase<EE>::template EltResult<ELT>::Dvd SimTK::RowVectorBase< ELT >::elementwiseDivideFromLeft ( const RowVectorBase< EE > &  v) const
inline
template<class ELT>
SimTK::RowVectorBase< ELT >::operator const RowVector_< ELT > & ( ) const
inline
template<class ELT>
SimTK::RowVectorBase< ELT >::operator RowVector_< ELT > & ( )
inline
template<class ELT>
SimTK::RowVectorBase< ELT >::operator const RowVectorView_< ELT > & ( ) const
inline
template<class ELT>
SimTK::RowVectorBase< ELT >::operator RowVectorView_< ELT > & ( )
inline
template<class ELT>
SimTK::RowVectorBase< ELT >::operator const Matrix_< ELT > & ( ) const
inline
template<class ELT>
SimTK::RowVectorBase< ELT >::operator Matrix_< ELT > & ( )
inline
template<class ELT>
SimTK::RowVectorBase< ELT >::operator const MatrixView_< ELT > & ( ) const
inline
template<class ELT>
SimTK::RowVectorBase< ELT >::operator MatrixView_< ELT > & ( )
inline
template<class ELT>
int SimTK::RowVectorBase< ELT >::size ( ) const
inline
template<class ELT>
int SimTK::RowVectorBase< ELT >::nrow ( ) const
inline

Return the number of rows m in the logical shape of this matrix.

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
int SimTK::RowVectorBase< ELT >::ncol ( ) const
inline

Return the number of columns n in the logical shape of this matrix.

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
ptrdiff_t SimTK::RowVectorBase< ELT >::nelt ( ) const
inline

Return the number of elements in the logical shape of this matrix.

This has nothing to do with how many elements are actually stored; it is simply the product of the logical number of rows and columns, that is, nrow()*ncol(). Note that although each dimension is limited to a 32 bit size, the product of those dimensions may be > 32 bits on a 64 bit machine so the return type may be larger than that of nrow() and ncol().

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
TAbs SimTK::RowVectorBase< ELT >::abs ( ) const
inline

abs() with the result as a function return.

More convenient than the other abs() member function, but may involve an additional copy of the matrix.

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
const ELT& SimTK::RowVectorBase< ELT >::operator[] ( int  j) const
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
ELT& SimTK::RowVectorBase< ELT >::operator[] ( int  j)
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
const ELT& SimTK::RowVectorBase< ELT >::operator() ( int  j) const
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
ELT& SimTK::RowVectorBase< ELT >::operator() ( int  j)
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
RowVectorView_<ELT> SimTK::RowVectorBase< ELT >::operator() ( int  j,
int  n 
) const
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
RowVectorView_<ELT> SimTK::RowVectorBase< ELT >::operator() ( int  j,
int  n 
)
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
RowVectorView_<ELT> SimTK::RowVectorBase< ELT >::index ( const Array_< int > &  indices) const
inline
template<class ELT>
RowVectorView_<ELT> SimTK::RowVectorBase< ELT >::updIndex ( const Array_< int > &  indices)
inline
template<class ELT>
RowVectorView_<ELT> SimTK::RowVectorBase< ELT >::operator() ( const Array_< int > &  indices) const
inline
template<class ELT>
RowVectorView_<ELT> SimTK::RowVectorBase< ELT >::operator() ( const Array_< int > &  indices)
inline
template<class ELT>
THerm SimTK::RowVectorBase< ELT >::transpose ( ) const
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
THerm SimTK::RowVectorBase< ELT >::updTranspose ( )
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
THerm SimTK::RowVectorBase< ELT >::operator~ ( ) const
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
THerm SimTK::RowVectorBase< ELT >::operator~ ( )
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
const RowVectorBase& SimTK::RowVectorBase< ELT >::operator+ ( ) const
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
const TNeg& SimTK::RowVectorBase< ELT >::negate ( ) const
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
TNeg& SimTK::RowVectorBase< ELT >::updNegate ( )
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
const TNeg& SimTK::RowVectorBase< ELT >::operator- ( ) const
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
TNeg& SimTK::RowVectorBase< ELT >::operator- ( )
inline

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
RowVectorBase& SimTK::RowVectorBase< ELT >::resize ( int  n)
inline
template<class ELT>
RowVectorBase& SimTK::RowVectorBase< ELT >::resizeKeep ( int  n)
inline
template<class ELT>
void SimTK::RowVectorBase< ELT >::clear ( )
inline

This restores the MatrixBase to the state it would be in had it been constructed specifying only its handle commitment.

The size will have been reduced to the smallest size consistent with the commitment.

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
ELT SimTK::RowVectorBase< ELT >::sum ( ) const
inline

Alternate name for colSum(); behaves like the Matlab function sum().

Reimplemented from SimTK::MatrixBase< ELT >.

template<class ELT>
VectorIterator<ELT, RowVectorBase<ELT> > SimTK::RowVectorBase< ELT >::begin ( )
inline
template<class ELT>
VectorIterator<ELT, RowVectorBase<ELT> > SimTK::RowVectorBase< ELT >::end ( )
inline

Friends And Related Function Documentation

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

Specialize for RowVectorBase<E> to delegate to element type E, with spaces separating the elements; raw output is same as VectorBase.


The documentation for this class was generated from the following files: