Drake
BasicVector< T > Class Template Reference

BasicVector is a semantics-free wrapper around an Eigen vector that satisfies VectorInterface. More...

#include <drake/systems/framework/basic_vector.h>

Inheritance diagram for BasicVector< T >:
Collaboration diagram for BasicVector< T >:

Public Member Functions

 BasicVector (int size)
 
void set_value (const Eigen::Ref< const VectorX< T >> &value) override
 Sets the vector to the given value. More...
 
int size () const override
 Returns the size of the vector, which must be equal to the number of rows in get_value(). More...
 
Eigen::VectorBlock< const VectorX< T > > get_value () const override
 Returns a column vector containing the entire value of the signal. More...
 
Eigen::VectorBlock< VectorX< T > > get_mutable_value () override
 Returns a reference that allows mutation of the values in this vector, but does not allow resizing the vector itself. More...
 
std::unique_ptr< VectorInterface< T > > Clone () const final
 Copies the entire state to a new BasicVector. More...
 
- Public Member Functions inherited from VectorInterface< T >
virtual ~VectorInterface ()
 

Additional Inherited Members

- Protected Member Functions inherited from VectorInterface< T >
 VectorInterface ()
 

Detailed Description

template<typename T>
class drake::systems::BasicVector< T >

BasicVector is a semantics-free wrapper around an Eigen vector that satisfies VectorInterface.

Once constructed, its size is fixed. The BasicVector is initialized to the quiet_NaN of the Eigen scalar. If numeric_limits is not specialized on the Eigen scalar, the BasicVector will be initialized with the scalar's default constructor.

Template Parameters
TThe vector element type, which must be a valid Eigen scalar.

Constructor & Destructor Documentation

BasicVector ( int  size)
inlineexplicit

Here is the caller graph for this function:

Member Function Documentation

std::unique_ptr<VectorInterface<T> > Clone ( ) const
inlinefinalvirtual

Copies the entire state to a new BasicVector.

Uses the Non-Virtual Interface idiom because smart pointers do not have type covariance.

Implements VectorInterface< T >.

Here is the call graph for this function:

Eigen::VectorBlock<VectorX<T> > get_mutable_value ( )
inlineoverridevirtual

Returns a reference that allows mutation of the values in this vector, but does not allow resizing the vector itself.

Implements VectorInterface< T >.

Eigen::VectorBlock<const VectorX<T> > get_value ( ) const
inlineoverridevirtual

Returns a column vector containing the entire value of the signal.

Implements VectorInterface< T >.

void set_value ( const Eigen::Ref< const VectorX< T >> &  value)
inlineoverridevirtual

Sets the vector to the given value.

After a.set_value(b.get_value()), a must be identical to b. May throw std::out_of_range if the new value has different dimensions than expected by the concrete class implementing VectorInterface.

Implements VectorInterface< T >.

Here is the call graph for this function:

int size ( ) const
inlineoverridevirtual

Returns the size of the vector, which must be equal to the number of rows in get_value().

Implements VectorInterface< T >.

Here is the caller graph for this function:


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