Simbody  3.6
SimTK::Row< N, ELT, STRIDE > Class Template Reference

This is a fixed-length row vector designed for no-overhead inline computation. More...

Classes

struct  EltResult
 
struct  Result
 
struct  Substitute
 

Public Types

enum  {
  NRows = 1,
  NCols = N,
  NPackedElements = N,
  NActualElements = N * STRIDE,
  NActualScalars = CNT<E>::NActualScalars * NActualElements,
  RowSpacing = NActualElements,
  ColSpacing = STRIDE,
  ImagOffset = NTraits<ENumber>::ImagOffset,
  RealStrideFactor = 1,
  ArgDepth,
  IsScalar = 0,
  IsULessScalar = 0,
  IsNumber = 0,
  IsStdNumber = 0,
  IsPrecision = 0,
  SignInterpretation = CNT<E>::SignInterpretation
}
 
typedef Row< N, E, STRIDE > T
 
typedef Row< N, ENeg, STRIDE > TNeg
 
typedef Row< N, EWithoutNegator, STRIDE > TWithoutNegator
 
typedef Row< N, EReal, STRIDE *CNT< E >::RealStrideFactorTReal
 
typedef Row< N, EImag, STRIDE *CNT< E >::RealStrideFactorTImag
 
typedef Row< N, EComplex, STRIDE > TComplex
 
typedef Vec< N, EHerm, STRIDE > THerm
 
typedef Vec< N, E, STRIDE > TPosTrans
 
typedef E TElement
 
typedef Row TRow
 
typedef E TCol
 
typedef Vec< N, ESqrt, 1 > TSqrt
 
typedef Row< N, EAbs, 1 > TAbs
 
typedef Row< N, EStandard, 1 > TStandard
 
typedef Vec< N, EInvert, 1 > TInvert
 
typedef Row< N, ENormalize, 1 > TNormalize
 
typedef SymMat< N, ESqHermT > TSqHermT
 
typedef EScalarNormSq TSqTHerm
 
typedef EScalar Scalar
 
typedef EULessScalar ULessScalar
 
typedef ENumber Number
 
typedef EStdNumber StdNumber
 
typedef EPrecision Precision
 
typedef EScalarNormSq ScalarNormSq
 

Public Member Functions

ScalarNormSq scalarNormSqr () const
 
TSqrt sqrt () const
 
TAbs abs () const
 
TStandard standardize () const
 
EStandard sum () const
 
 Row ()
 
 Row (const Row &src)
 
Rowoperator= (const Row &src)
 
template<int SS>
 Row (const Row< N, E, SS > &src)
 
template<int SS>
 Row (const Row< N, ENeg, SS > &src)
 
template<class EE , int SS>
 Row (const Row< N, EE, SS > &vv)
 
 Row (const E &e)
 
 Row (const ENeg &ne)
 
 Row (int i)
 
 Row (const E &e0, const E &e1)
 
 Row (const E &e0, const E &e1, const E &e2)
 
 Row (const E &e0, const E &e1, const E &e2, const E &e3)
 
 Row (const E &e0, const E &e1, const E &e2, const E &e3, const E &e4)
 
 Row (const E &e0, const E &e1, const E &e2, const E &e3, const E &e4, const E &e5)
 
 Row (const E &e0, const E &e1, const E &e2, const E &e3, const E &e4, const E &e5, const E &e6)
 
 Row (const E &e0, const E &e1, const E &e2, const E &e3, const E &e4, const E &e5, const E &e6, const E &e7)
 
 Row (const E &e0, const E &e1, const E &e2, const E &e3, const E &e4, const E &e5, const E &e6, const E &e7, const E &e8)
 
template<class EE >
 Row (const EE *p)
 
template<class EE >
Rowoperator= (const EE *p)
 
template<class EE , int SS>
Rowoperator= (const Row< N, EE, SS > &vv)
 
template<class EE , int SS>
Rowoperator+= (const Row< N, EE, SS > &r)
 
template<class EE , int SS>
Rowoperator+= (const Row< N, negator< EE >, SS > &r)
 
template<class EE , int SS>
Rowoperator-= (const Row< N, EE, SS > &r)
 
template<class EE , int SS>
Rowoperator-= (const Row< N, negator< EE >, SS > &r)
 
template<class EE , int SS>
Row< N, typename CNT< E >::template Result< EE >::Add > conformingAdd (const Row< N, EE, SS > &r) const
 Vector addition – use operator+ instead. More...
 
template<class EE , int SS>
Row< N, typename CNT< E >::template Result< EE >::Sub > conformingSubtract (const Row< N, EE, SS > &r) const
 Vector subtraction – use operator- instead. More...
 
template<class EE , int SS>
CNT< E >::template Result< EE >::Mul conformingMultiply (const Vec< N, EE, SS > &r) const
 Same as dot product (s = row*col) – use operator* or dot() instead. More...
 
template<int MatNCol, class EE , int CS, int RS>
Row< MatNCol, typename CNT< E >::template Result< EE >::Mul > conformingMultiply (const Mat< N, MatNCol, EE, CS, RS > &m) const
 Row times a conforming matrix, row=row*mat – use operator* instead. More...
 
