Generic tree-like recursive structure that allows sub-structure access as well as ordered (array-like) value access. More...
#include <state.h>
Public Member Functions | |
virtual StateSPtr | cloneState () const =0 |
Clone-to-base-class-ptr function. More... | |
void | fromEIGENVec (const Eigen::VectorXd &_vec) |
Copies all values from an Eigen vector. The valueSize of the State object has to be equal with the Eigen vector size. More... | |
void | fromSTLVec (const std::vector< double > &_vec) |
Copies all values from an STL vector. The valueSize of the State object has to be equal with the STL vector size. More... | |
State & | operator= (const State &)=default |
State & | operator= (State &&)=default |
virtual void | resize (const size_t &_i) |
Resizes the array. More... | |
State (State *_parent) | |
State () | |
State (const State &)=default | |
State (State &&)=default | |
virtual StateSPtr & | state (const std::size_t &_i) |
Access sub-state based on index _i. More... | |
virtual size_t | stateSize () const |
Size of the sub-states. More... | |
void | toEIGENVec (Eigen::VectorXd &_vec) |
Converts all the array values to an Eigen vector. More... | |
void | toSTLVec (std::vector< double > &_vec) |
Converts all the array values to an STL vector. More... | |
virtual void | updateSize () |
Performs internal manipulation when any of the underlying arrays are being resized. More... | |
virtual double & | value (const std::size_t &_i)=0 |
Access state variable based on index _i. More... | |
virtual const double & | value (const std::size_t &_i) const =0 |
Const access state variable based on index _i. More... | |
virtual size_t | valueSize () const =0 |
Size of the state variables. More... | |
virtual | ~State ()=default |
Static Public Member Functions | |
static std::vector< double > & | minus (State &_lhs, State &_rhs, std::vector< double > &_ans) |
Performs substraction. Left and right operand are required to have the same valueSize. More... | |
static Eigen::VectorXd & | minus (State &_lhs, State &_rhs, Eigen::VectorXd &_ans) |
Performs substraction. Left and right operand are required to have the same valueSize. More... | |
static State & | minus (State &_lhs, State &_rhs, State &_ans) |
Performs substraction. Answer variable, left operand and right operand are required to have the same valueSize. More... | |
static std::vector< double > & | plus (State &_lhs, State &_rhs, std::vector< double > &_ans) |
Performs addition. Left and right operand are required to have the same valueSize. More... | |
static Eigen::VectorXd & | plus (State &_lhs, State &_rhs, Eigen::VectorXd &_ans) |
Performs addition. Left and right operand are required to have the same valueSize. More... | |
static State & | plus (State &_lhs, State &_rhs, State &_ans) |
Performs addition. Answer variable, left operand and right operand are required to have the same valueSize. More... | |
Protected Member Functions | |
void | callRootUpdateSize () |
Calls (if present) the parent updateSize procedure. Otherwise performs root updateSize. More... | |
Protected Attributes | |
State * | parent_ |
Pointer to the parent State structure. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const State &o) |
prints the state value to an output stream. More... | |
Generic tree-like recursive structure that allows sub-structure access as well as ordered (array-like) value access.
|
virtualdefault |
|
default |
|
default |
|
inlineprotected |
Calls (if present) the parent updateSize procedure. Otherwise performs root updateSize.
|
pure virtual |
Clone-to-base-class-ptr function.
Implemented in tuw::StateNestedArrayScoped< EnumStateVals, SubState >, tuw::StateArrayScoped< EnumStateVals >, tuw::StateArrayScoped< StateWheel >, tuw::StateNestedArray< SubState, N >, tuw::StateNestedArray< SubState, asInt(EnumStateVals::ENUM_SIZE)>, tuw::StateNestedSet< NestedStates >, tuw::StateNestedSet< NestedStates... >, tuw::StateSimTemplate< StateSize, StateNmSize >, tuw::StateArray< N >, tuw::StateArray< asInt(EnumStateVals::ENUM_SIZE)>, tuw::StateArray< StateSize-StateNmSize >, tuw::StateArray< StateSize >, tuw::StateArray< asInt(StateWheel::ENUM_SIZE)>, tuw::StateArray< StateNmSize >, tuw::StateNestedVector< SubState >, tuw::StateNestedVector< OneWheelType >, and tuw::StateVector.
|
inline |
|
inline |
|
inlinevirtual |
Resizes the array.
Reimplemented in tuw::StateNestedVector< SubState >, and tuw::StateNestedVector< OneWheelType >.
|
inlinevirtual |
Access sub-state based on index _i.
Reimplemented in tuw::StateNestedArray< SubState, N >, tuw::StateNestedArray< SubState, asInt(EnumStateVals::ENUM_SIZE)>, tuw::StateNestedSet< NestedStates >, tuw::StateNestedSet< NestedStates... >, tuw::StateNestedVector< SubState >, and tuw::StateNestedVector< OneWheelType >.
|
inlinevirtual |
Size of the sub-states.
Reimplemented in tuw::StateNestedArray< SubState, N >, tuw::StateNestedArray< SubState, asInt(EnumStateVals::ENUM_SIZE)>, tuw::StateNestedSet< NestedStates >, tuw::StateNestedSet< NestedStates... >, tuw::StateNestedVector< SubState >, and tuw::StateNestedVector< OneWheelType >.
|
inline |
|
inline |
|
inlinevirtual |
Performs internal manipulation when any of the underlying arrays are being resized.
Reimplemented in tuw::StateNestedArray< SubState, N >, tuw::StateNestedArray< SubState, asInt(EnumStateVals::ENUM_SIZE)>, tuw::StateNestedSet< NestedStates >, tuw::StateNestedSet< NestedStates... >, tuw::StateNestedVector< SubState >, and tuw::StateNestedVector< OneWheelType >.
|
pure virtual |
Access state variable based on index _i.
Implemented in tuw::StateSimTemplate< StateSize, StateNmSize >, tuw::StateNestedArray< SubState, N >, tuw::StateNestedArray< SubState, asInt(EnumStateVals::ENUM_SIZE)>, tuw::StateNestedSet< NestedStates >, tuw::StateNestedSet< NestedStates... >, tuw::StateNestedVector< SubState >, tuw::StateNestedVector< OneWheelType >, tuw::StateArray< N >, tuw::StateArray< asInt(EnumStateVals::ENUM_SIZE)>, tuw::StateArray< StateSize-StateNmSize >, tuw::StateArray< StateSize >, tuw::StateArray< asInt(StateWheel::ENUM_SIZE)>, tuw::StateArray< StateNmSize >, tuw::StateVector, and tuw::OptimizationState.
|
pure virtual |
Const access state variable based on index _i.
Implemented in tuw::StateSimTemplate< StateSize, StateNmSize >, tuw::StateNestedArray< SubState, N >, tuw::StateNestedArray< SubState, asInt(EnumStateVals::ENUM_SIZE)>, tuw::StateNestedSet< NestedStates >, tuw::StateNestedSet< NestedStates... >, tuw::StateNestedVector< SubState >, tuw::StateNestedVector< OneWheelType >, tuw::StateArray< N >, tuw::StateArray< asInt(EnumStateVals::ENUM_SIZE)>, tuw::StateArray< StateSize-StateNmSize >, tuw::StateArray< StateSize >, tuw::StateArray< asInt(StateWheel::ENUM_SIZE)>, tuw::StateArray< StateNmSize >, tuw::StateVector, and tuw::OptimizationState.
|
pure virtual |
Size of the state variables.
Implemented in tuw::StateSimTemplate< StateSize, StateNmSize >, tuw::StateNestedArray< SubState, N >, tuw::StateNestedArray< SubState, asInt(EnumStateVals::ENUM_SIZE)>, tuw::StateArray< N >, tuw::StateArray< asInt(EnumStateVals::ENUM_SIZE)>, tuw::StateArray< StateSize-StateNmSize >, tuw::StateArray< StateSize >, tuw::StateArray< asInt(StateWheel::ENUM_SIZE)>, tuw::StateArray< StateNmSize >, tuw::StateNestedSet< NestedStates >, tuw::StateNestedSet< NestedStates... >, tuw::StateVector, tuw::StateNestedVector< SubState >, tuw::StateNestedVector< OneWheelType >, and tuw::OptimizationState.
|
friend |
|
protected |