Drake
|
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>
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 > | |
NAryState & | operator= (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) |
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.
typedef Eigen::Matrix<UnitScalar, RowsAtCompileTime, 1> EigenType |
using UnitScalar = typename std::decay<decltype(toEigen(UnitVector())(0))>::type |
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
Appends the.
unit | to the end of the list of component |
UnitVectors. |
|
inline |
UnitVector | units 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.
|
inline |
pos
.std::out_of_range | if UnitVector is a non-NullVector type and pos exceeds the range [0, count()]. |
|
inline |
|
inlinestatic |
Determines how many Eigen matrix rows will be needed to represent.
count | instances of |
UnitVector. | To complement UnitCountFromRows(), if |
count | is negative, the return value is zero. However, |
std::domain_error | if count is negative and UnitVector is not a null vector. |
|
inline |
Sets the value of the component UnitVector at position pos
.
std::out_of_range | if UnitVector is a non-NullVector type and pos exceeds the range [0, count()]. |
|
inline |
|
inlinestatic |
Calculates the size (Eigen row count) of UnitVector
, which is presumed to be fixed for all instances of UnitVector.
|
inlinestatic |
Determines how many.
UnitVector | units will be decoded from an Eigen column matrix with |
rows | rows. |
rows | must 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. |
std::domain_error | if UnitVector is not a null vector and rows is not a multiple of UnitVector::size(). |
|
static |