Skip to content

raisim::ElementRef ​

class · #include <raisim/math/Blocks.hpp>

cpp
template <class T>
class ElementRef

Proxy returned by the comma initializers (Mat::operator<<() and DynamicArray::operator=(double)); each following , value writes the next element in linear (column-major) order.

Constructors & destructor ​

ElementRef ​

cpp
ElementRef(T &array, size_t id)

Parameters

ParameterDescription
array (in)target being initialized
id (in)linear index of the next element to write

Public member functions ​

operator, ​

cpp
ElementRef &operator,(double a)

Eigen-style comma initializer continuation. Usage: v << 1.0, 2.0, 3.0; where operator<< seeds the first element. Writing past the end is fatal for fixed-size targets; DynamicArray targets are not checked.

Parameters

ParameterDescription
a (in)value of the next element

Returns *this

Public attributes ​

ref ​

cpp
T &ref

Target being initialized.

idx ​

cpp
size_t idx

Linear index of the next element to write.

RaiSim — physics for robotics and AI.