raisim::RowRef
class · #include <raisim/math/Blocks.hpp>
Inherits: raisim::MatExpr< RowRef< T, m > >
template <class T, size_t m>
class RowRefView of one row (m elements) of a matrix, returned by Mat::row(). Reads and writes go to the referenced matrix; for a const matrix the accessors return by value.
Public types
SelfType
typedef RowRef<T, m> SelfTypeThis type.
MutableRef
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
RowRef
RowRef(T &array, size_t r)Parameters
| Parameter | Description |
|---|---|
array (in) | referenced matrix |
r (in) | row index |
Public member functions
operator()
double operator()(size_t i) constParameters
| Parameter | Description |
|---|---|
i (in) | element index |
Returns element i of the row.
MutableRef operator()(size_t i)Parameters
| Parameter | Description |
|---|---|
i (in) | element index |
Returns element i of the row.
double operator()(size_t i, size_t j) constParameters
| Parameter | Description |
|---|---|
i (in) | ignored |
j (in) | column index |
Returns element j of the row; i is ignored.
MutableRef operator()(size_t i, size_t j)Parameters
| Parameter | Description |
|---|---|
i (in) | ignored |
j (in) | column index |
Returns element j of the row; i is ignored.
operator[]
double operator[](size_t i) constParameters
| Parameter | Description |
|---|---|
i (in) | element index |
Returns element i of the row.
MutableRef operator[](size_t i)Parameters
| Parameter | Description |
|---|---|
i (in) | element index |
Returns element i of the row.
operator=
template <class T2>
RowRef<T, m> &operator=(const MatExpr<T2> &expr)Writes the m elements of expr (in linear order) into the row.
Parameters
| Parameter | Description |
|---|---|
expr (in) | source expression with m elements |
Returns *this
template <size_t exprRows>
RowRef<T, m> &operator=(const Mat<exprRows, 1> &expr)Writes a column vector of size m into the row.
Parameters
| Parameter | Description |
|---|---|
expr (in) | source vector |
Returns *this
Static member functions
size static
static constexpr size_t size()Returns number of elements, m.
rows static
static constexpr size_t rows()Returns 1.
cols static
static constexpr size_t cols()Returns number of columns, m.
Public attributes
ref
T &refReferenced matrix.
row
size_t rowRow index in the referenced matrix.