raisim::Prod_op
class · #include <raisim/math/Operation.hpp>
Inherits: raisim::MatExpr< Prod_op< T1, T2 > >
cpp
template <typename T1, typename T2>
class Prod_opLazy matrix-product expression returned by operator* on two fixed-size matrix expressions. Unlike the element-wise expressions it is rows(T1) x cols(T2) and requires compatible inner dimensions. It holds references to its operands, and every element access recomputes a dot product, so assign it to a Mat before reading it repeatedly.
Public types
SelfType
cpp
using SelfType = Prod_op<T1, T2>This type.
Constructors & destructor
Prod_op
cpp
Prod_op(T1 const &u, T2 const &v)Parameters
| Parameter | Description |
|---|---|
u (in) | left operand (held by reference) |
v (in) | right operand (held by reference) |
Public member functions
operator()
cpp
double operator()(size_t i, size_t j) constParameters
| Parameter | Description |
|---|---|
i (in) | row index |
j (in) | column index |
Returns element (i, j) of the product.
cpp
double operator()(size_t i) constParameters
| Parameter | Description |
|---|---|
i (in) | column-major linear index |
Returns element i of the product.
operator[]
cpp
double operator[](size_t i) constParameters
| Parameter | Description |
|---|---|
i (in) | column-major linear index |
Returns element i of the product.
Static member functions
size static
cpp
static constexpr size_t size()Returns number of elements.
cols static
cpp
static constexpr size_t cols()Returns number of columns of the right operand.
rows static
cpp
static constexpr size_t rows()Returns number of rows of the left operand.
Public attributes
_u
cpp
const T1 &_uLeft operand.
_v
cpp
const T2 &_vRight operand.