raisim::ColRef
class · #include <raisim/math/Blocks.hpp>
Inherits: raisim::MatExpr< ColRef< T, n > >
cpp
template <class T, size_t n>
class ColRefView 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> SelfTypeThis 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
| Parameter | Description |
|---|---|
array (in) | referenced matrix |
c (in) | column index |
Public member functions
operator()
cpp
double operator()(size_t i) constParameters
| Parameter | Description |
|---|---|
i (in) | element index |
Returns element i of the column.
cpp
MutableRef operator()(size_t i)Parameters
| Parameter | Description |
|---|---|
i (in) | element index |
Returns element i of the column.
cpp
double operator()(size_t i, size_t j) constParameters
| Parameter | Description |
|---|---|
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
| Parameter | Description |
|---|---|
i (in) | row index |
j (in) | ignored |
Returns element i of the column; j is ignored.
operator[]
cpp
double operator[](size_t i) constParameters
| Parameter | Description |
|---|---|
i (in) | element index |
Returns element i of the column.
cpp
MutableRef operator[](size_t i)Parameters
| Parameter | Description |
|---|---|
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 &refReferenced matrix.
col
cpp
size_t colColumn index in the referenced matrix.