Skip to content

raisim::ColRef ​

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

Inherits: raisim::MatExpr< ColRef< T, n > >

cpp
template <class T, size_t n>
class ColRef

View of one column (n elements) of a matrix, returned by Mat::col(). Reads and writes go to the referenced matrix; for a const matrix the accessors return by value.

Public types ​

SelfType ​

cpp
typedef ColRef<T, n> SelfType

This type.

MutableRef ​

cpp
using MutableRef = std::conditional_t<std::is_const<T>::value, double, double &>

double& for a mutable referenced matrix, double for a const one.

Constructors & destructor ​

ColRef ​

cpp
ColRef(T &array, size_t c)

Parameters

ParameterDescription
array (in)referenced matrix
c (in)column index

Public member functions ​

operator() ​

cpp
double operator()(size_t i) const

Parameters

ParameterDescription
i (in)element index

Returns element i of the column.

cpp
MutableRef operator()(size_t i)

Parameters

ParameterDescription
i (in)element index

Returns element i of the column.

cpp
double operator()(size_t i, size_t j) const

Parameters

ParameterDescription
i (in)row index
j (in)ignored

Returns element i of the column; j is ignored.

cpp
MutableRef operator()(size_t i, size_t j)

Parameters

ParameterDescription
i (in)row index
j (in)ignored

Returns element i of the column; j is ignored.

operator[] ​

cpp
double operator[](size_t i) const

Parameters

ParameterDescription
i (in)element index

Returns element i of the column.

cpp
MutableRef operator[](size_t i)

Parameters

ParameterDescription
i (in)element index

Returns element i of the column.

Static member functions ​

size static ​

cpp
static constexpr size_t size()

Returns number of elements, n.

rows static ​

cpp
static constexpr size_t rows()

Returns number of rows, n.

cols static ​

cpp
static constexpr size_t cols()

Returns 1.

Public attributes ​

ref ​

cpp
T &ref

Referenced matrix.

col ​

cpp
size_t col

Column index in the referenced matrix.

RaiSim — physics for robotics and AI.