Drake
NAryState< UnitVector > Class Template Reference

NAryState is a Drake::Vector (concept implementation) which is a container of zero or more component Drake::Vector instances. More...

#include <drake/systems/n_ary_state.h>

Collaboration diagram for NAryState< UnitVector >:

Public Types

using UnitScalar = typename std::decay< decltype(toEigen(UnitVector())(0))>::type
 
typedef Eigen::Matrix< UnitScalar, RowsAtCompileTime, 1 > EigenType
 

Public Member Functions

 NAryState ()
 
 NAryState (int count)
 
int count () const
 
void Append (const UnitVector &unit)
 Appends the. More...
 
UnitVector get (int pos) const
 
void set (int pos, const UnitVector &unit)
 Sets the value of the component UnitVector at position pos. More...
 
template<typename Derived >
 NAryState (const Eigen::MatrixBase< Derived > &initial)
 
template<typename Derived >
NAryStateoperator= (const Eigen::MatrixBase< Derived > &rhs)
 
int size () const
 

Static Public Member Functions

static int unit_size ()
 Calculates the size (Eigen row count) of UnitVector, which is presumed to be fixed for all instances of UnitVector. More...
 
static int UnitCountFromRows (int rows)
 Determines how many. More...
 
static int RowsFromUnitCount (int count)
 Determines how many Eigen matrix rows will be needed to represent. More...
 

Static Public Attributes

static const int RowsAtCompileTime = Eigen::Dynamic
 

Friends

EigenType toEigen (const NAryState< UnitVector > &vec)
 

Detailed Description

template<class UnitVector>
class drake::NAryState< UnitVector >

NAryState is a Drake::Vector (concept implementation) which is a container of zero or more component Drake::Vector instances.

All components must be of the same type, UnitVector, which naturally must model the Drake::Vector concept itself.

UnitVectors are assembled into NAryState at run-time as an ordered list with O(1) access. The Eigen::Matrix representaion of a complete NAryState is basically the concatenation of Eigen::Matrix's of the component UnitVectors.

Member Typedef Documentation

typedef Eigen::Matrix<UnitScalar, RowsAtCompileTime, 1> EigenType
using UnitScalar = typename std::decay<decltype(toEigen(UnitVector())(0))>::type

Constructor & Destructor Documentation

NAryState ( )
inline
NAryState ( int  count)
inlineexplicit
NAryState ( const Eigen::MatrixBase< Derived > &  initial)
inline

Member Function Documentation

void Append ( const UnitVector &  unit)
inline

Appends the.

Parameters
unitto the end of the list of component
UnitVectors.
int count ( ) const
inline
Returns
the count of
Parameters
UnitVectorunits contained within this NAryState object.

If UnitVector is a null vector (zero rows), then the count is indeterminate and the return value is always < 0.

Here is the caller graph for this function:

UnitVector get ( int  pos) const
inline
Returns
a copy of the component UnitVector at position pos.
Exceptions
std::out_of_rangeif UnitVector is a non-NullVector type and pos exceeds the range [0, count()].

Here is the caller graph for this function:

NAryState& operator= ( const Eigen::MatrixBase< Derived > &  rhs)
inline

Here is the call graph for this function:

static int RowsFromUnitCount ( int  count)
inlinestatic

Determines how many Eigen matrix rows will be needed to represent.

Parameters
countinstances of
UnitVector.To complement UnitCountFromRows(), if
countis negative, the return value is zero. However,
Exceptions
std::domain_errorif count is negative and UnitVector is not a null vector.

Here is the call graph for this function:

Here is the caller graph for this function:

void set ( int  pos,
const UnitVector &  unit 
)
inline

Sets the value of the component UnitVector at position pos.

Exceptions
std::out_of_rangeif UnitVector is a non-NullVector type and pos exceeds the range [0, count()].

Here is the caller graph for this function:

int size ( ) const
inline
static int unit_size ( )
inlinestatic

Calculates the size (Eigen row count) of UnitVector, which is presumed to be fixed for all instances of UnitVector.

Here is the caller graph for this function:

static int UnitCountFromRows ( int  rows)
inlinestatic

Determines how many.

Parameters
UnitVectorunits will be decoded from an Eigen column matrix with
rowsrows.
rowsmust be a multiple of the row count of
UnitVector.As a special case, if UnitVector comprises zero rows (i.e., it is a NullVector), then the return value is always -1.
Exceptions
std::domain_errorif UnitVector is not a null vector and rows is not a multiple of UnitVector::size().

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

EigenType toEigen ( const NAryState< UnitVector > &  vec)
friend

Member Data Documentation

const int RowsAtCompileTime = Eigen::Dynamic
static

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