template<class EE , int SS>
Row< N, typename CNT< E >::template Result< EE >::Mul > elementwiseMultiply (const Row< N, EE, SS > &r) const
 Elementwise multiply (Matlab . More...
 
template<class EE , int SS>
Row< N, typename CNT< E >::template Result< EE >::Dvd > elementwiseDivide (const Row< N, EE, SS > &r) const
 Elementwise divide (Matlab . More...
 
const E & operator[] (int i) const
 
E & operator[] (int i)
 
const E & operator() (int i) const
 
E & operator() (int i)
 
ScalarNormSq normSqr () const
 
CNT< ScalarNormSq >::TSqrt norm () const
 
TNormalize normalize () const
 
TInvert invert () const
 
const Rowoperator+ () const
 
const TNegoperator- () const
 
TNegoperator- ()
 
const THermoperator~ () const
 
THermoperator~ ()
 
const TNegnegate () const
 
TNegupdNegate ()
 
const THermtranspose () const
 
THermupdTranspose ()
 
const TPosTranspositionalTranspose () const
 
TPosTransupdPositionalTranspose ()
 
const TRealreal () const
 
TRealreal ()
 
const TImagimag () const
 
TImagimag ()
 
const TWithoutNegatorcastAwayNegatorIfAny () const
 
TWithoutNegatorupdCastAwayNegatorIfAny ()
 
template<class EE >
Row< N, typename CNT< E >::template Result< EE >::Mul > scalarMultiply (const EE &e) const
 
template<class EE >
Row< N, typename CNT< EE >::template Result< E >::Mul > scalarMultiplyFromLeft (const EE &e) const
 
template<class EE >
Row< N, typename CNT< E >::template Result< EE >::Dvd > scalarDivide (const EE &e) const
 
template<class EE >
Row< N, typename CNT< EE >::template Result< E >::Dvd > scalarDivideFromLeft (const EE &e) const
 
template<class EE >
Row< N, typename CNT< E >::template Result< EE >::Add > scalarAdd (const EE &e) const
 
template<class EE >
Row< N, typename CNT< E >::template Result< EE >::Sub > scalarSubtract (const EE &e) const
 
template<class EE >
Row< N, typename CNT< EE >::template Result< E >::Sub > scalarSubtractFromLeft (const EE &e) const
 
template<class EE >
Rowoperator= (const EE &e)
 
template<class EE >
Rowoperator+= (const EE &e)
 
template<class EE >
Rowoperator-= (const EE &e)
 
template<class EE >
Rowoperator*= (const EE &e)
 
template<class EE >
Rowoperator/= (const EE &e)
 
template<class EE >
RowscalarEq (const EE &ee)
 
template<class EE >
RowscalarPlusEq (const EE &ee)
 
template<class EE >
RowscalarMinusEq (const EE &ee)
 
template<class EE >
RowscalarMinusEqFromLeft (const EE &ee)
 
template<class EE >
RowscalarTimesEq (const EE &ee)
 
template<class EE >
RowscalarTimesEqFromLeft (const EE &ee)
 
template<class EE >
RowscalarDivideEq (const EE &ee)
 
template<class EE >
RowscalarDivideEqFromLeft (const EE &ee)
 
RowscalarEq (int ee)
 
RowscalarPlusEq (int ee)
 
RowscalarMinusEq (int ee)
 
RowscalarTimesEq (int ee)
 
RowscalarDivideEq (int ee)
 
RowscalarMinusEqFromLeft (int ee)
 
RowscalarTimesEqFromLeft (int ee)
 
RowscalarDivideEqFromLeft (int ee)
 
void setToNaN ()
 Set every scalar in this Row to NaN; this is the default initial value in Debug builds, but not in Release. More...
 
void setToZero ()
 Set every scalar in this Row to zero. More...
 
template<int NN>
const Row< NN, ELT, STRIDE > & getSubRow (int j) const
 Extract a const reference to a sub-Row with size known at compile time. More...
 
template<int NN>
Row< NN, ELT, STRIDE > & updSubRow (int j)
 Extract a writable reference to a sub-Row with size known at compile time. More...
 
Row< N-1, ELT, 1 > drop1 (int p) const
 Return a row one smaller than this one by dropping the element at the indicated position p. More...
 
template<class EE >
Row< N+1, ELT, 1 > append1 (const EE &v) const
 Return a row one larger than this one by adding an element to the end. More...
 
template<class EE >
Row< N+1, ELT, 1 > insert1 (int p, const EE &v) const
 Return a row one larger than this one by inserting an element before the indicated one. More...
 
bool isNaN () const
 Return true if any element of this Row contains a NaN anywhere. More...
 
bool isInf () const
 Return true if any element of this Row contains a +Infinity or -Infinity somewhere but no element contains a NaN anywhere. More...
 
bool isFinite () const
 Return true if no element of this Row contains an Infinity or a NaN anywhere. More...
 
template<class E2 , int CS2>
bool isNumericallyEqual (const Row< N, E2, CS2 > &r, double tol) const
 Test whether this row is numerically equal to some other row with the same shape, using a specified tolerance. More...
 
template<class E2 , int CS2>
bool isNumericallyEqual (const Row< N, E2, CS2 > &r) const
 Test whether this row vector is numerically equal to some other row with the same shape, using a default tolerance which is the looser of the default tolerances of the two objects being compared. More...
 
bool isNumericallyEqual (const ELT &e, double tol=getDefaultTolerance()) const
 Test whether every element of this row vector is numerically equal to the given element, using either a specified tolerance or the row's default tolerance (which is always the same or looser than the default tolerance for one of its elements). More...
 

Static Public Member Functions

static int size ()
 
static int nrow ()
 
static int ncol ()
 
template<int NN>
static const RowgetSubRow (const Row< NN, ELT, STRIDE > &r, int j)
 Extract a subvector of type Row from a longer one that has the same element type and stride, and return a const reference to the selected subsequence. More...
 
template<int NN>
static RowupdSubRow (Row< NN, ELT, STRIDE > &r, int j)
 Extract a subvector of type Row from a longer one that has the same element type and stride, and return a writable reference to the selected subsequence. More...
 
static const RowgetAs (const ELT *p)
 Recast an ordinary C++ array E[] to a const Row<N,E,S>; assumes compatible length, stride, and packing. More...
 
static RowupdAs (ELT *p)
 Recast a writable ordinary C++ array E[] to a writable Row<N,E,S>; assumes compatible length, stride, and packing. More...
 
static Row< N, ELT, 1 > getNaN ()
 Return a Row of the same length and element type as this one but with all elements set to NaN. More...
 
static double getDefaultTolerance ()
 For approximate comparisons, the default tolerance to use for a vector is the same as its elements' default tolerance. More...
 

Related Functions

(Note that these are not member functions.)

template<int N, class E , int S>
void writeUnformatted (std::ostream &o, const Row< N, E, S > &v)
 Specialize for Row<N,E,S> to delegate to element type E, with spaces separating the elements; raw output is same as Vec. More...
 
template<int N, class E , int S>
bool readUnformatted (std::istream &in, Row< N, E, S > &v)
 Specialize for Row<N,E,S> to delegate to element type E, with spaces separating the elements; format is same as Vec. More...
 

Detailed Description

template<int N, class ELT, int STRIDE>
class SimTK::Row< N, ELT, STRIDE >

This is a fixed-length row vector designed for no-overhead inline computation.

The Row type is not commonly used in Simbody user programs; the column vector class Vec is much more common. Typically Row objects arise either from transposing a Vec or selecting rows from a Mat.

Template Parameters
NThe number of columns in the row vector.
ELTThe element type. Must be a composite numerical type (CNT). The default is ELT=Real.
STRIDEThe spacing from one element to the next in memory, as an integer number of elements of type ELT. The default is STRIDE=1.

Member Typedef Documentation

◆ T

template<int N, class ELT, int STRIDE>
typedef Row<N,E,STRIDE> SimTK::Row< N, ELT, STRIDE >::T

◆ TNeg

template<int N, class ELT, int STRIDE>
typedef Row<N,ENeg,STRIDE> SimTK::Row< N, ELT, STRIDE >::TNeg

◆ TWithoutNegator

template<int N, class ELT, int STRIDE>
typedef Row<N,EWithoutNegator,STRIDE> SimTK::Row< N, ELT, STRIDE >::TWithoutNegator

◆ TReal

template<int N, class ELT, int STRIDE>
typedef Row<N,EReal,STRIDE*CNT<E>::RealStrideFactor> SimTK::Row< N, ELT, STRIDE >::TReal

◆ TImag

template<int N, class ELT, int STRIDE>
typedef Row<N,EImag,STRIDE*CNT<E>::RealStrideFactor> SimTK::Row< N, ELT, STRIDE >::TImag

◆ TComplex

template<int N, class ELT, int STRIDE>
typedef Row<N,EComplex,STRIDE> SimTK::Row< N, ELT, STRIDE >::TComplex

◆ THerm

template<int N, class ELT, int STRIDE>
typedef Vec<N,EHerm,STRIDE> SimTK::Row< N, ELT, STRIDE >::THerm

◆ TPosTrans

template<int N, class ELT, int STRIDE>
typedef Vec<N,E,STRIDE> SimTK::Row< N, ELT, STRIDE >::TPosTrans

◆ TElement

template<int N, class ELT, int STRIDE>
typedef E SimTK::Row< N, ELT, STRIDE >::TElement

◆ TRow

template<int N, class ELT, int STRIDE>
typedef Row SimTK::Row< N, ELT, STRIDE >::TRow

◆ TCol

template<int N, class ELT, int STRIDE>
typedef E SimTK::Row< N, ELT, STRIDE >::TCol

◆ TSqrt

template<int N, class ELT, int STRIDE>
typedef Vec<N,ESqrt,1> SimTK::Row< N, ELT, STRIDE >::TSqrt

◆ TAbs

template<int N, class ELT, int STRIDE>
typedef Row<N,EAbs,1> SimTK::Row< N, ELT, STRIDE >::TAbs

◆ TStandard

template<int N, class ELT, int STRIDE>
typedef Row<N,EStandard,1> SimTK::Row< N, ELT, STRIDE >::TStandard

◆ TInvert

template<int N, class ELT, int STRIDE>
typedef Vec<N,EInvert,1> SimTK::Row< N, ELT, STRIDE >::TInvert

◆ TNormalize

template<int N, class ELT, int STRIDE>
typedef Row<N,ENormalize,1> SimTK::Row< N, ELT, STRIDE >::TNormalize

◆ TSqHermT

template<int N, class ELT, int STRIDE>
typedef SymMat<N,ESqHermT> SimTK::Row< N, ELT, STRIDE >::TSqHermT

◆ TSqTHerm

template<int N, class ELT, int STRIDE>
typedef EScalarNormSq SimTK::Row< N, ELT, STRIDE >::TSqTHerm

◆ Scalar

template<int N, class ELT, int STRIDE>
typedef EScalar SimTK::Row< N, ELT, STRIDE >::Scalar

◆ ULessScalar

template<int N, class ELT, int STRIDE>
typedef EULessScalar SimTK::Row< N, ELT, STRIDE >::ULessScalar

◆ Number

template<int N, class ELT, int STRIDE>
typedef ENumber SimTK::Row< N, ELT, STRIDE >::Number

◆ StdNumber

template<int N, class ELT, int STRIDE>
typedef EStdNumber SimTK::Row< N, ELT, STRIDE >::StdNumber

◆ Precision

template<int N, class ELT, int STRIDE>
typedef EPrecision SimTK::Row< N, ELT, STRIDE >::Precision

◆ ScalarNormSq

template<int N, class ELT, int STRIDE>
typedef EScalarNormSq SimTK::Row< N, ELT, STRIDE >::ScalarNormSq

Member Enumeration Documentation

◆ anonymous enum

template<int N, class ELT, int STRIDE>
anonymous enum
Enumerator
NRows 
NCols 
NPackedElements 
NActualElements 
NActualScalars 
RowSpacing 
ColSpacing 
ImagOffset 
RealStrideFactor 
ArgDepth 
IsScalar 
IsULessScalar 
IsNumber 
IsStdNumber 
IsPrecision 
SignInterpretation 

Constructor & Destructor Documentation

◆ Row() [1/17]

template<int N, class ELT, int STRIDE>
SimTK::Row< N, ELT, STRIDE >::Row ( )
inline

◆ Row() [2/17]

template<int N, class ELT, int STRIDE>
SimTK::Row< N, ELT, STRIDE >::Row ( const Row< N, ELT, STRIDE > &  src)
inline

◆ Row() [3/17]

template<int N, class ELT, int STRIDE>
template<int SS>
SimTK::Row< N, ELT, STRIDE >::Row ( const Row< N, E, SS > &  src)
inline

◆ Row() [4/17]

template<int N, class ELT, int STRIDE>
template<int SS>
SimTK::Row< N, ELT, STRIDE >::Row ( const Row< N, ENeg, SS > &  src)
inline

◆ Row() [5/17]

template<int N, class ELT, int STRIDE>
template<class EE , int SS>
SimTK::Row< N, ELT, STRIDE >::Row ( const Row< N, EE, SS > &  vv)
inlineexplicit

◆ Row() [6/17]

template<int N, class ELT, int STRIDE>
SimTK::Row< N, ELT, STRIDE >::Row ( const E &  e)
inlineexplicit

◆ Row() [7/17]

template<int N, class ELT, int STRIDE>
SimTK::Row< N, ELT, STRIDE >::Row ( const ENeg &  ne)
inlineexplicit

◆ Row() [8/17]

template<int N, class ELT, int STRIDE>
SimTK::Row< N, ELT, STRIDE >::Row ( int  i)
inlineexplicit

◆ Row() [9/17]

template<int N, class ELT, int STRIDE>
SimTK::Row< N, ELT, STRIDE >::Row ( const E &  e0,
const E &  e1 
)
inline

◆ Row() [10/17]

template<int N, class ELT, int STRIDE>
SimTK::Row< N, ELT, STRIDE >::Row ( const E &  e0,
const E &  e1,
const E &  e2 
)
inline

◆ Row() [11/17]

template<int N, class ELT, int STRIDE>
SimTK::Row< N, ELT, STRIDE >::Row ( const E &  e0,
const E &  e1,
const E &  e2,
const E &  e3 
)
inline

◆ Row() [12/17]

template<int N, class ELT, int STRIDE>
SimTK::Row< N, ELT, STRIDE >::Row ( const E &  e0,
const E &  e1,
const E &  e2,
const E &  e3,
const E &  e4 
)
inline

◆ Row() [13/17]

template<int N, class ELT, int STRIDE>
SimTK::Row< N, ELT, STRIDE >::Row ( const E &  e0,
const E &  e1,
const E &  e2,
const E &  e3,
const E &  e4,
const E &  e5 
)
inline

◆ Row() [14/17]

template<int N, class ELT, int STRIDE>
SimTK::Row< N, ELT, STRIDE >::Row ( const E &  e0,
const E &  e1,
const E &  e2,
const E &  e3,
const E &  e4,
const E &  e5,
const E &  e6 
)
inline

◆ Row() [15/17]

template<int N, class ELT, int STRIDE>
SimTK::Row< N, ELT, STRIDE >::Row ( const E &  e0,
const E &  e1,
const E &  e2,
const E &  e3,
const E &  e4,
const E &  e5,
const E &  e6,
const E &  e7 
)
inline

◆ Row() [16/17]

template<int N, class ELT, int STRIDE>
SimTK::Row< N, ELT, STRIDE >::Row ( const E &  e0,
const E &  e1,
const E &  e2,
const E &  e3,
const E &  e4,
const E &  e5,
const E &  e6,
const E &  e7,
const E &  e8 
)
inline

◆ Row() [17/17]

template<int N, class ELT, int STRIDE>
template<class EE >
SimTK::Row< N, ELT, STRIDE >::Row ( const EE *  p)
inlineexplicit

Member Function Documentation

◆ size()

template<int N, class ELT, int STRIDE>
static int SimTK::Row< N, ELT, STRIDE >::size ( )
inlinestatic

◆ nrow()

template<int N, class ELT, int STRIDE>
static int SimTK::Row< N, ELT, STRIDE >::nrow ( )
inlinestatic

◆ ncol()

template<int N, class ELT, int STRIDE>
static int SimTK::Row< N, ELT, STRIDE >::ncol ( )
inlinestatic

◆ scalarNormSqr()

template<int N, class ELT, int STRIDE>
ScalarNormSq SimTK::Row< N, ELT, STRIDE >::scalarNormSqr ( ) const
inline

◆ sqrt()

template<int N, class ELT, int STRIDE>
TSqrt SimTK::Row< N, ELT, STRIDE >::sqrt ( ) const
inline

◆ abs()

template<int N, class ELT, int STRIDE>
TAbs SimTK::Row< N, ELT, STRIDE >::abs ( ) const
inline

◆ standardize()

template<int N, class ELT, int STRIDE>
TStandard SimTK::Row< N, ELT, STRIDE >::standardize ( ) const
inline

◆ sum()

template<int N, class ELT, int STRIDE>
EStandard SimTK::Row< N, ELT, STRIDE >::sum ( ) const
inline

◆ operator=() [1/4]

template<int N, class ELT, int STRIDE>
Row& SimTK::Row< N, ELT, STRIDE >::operator= ( const Row< N, ELT, STRIDE > &  src)
inline

◆ operator=() [2/4]

template<int N, class ELT, int STRIDE>
template<class EE >
Row& SimTK::Row< N, ELT, STRIDE >::operator= ( const EE *  p)
inline

◆ operator=() [3/4]

template<int N, class ELT, int STRIDE>
template<class EE , int SS>
Row& SimTK::Row< N, ELT, STRIDE >::operator= ( const Row< N, EE, SS > &  vv)
inline

◆ operator+=() [1/3]

template<int N, class ELT, int STRIDE>
template<class EE , int SS>
Row& SimTK::Row< N, ELT, STRIDE >::operator+= ( const Row< N, EE, SS > &  r)
inline

◆ operator+=() [2/3]

template<int N, class ELT, int STRIDE>
template<class EE , int SS>
Row& SimTK::Row< N, ELT, STRIDE >::operator+= ( const Row< N, negator< EE >, SS > &  r)
inline

◆ operator-=() [1/3]

template<int N, class ELT, int STRIDE>
template<class EE , int SS>
Row& SimTK::Row< N, ELT, STRIDE >::operator-= ( const Row< N, EE, SS > &  r)
inline

◆ operator-=() [2/3]

template<int N, class ELT, int STRIDE>
template<class EE , int SS>
Row& SimTK::Row< N, ELT, STRIDE >::operator-= ( const Row< N, negator< EE >, SS > &  r)
inline

◆ conformingAdd()

template<int N, class ELT, int STRIDE>
template<class EE , int SS>
Row<N,typename CNT<E>::template Result<EE>::Add> SimTK::Row< N, ELT, STRIDE >::conformingAdd ( const Row< N, EE, SS > &  r) const
inline

Vector addition – use operator+ instead.

◆ conformingSubtract()

template<int N, class ELT, int STRIDE>
template<class EE , int SS>
Row<N,typename CNT<E>::template Result<EE>::Sub> SimTK::Row< N, ELT, STRIDE >::conformingSubtract ( const Row< N, EE, SS > &  r) const
inline

Vector subtraction – use operator- instead.

◆ conformingMultiply() [1/2]

template<int N, class ELT, int STRIDE>
template<class EE , int SS>
CNT<E>::template Result<EE>::Mul SimTK::Row< N, ELT, STRIDE >::conformingMultiply ( const Vec< N, EE, SS > &  r) const
inline

Same as dot product (s = row*col) – use operator* or dot() instead.

◆ conformingMultiply() [2/2]

template<int N, class ELT, int STRIDE>
template<int MatNCol, class EE , int CS, int RS>
Row<MatNCol,typename CNT<E>::template Result<EE>::Mul> SimTK::Row< N, ELT, STRIDE >::conformingMultiply ( const Mat< N, MatNCol, EE, CS, RS > &  m) const
inline

Row times a conforming matrix, row=row*mat – use operator* instead.

◆ elementwiseMultiply()

template<int N, class ELT, int STRIDE>
template<class EE , int SS>
Row<N,typename CNT<E>::template Result<EE>::Mul> SimTK::Row< N, ELT, STRIDE >::elementwiseMultiply ( const Row< N, EE, SS > &  r) const
inline

Elementwise multiply (Matlab .

  • operator).

◆ elementwiseDivide()

template<int N, class ELT, int STRIDE>
template<class EE , int SS>
Row<N,typename CNT<E>::template Result<EE>::Dvd> SimTK::Row< N, ELT, STRIDE >::elementwiseDivide ( const Row< N, EE, SS > &  r) const
inline

Elementwise divide (Matlab .

/ operator).

◆ operator[]() [1/2]

template<int N, class ELT, int STRIDE>
const E& SimTK::Row< N, ELT, STRIDE >::operator[] ( int  i) const
inline

◆ operator[]() [2/2]

template<int N, class ELT, int STRIDE>
E& SimTK::Row< N, ELT, STRIDE >::operator[] ( int  i)
inline

◆ operator()() [1/2]

template<int N, class ELT, int STRIDE>
const E& SimTK::Row< N, ELT, STRIDE >::operator() ( int  i) const
inline

◆ operator()() [2/2]

template<int N, class ELT, int STRIDE>
E& SimTK::Row< N, ELT, STRIDE >::operator() ( int  i)
inline

◆ normSqr()

template<int N, class ELT, int STRIDE>
ScalarNormSq SimTK::Row< N, ELT, STRIDE >::normSqr ( ) const
inline

◆ norm()

template<int N, class ELT, int STRIDE>
CNT<ScalarNormSq>::TSqrt SimTK::Row< N, ELT, STRIDE >::norm ( ) const
inline

◆ normalize()

template<int N, class ELT, int STRIDE>
TNormalize SimTK::Row< N, ELT, STRIDE >::normalize ( ) const
inline

◆ invert()

template<int N, class ELT, int STRIDE>
TInvert SimTK::Row< N, ELT, STRIDE >::invert ( ) const
inline

◆ operator+()

template<int N, class ELT, int STRIDE>
const Row& SimTK::Row< N, ELT, STRIDE >::operator+ ( ) const
inline

◆ operator-() [1/2]

template<int N, class ELT, int STRIDE>
const TNeg& SimTK::Row< N, ELT, STRIDE >::operator- ( ) const
inline

◆ operator-() [2/2]

template<int N, class ELT, int STRIDE>
TNeg& SimTK::Row< N, ELT, STRIDE >::operator- ( )
inline

◆ operator~() [1/2]

template<int N, class ELT, int STRIDE>
const THerm& SimTK::Row< N, ELT, STRIDE >::operator~ ( ) const
inline

◆ operator~() [2/2]

template<int N, class ELT, int STRIDE>
THerm& SimTK::Row< N, ELT, STRIDE >::operator~ ( )
inline

◆ negate()

template<int N, class ELT, int STRIDE>
const TNeg& SimTK::Row< N, ELT, STRIDE >::negate ( ) const
inline

◆ updNegate()

template<int N, class ELT, int STRIDE>
TNeg& SimTK::Row< N, ELT, STRIDE >::updNegate ( )
inline

◆ transpose()

template<int N, class ELT, int STRIDE>
const THerm& SimTK::Row< N, ELT, STRIDE >::transpose ( ) const
inline

◆ updTranspose()

template<int N, class ELT, int STRIDE>
THerm& SimTK::Row< N, ELT, STRIDE >::updTranspose ( )
inline

◆ positionalTranspose()

template<int N, class ELT, int STRIDE>
const TPosTrans& SimTK::Row< N, ELT, STRIDE >::positionalTranspose ( ) const
inline

◆ updPositionalTranspose()

template<int N, class ELT, int STRIDE>
TPosTrans& SimTK::Row< N, ELT, STRIDE >::updPositionalTranspose ( )
inline

◆ real() [1/2]

template<int N, class ELT, int STRIDE>
const TReal& SimTK::Row< N, ELT, STRIDE >::real ( ) const
inline

◆ real() [2/2]

template<int N, class ELT, int STRIDE>
TReal& SimTK::Row< N, ELT, STRIDE >::real ( )
inline

◆ imag() [1/2]

template<int N, class ELT, int STRIDE>
const TImag& SimTK::Row< N, ELT, STRIDE >::imag ( ) const
inline

◆ imag() [2/2]

template<int N, class ELT, int STRIDE>
TImag& SimTK::Row< N, ELT, STRIDE >::imag ( )
inline

◆ castAwayNegatorIfAny()

template<int N, class ELT, int STRIDE>
const TWithoutNegator& SimTK::Row< N, ELT, STRIDE >::castAwayNegatorIfAny ( ) const
inline

◆ updCastAwayNegatorIfAny()

template<int N, class ELT, int STRIDE>
TWithoutNegator& SimTK::Row< N, ELT, STRIDE >::updCastAwayNegatorIfAny ( )
inline

◆ scalarMultiply()

template<int N, class ELT, int STRIDE>
template<class EE >
Row<N, typename CNT<E>::template Result<EE>::Mul> SimTK::Row< N, ELT, STRIDE >::scalarMultiply ( const EE &  e) const
inline

◆ scalarMultiplyFromLeft()

template<int N, class ELT, int STRIDE>
template<class EE >
Row<N, typename CNT<EE>::template Result<E>::Mul> SimTK::Row< N, ELT, STRIDE >::scalarMultiplyFromLeft ( const EE &  e) const
inline

◆ scalarDivide()

template<int N, class ELT, int STRIDE>
template<class EE >
Row<N, typename CNT<E>::template Result<EE>::Dvd> SimTK::Row< N, ELT, STRIDE >::scalarDivide ( const EE &  e) const
inline

◆ scalarDivideFromLeft()

template<int N, class ELT, int STRIDE>
template<class EE >
Row<N, typename CNT<EE>::template Result<E>::Dvd> SimTK::Row< N, ELT, STRIDE >::scalarDivideFromLeft ( const EE &  e) const
inline

◆ scalarAdd()

template<int N, class ELT, int STRIDE>
template<class EE >
Row<N, typename CNT<E>::template Result<EE>::Add> SimTK::Row< N, ELT, STRIDE >::scalarAdd ( const EE &  e) const
inline

◆ scalarSubtract()

template<int N, class ELT, int STRIDE>
template<class EE >
Row<N, typename CNT<E>::template Result<EE>::Sub> SimTK::Row< N, ELT, STRIDE >::scalarSubtract ( const EE &  e) const
inline

◆ scalarSubtractFromLeft()

template<int N, class ELT, int STRIDE>
template<class EE >
Row<N, typename CNT<EE>::template Result<E>::Sub> SimTK::Row< N, ELT, STRIDE >::scalarSubtractFromLeft ( const EE &  e) const
inline

◆ operator=() [4/4]

template<int N, class ELT, int STRIDE>
template<class EE >
Row& SimTK::Row< N, ELT, STRIDE >::operator= ( const EE &  e)
inline

◆ operator+=() [3/3]

template<int N, class ELT, int STRIDE>
template<class EE >
Row& SimTK::Row< N, ELT, STRIDE >::operator+= ( const EE &  e)
inline

◆ operator-=() [3/3]

template<int N, class ELT, int STRIDE>
template<class EE >
Row& SimTK::Row< N, ELT, STRIDE >::operator-= ( const EE &  e)
inline

◆ operator*=()

template<int N, class ELT, int STRIDE>
template<class EE >
Row& SimTK::Row< N, ELT, STRIDE >::operator*= ( const EE &  e)
inline

◆ operator/=()

template<int N, class ELT, int STRIDE>
template<class EE >
Row& SimTK::Row< N, ELT, STRIDE >::operator/= ( const EE &  e)
inline

◆ scalarEq() [1/2]

template<int N, class ELT, int STRIDE>
template<class EE >
Row& SimTK::Row< N, ELT, STRIDE >::scalarEq ( const EE &  ee)
inline

◆ scalarPlusEq() [1/2]

template<int N, class ELT, int STRIDE>
template<class EE >
Row& SimTK::Row< N, ELT, STRIDE >::scalarPlusEq ( const EE &  ee)
inline

◆ scalarMinusEq() [1/2]

template<int N, class ELT, int STRIDE>
template<class EE >
Row& SimTK::Row< N, ELT, STRIDE >::scalarMinusEq ( const EE &  ee)
inline

◆ scalarMinusEqFromLeft() [1/2]

template<int N, class ELT, int STRIDE>
template<class EE >
Row& SimTK::Row< N, ELT, STRIDE >::scalarMinusEqFromLeft ( const EE &  ee)
inline

◆ scalarTimesEq() [1/2]

template<int N, class ELT, int STRIDE>
template<class EE >
Row& SimTK::Row< N, ELT, STRIDE >::scalarTimesEq ( const EE &  ee)
inline

◆ scalarTimesEqFromLeft() [1/2]

template<int N, class ELT, int STRIDE>
template<class EE >
Row& SimTK::Row< N, ELT, STRIDE >::scalarTimesEqFromLeft ( const EE &  ee)
inline

◆ scalarDivideEq() [1/2]

template<int N, class ELT, int STRIDE>
template<class EE >
Row& SimTK::Row< N, ELT, STRIDE >::scalarDivideEq ( const EE &  ee)
inline

◆ scalarDivideEqFromLeft() [1/2]

template<int N, class ELT, int STRIDE>
template<class EE >
Row& SimTK::Row< N, ELT, STRIDE >::scalarDivideEqFromLeft ( const EE &  ee)
inline

◆ scalarEq() [2/2]

template<int N, class ELT, int STRIDE>
Row& SimTK::Row< N, ELT, STRIDE >::scalarEq ( int  ee)
inline

◆ scalarPlusEq() [2/2]

template<int N, class ELT, int STRIDE>
Row& SimTK::Row< N, ELT, STRIDE >::scalarPlusEq ( int  ee)
inline

◆ scalarMinusEq() [2/2]

template<int N, class ELT, int STRIDE>
Row& SimTK::Row< N, ELT, STRIDE >::scalarMinusEq ( int  ee)
inline

◆ scalarTimesEq() [2/2]

template<int N, class ELT, int STRIDE>
Row& SimTK::Row< N, ELT, STRIDE >::scalarTimesEq ( int  ee)
inline

◆ scalarDivideEq() [2/2]

template<int N, class ELT, int STRIDE>
Row& SimTK::Row< N, ELT, STRIDE >::scalarDivideEq ( int  ee)
inline

◆ scalarMinusEqFromLeft() [2/2]

template<int N, class ELT, int STRIDE>
Row& SimTK::Row< N, ELT, STRIDE >::scalarMinusEqFromLeft ( int  ee)
inline

◆ scalarTimesEqFromLeft() [2/2]

template<int N, class ELT, int STRIDE>
Row& SimTK::Row< N, ELT, STRIDE >::scalarTimesEqFromLeft ( int  ee)
inline

◆ scalarDivideEqFromLeft() [2/2]

template<int N, class ELT, int STRIDE>
Row& SimTK::Row< N, ELT, STRIDE >::scalarDivideEqFromLeft ( int  ee)
inline

◆ setToNaN()

template<int N, class ELT, int STRIDE>
void SimTK::Row< N, ELT, STRIDE >::setToNaN ( )
inline

Set every scalar in this Row to NaN; this is the default initial value in Debug builds, but not in Release.

◆ setToZero()

template<int N, class ELT, int STRIDE>
void SimTK::Row< N, ELT, STRIDE >::setToZero ( )
inline

Set every scalar in this Row to zero.

◆ getSubRow() [1/2]

template<int N, class ELT, int STRIDE>
template<int NN>
const Row<NN,ELT,STRIDE>& SimTK::Row< N, ELT, STRIDE >::getSubRow ( int  j) const
inline

Extract a const reference to a sub-Row with size known at compile time.

This must be called with an explicit template argument for the size, for example, getSubRow<3>(j). This is only a recast; no copying or computation is performed. The size and index are range checked in Debug builds but not in Release builds.

◆ updSubRow() [1/2]

template<int N, class ELT, int STRIDE>
template<int NN>
Row<NN,ELT,STRIDE>& SimTK::Row< N, ELT, STRIDE >::updSubRow ( int  j)
inline

Extract a writable reference to a sub-Row with size known at compile time.

This must be called with an explicit template argument for the size, for example, updSubRow<3>(j). This is only a recast; no copying or computation is performed. The size and index are range checked in Debug builds but not in Release builds.

◆ getSubRow() [2/2]

template<int N, class ELT, int STRIDE>
template<int NN>
static const Row& SimTK::Row< N, ELT, STRIDE >::getSubRow ( const Row< NN, ELT, STRIDE > &  r,
int  j 
)
inlinestatic

Extract a subvector of type Row from a longer one that has the same element type and stride, and return a const reference to the selected subsequence.

◆ updSubRow() [2/2]

template<int N, class ELT, int STRIDE>
template<int NN>
static Row& SimTK::Row< N, ELT, STRIDE >::updSubRow ( Row< NN, ELT, STRIDE > &  r,
int  j 
)
inlinestatic

Extract a subvector of type Row from a longer one that has the same element type and stride, and return a writable reference to the selected subsequence.

◆ drop1()

template<int N, class ELT, int STRIDE>
Row<N-1,ELT,1> SimTK::Row< N, ELT, STRIDE >::drop1 ( int  p) const
inline

Return a row one smaller than this one by dropping the element at the indicated position p.

The result is a packed copy with the same element type as this one.

◆ append1()

template<int N, class ELT, int STRIDE>
template<class EE >
Row<N+1,ELT,1> SimTK::Row< N, ELT, STRIDE >::append1 ( const EE &  v) const
inline

Return a row one larger than this one by adding an element to the end.

The result is a packed copy with the same element type as this one. Works for any assignment compatible element.

◆ insert1()

template<int N, class ELT, int STRIDE>
template<class EE >
Row<N+1,ELT,1> SimTK::Row< N, ELT, STRIDE >::insert1 ( int  p,
const EE &  v 
) const
inline

Return a row one larger than this one by inserting an element before the indicated one.

The result is a packed copy with the same element type as this one. Works for any assignment compatible element. The index can be one greater than normally allowed in which case the element is appended (but use append1() if you know you're appending).

◆ getAs()

template<int N, class ELT, int STRIDE>
static const Row& SimTK::Row< N, ELT, STRIDE >::getAs ( const ELT *  p)
inlinestatic

Recast an ordinary C++ array E[] to a const Row<N,E,S>; assumes compatible length, stride, and packing.

◆ updAs()

template<int N, class ELT, int STRIDE>
static Row& SimTK::Row< N, ELT, STRIDE >::updAs ( ELT *  p)
inlinestatic

Recast a writable ordinary C++ array E[] to a writable Row<N,E,S>; assumes compatible length, stride, and packing.

◆ getNaN()

template<int N, class ELT, int STRIDE>
static Row<N,ELT,1> SimTK::Row< N, ELT, STRIDE >::getNaN ( )
inlinestatic

Return a Row of the same length and element type as this one but with all elements set to NaN.

The result is packed (stride==1) regardless of the stride of this Row.

◆ isNaN()

template<int N, class ELT, int STRIDE>
bool SimTK::Row< N, ELT, STRIDE >::isNaN ( ) const
inline

Return true if any element of this Row contains a NaN anywhere.

◆ isInf()

template<int N, class ELT, int STRIDE>
bool SimTK::Row< N, ELT, STRIDE >::isInf ( ) const
inline

Return true if any element of this Row contains a +Infinity or -Infinity somewhere but no element contains a NaN anywhere.

◆ isFinite()

template<int N, class ELT, int STRIDE>
bool SimTK::Row< N, ELT, STRIDE >::isFinite ( ) const
inline

Return true if no element of this Row contains an Infinity or a NaN anywhere.

◆ getDefaultTolerance()

template<int N, class ELT, int STRIDE>
static double SimTK::Row< N, ELT, STRIDE >::getDefaultTolerance ( )
inlinestatic

For approximate comparisons, the default tolerance to use for a vector is the same as its elements' default tolerance.

◆ isNumericallyEqual() [1/3]

template<int N, class ELT, int STRIDE>
template<class E2 , int CS2>
bool SimTK::Row< N, ELT, STRIDE >::isNumericallyEqual ( const Row< N, E2, CS2 > &  r,
double  tol 
) const
inline

Test whether this row is numerically equal to some other row with the same shape, using a specified tolerance.

◆ isNumericallyEqual() [2/3]

template<int N, class ELT, int STRIDE>
template<class E2 , int CS2>
bool SimTK::Row< N, ELT, STRIDE >::isNumericallyEqual ( const Row< N, E2, CS2 > &  r) const
inline

Test whether this row vector is numerically equal to some other row with the same shape, using a default tolerance which is the looser of the default tolerances of the two objects being compared.

◆ isNumericallyEqual() [3/3]

template<int N, class ELT, int STRIDE>
bool SimTK::Row< N, ELT, STRIDE >::isNumericallyEqual ( const ELT &  e,
double  tol = getDefaultTolerance() 
) const
inline

Test whether every element of this row vector is numerically equal to the given element, using either a specified tolerance or the row's default tolerance (which is always the same or looser than the default tolerance for one of its elements).


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