Simbody
Public Types | Public Member Functions | Related Functions

SimTK::UnitRow< P, S > Class Template Reference

This type is used for the transpose of UnitVec, and as the returned row type of a Rotation. More...

#include <UnitVec.h>

Inheritance diagram for SimTK::UnitRow< P, S >:

List of all members.

Public Types

typedef Row< 3, P, S > BaseRow
typedef UnitVec< P, S > TransposeType

Public Member Functions

 UnitRow ()
 UnitRow (const UnitRow &u)
 Copy constructor does not require normalization.
template<int S2>
 UnitRow (const UnitRow< P, S2 > &u)
 Implicit conversion from UnitRow with different stride; no normalization required.
UnitRowoperator= (const UnitRow &u)
 Copy assignment does not require normalization.
template<int S2>
UnitRowoperator= (const UnitRow< P, S2 > &u)
 Copy assignment from UnitRow with different stride; no computation needed.
 UnitRow (const BaseRow &v)
 Explicit conversion from Row to UnitRow, requiring expensive normalization.
template<int S2>
 UnitRow (const Row< 3, P, S2 > &v)
 Explicit conversion from Row of any stride to UnitRow, requiring expensive normalization.
 UnitRow (const RealP &x, const RealP &y, const RealP &z)
 Create a unit row from explicitly specified measure numbers (x,y,z); requires expensive normalization.
 UnitRow (int axis)
 Create a unit axis vector 100 010 001 given 0, 1, or 2.
const BaseRowasRow3 () const
 Return a const reference to the Row3 underlying this UnitRow.
UnitRow< P, 1 > negate () const
 Returns a new unit vector pointing in the opposite direction from this one; does not modify this UnitVec object.
UnitRow< P, 1 > operator- () const
 Returns a new unit vector pointing in the opposite direction from this one.
const TransposeTypeoperator~ () const
 Return a const reference to this UnitRow reinterpreted as a UnitVec; no computation requires since this is just a type cast.
TransposeTypeoperator~ ()
 Return a writable reference to this UnitRow reinterpreted as a UnitVec; no computation requires since this is just a type cast.
const RealP & operator[] (int i) const
 Return one element of this unit row as a const reference; there is no corresponding writable index function since changing a single element of a unit vector would violate the contract that it has unit length at all times.
const RealP & operator() (int i) const
 Return one element of this unit row as a const reference; there is no corresponding writable index function since changing a single element of a unit vector would violate the contract that it has unit length at all times.
UnitRow< P, 1 > abs () const
 Return a new UnitRow whose measure numbers are the absolute values of the ones here.
UnitRow< P, 1 > perp () const
 Return a new UnitRow perpendicular to this one but otherwise arbitrary.
 UnitRow (const BaseRow &v, bool)
template<int S2>
 UnitRow (const Row< 3, P, S2 > &v, bool)

Related Functions

(Note that these are not member functions.)
template<class P , int S1, int S2>
bool operator== (const UnitRow< P, S1 > &u1, const UnitRow< P, S2 > &u2)
 Compare two UnitRow3 objects for exact, bitwise equality (not very useful).
template<class P , int S1, int S2>
bool operator!= (const UnitRow< P, S1 > &u1, const UnitRow< P, S2 > &u2)
 Compare two UnitRow3 objects and return true unless they are exactly bitwise equal (not very useful).

Detailed Description

template<class P, int S>
class SimTK::UnitRow< P, S >

This type is used for the transpose of UnitVec, and as the returned row type of a Rotation.

Don't construct these directly.


Member Typedef Documentation

template<class P, int S>
typedef Row<3,P,S> SimTK::UnitRow< P, S >::BaseRow
template<class P, int S>
typedef UnitVec<P,S> SimTK::UnitRow< P, S >::TransposeType

Constructor & Destructor Documentation

template<class P, int S>
SimTK::UnitRow< P, S >::UnitRow ( ) [inline]
template<class P, int S>
SimTK::UnitRow< P, S >::UnitRow ( const UnitRow< P, S > &  u) [inline]

Copy constructor does not require normalization.

template<class P, int S>
template<int S2>
SimTK::UnitRow< P, S >::UnitRow ( const UnitRow< P, S2 > &  u) [inline]

Implicit conversion from UnitRow with different stride; no normalization required.

template<class P, int S>
SimTK::UnitRow< P, S >::UnitRow ( const BaseRow v) [inline, explicit]

Explicit conversion from Row to UnitRow, requiring expensive normalization.

template<class P, int S>
template<int S2>
SimTK::UnitRow< P, S >::UnitRow ( const Row< 3, P, S2 > &  v) [inline, explicit]

Explicit conversion from Row of any stride to UnitRow, requiring expensive normalization.

template<class P, int S>
SimTK::UnitRow< P, S >::UnitRow ( const RealP &  x,
const RealP &  y,
const RealP &  z 
) [inline]

Create a unit row from explicitly specified measure numbers (x,y,z); requires expensive normalization.

template<class P, int S>
SimTK::UnitRow< P, S >::UnitRow ( int  axis) [inline, explicit]

Create a unit axis vector 100 010 001 given 0, 1, or 2.

template<class P, int S>
SimTK::UnitRow< P, S >::UnitRow ( const BaseRow v,
bool   
) [inline]
template<class P, int S>
template<int S2>
SimTK::UnitRow< P, S >::UnitRow ( const Row< 3, P, S2 > &  v,
bool   
) [inline]

Member Function Documentation

template<class P, int S>
UnitRow& SimTK::UnitRow< P, S >::operator= ( const UnitRow< P, S > &  u) [inline]

Copy assignment does not require normalization.

template<class P, int S>
template<int S2>
UnitRow& SimTK::UnitRow< P, S >::operator= ( const UnitRow< P, S2 > &  u) [inline]

Copy assignment from UnitRow with different stride; no computation needed.

template<class P, int S>
const BaseRow& SimTK::UnitRow< P, S >::asRow3 ( ) const [inline]

Return a const reference to the Row3 underlying this UnitRow.

template<class P, int S>
UnitRow<P,1> SimTK::UnitRow< P, S >::negate ( ) const [inline]

Returns a new unit vector pointing in the opposite direction from this one; does not modify this UnitVec object.

Cost is 3 flops.

Reimplemented from SimTK::Row< 3, P, S >.

template<class P, int S>
UnitRow<P,1> SimTK::UnitRow< P, S >::operator- ( ) const [inline]

Returns a new unit vector pointing in the opposite direction from this one.

Cost is 3 flops.

Reimplemented from SimTK::Row< 3, P, S >.

template<class P, int S>
const TransposeType& SimTK::UnitRow< P, S >::operator~ ( ) const [inline]

Return a const reference to this UnitRow reinterpreted as a UnitVec; no computation requires since this is just a type cast.

Reimplemented from SimTK::Row< 3, P, S >.

template<class P, int S>
TransposeType& SimTK::UnitRow< P, S >::operator~ ( ) [inline]

Return a writable reference to this UnitRow reinterpreted as a UnitVec; no computation requires since this is just a type cast.

Reimplemented from SimTK::Row< 3, P, S >.

template<class P, int S>
const RealP& SimTK::UnitRow< P, S >::operator[] ( int  i) const [inline]

Return one element of this unit row as a const reference; there is no corresponding writable index function since changing a single element of a unit vector would violate the contract that it has unit length at all times.

Reimplemented from SimTK::Row< 3, P, S >.

template<class P, int S>
const RealP& SimTK::UnitRow< P, S >::operator() ( int  i) const [inline]

Return one element of this unit row as a const reference; there is no corresponding writable index function since changing a single element of a unit vector would violate the contract that it has unit length at all times.

Reimplemented from SimTK::Row< 3, P, S >.

template<class P, int S>
UnitRow<P,1> SimTK::UnitRow< P, S >::abs ( ) const [inline]

Return a new UnitRow whose measure numbers are the absolute values of the ones here.

This will still have unit length but will be a reflection of this unit vector into the first octant (+x,+y,+z). Note that we are returning the packed form of UnitRow regardless of our stride here.

Reimplemented from SimTK::Row< 3, P, S >.

template<class P , int S>
UnitRow< P, 1 > SimTK::UnitRow< P, S >::perp ( ) const [inline]

Return a new UnitRow perpendicular to this one but otherwise arbitrary.

Some care is taken to ensure good numerical conditioning for the result regardless of what goes in. Cost is about 50 flops.


Friends And Related Function Documentation

template<class P , int S1, int S2>
bool operator== ( const UnitRow< P, S1 > &  u1,
const UnitRow< P, S2 > &  u2 
) [related]

Compare two UnitRow3 objects for exact, bitwise equality (not very useful).

template<class P , int S1, int S2>
bool operator!= ( const UnitRow< P, S1 > &  u1,
const UnitRow< P, S2 > &  u2 
) [related]

Compare two UnitRow3 objects and return true unless they are exactly bitwise equal (not very useful).


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