|
| | Quantities ()=default |
template<typename T0, typename... Ts>
requires (!IsSpecialization<T0, Tag>::value && !CopiesOrMoves<Quantities, T0, Ts...>) |
| | explicit (!IsValidConversion< ThisT, std::remove_cvref_t< T0 >, std::remove_cvref_t< Ts >... >::value) Quantities(T0 &&t0 |
| Ts Ts | std::forward (t0) |
| Ts Ts | std::forward (ts)...) |
| auto | get () const |
| template<int RowIdV_, int ColIdV_> |
| auto | get () const |
template<int IdV_>
requires (Dimension<ThisT>::value <= 1) |
| auto | get () const |
| | The quantity with the single index IdV_ of quantities of dimension 0 or 1: the row of a column, e.g. of a vector, the column of a row, e.g. of a covector, or 0 for a 1x1 matrix (see internal::vectorElementRowId()).
|
| auto | get (const int rowId, const int colId) const |
| auto | get (const int id) const |
| | The quantity with the single index id of quantities of dimension 0 or 1, like get<IdV_>(), but with an index known at run time, which, like get(rowId, colId), requires all elements to have the same unit.
|
template<typename ValueT_, typename UnitT_>
requires (Dimension<ThisT>::value == 0) |
| void | set (const Quantity< ValueT_, UnitT_ > &quantity) |
| template<int RowIdV_, int ColIdV_, typename ValueT_, typename UnitT_> |
| void | set (const Quantity< ValueT_, UnitT_ > &quantity) |
template<int IdV_, typename ValueT_, typename UnitT_>
requires (Dimension<ThisT>::value <= 1) |
| void | set (const Quantity< ValueT_, UnitT_ > &quantity) |
| | Sets the quantity with the single index IdV_ of quantities of dimension 0 or 1 (see get<IdV_>()), like set<RowIdV_, ColIdV_>(), which checks the index and the unit at compile time.
|
| template<typename ValueT_, typename UnitT_> |
| void | set (const int rowId, const int colId, const Quantity< ValueT_, UnitT_ > &quantity) |
template<typename ValueT_, typename UnitT_>
requires (Dimension<ThisT>::value <= 1) |
| void | set (const int id, const Quantity< ValueT_, UnitT_ > &quantity) |
| | Sets the quantity with the single index id of quantities of dimension 0 or 1, like set<IdV_>(), but with an index known at run time, which, like set(rowId, colId, quantity), requires all elements to have the same unit.
|
| template<typename ValuesOtherT_> |
| void | setValues (const ValuesOtherT_ &values) |
| | Set the values of the quantities.
|
template<typename ValueOtherT_>
requires (Dimension<ThisT>::value == 0) |
| void | setValue (ValueOtherT_ value) |
| | Sets the value of a quantity.
|
| const ValuesT & | getValues () const & |
| | Get the values of the quantities.
|
| ValuesT | getValues () && |
| | The values of a temporary are moved out of it, which avoids a copy and does not refer to the destroyed temporary.
|
| ValueT | getValue () const |
| template<typename ValuesOtherT_, typename UnitsOtherT_> |
| bool | isApprox (const Quantities< ValuesOtherT_, UnitsOtherT_ > &other, const ValueT precision=Precision< ValueT >::value()) const |
| template<int BlockRowIdV_, int BlockColIdV_, int BlockRowsV_, int BlockColsV_> |
| auto | block () const |
| auto | transpose () const |
| template<typename ValuesOtherT_, typename UnitsOtherT_> |
| auto | innerProduct (const Quantities< ValuesOtherT_, UnitsOtherT_ > &other) const |
| template<typename ValuesOtherT_, typename UnitsOtherT_> |
| auto | outerProduct (const Quantities< ValuesOtherT_, UnitsOtherT_ > &other) const |
| template<typename ValuesOtherT_, typename UnitsOtherT_> |
| auto | dotProduct (const Quantities< ValuesOtherT_, UnitsOtherT_ > &other) const |
| template<typename ValuesOtherT_, typename UnitsOtherT_> |
| auto | crossProduct (const Quantities< ValuesOtherT_, UnitsOtherT_ > &other) const |
| auto | inverse () const |
| | The matrix inverse of a square matrix, whose units must describe a linear map, M_ij = a_i / b_j: the units of the inverse are (M^-1)_ij = b_i / a_j (see Inverse<TypeMatrixImpl<...>> in Units.hpp).
|
| auto | pseudoInverse () const |
| | The Moore-Penrose pseudo-inverse A^+ of a matrix A of full rank: A^T (A A^T)^-1 if it has fewer rows than columns, i.e. full row rank, e.g. the joint velocities q' = J^+ x' of the smallest norm for a redundant robot, (A^T A)^-1 A^T if it has more, i.e. full column rank, the least squares solution, and the inverse A^-1 if it is square.
|
| auto | cwiseInverse () const |
| | The elementwise reciprocal, whose units are the reciprocals of the units.
|
| auto | norm () const |
| auto | squaredNorm () const |
| auto | determinant () const |
| | Get the determinant of a square matrix, including a 1x1 matrix, whose units must describe a linear map.
|
| auto | evaluate () const & |
| auto | evaluate () && |
template<AnyValuesWrapper ValuesT_, AnyUnitMatrix UnitsT_>
class wuzp::Quantities< ValuesT_, UnitsT_ >
Container to store quantities.
Every quantity consists of a value and a unit. The values are evaluated at run-time, the units at compile-time.
- Template Parameters
-
| ValuesT_ | Container type to store the values (e.g. a scalar, vector, matrix, etc.). |
| UnitsT_ | Container storing the units (e.g. a scalar, vector, matrix, etc.). |
Definition at line 42 of file Quantities.hpp.
template<AnyValuesWrapper ValuesT_, AnyUnitMatrix UnitsT_>
The Moore-Penrose pseudo-inverse A^+ of a matrix A of full rank: A^T (A A^T)^-1 if it has fewer rows than columns, i.e. full row rank, e.g. the joint velocities q' = J^+ x' of the smallest norm for a redundant robot, (A^T A)^-1 A^T if it has more, i.e. full column rank, the least squares solution, and the inverse A^-1 if it is square.
Its units are those of an inverse, (A^+)_ij = b_i / a_j for A_ij = a_i / b_j. A A^T and A^T A sum over the columns or the rows, so the columns of a matrix with fewer rows must have the same unit, and the rows of a matrix with more rows, otherwise it fails with "Units do not match.": the pseudo-inverse minimizes a Euclidean norm, which needs components with the same unit, and for other units it depends on the choice of units (Doty, Melchiorri and Bonivento, "A theory of generalized inverses applied to robotics", The International Journal of Robotics Research 12(1), 1993). Use a weighted pseudo-inverse for them. A matrix that does not have full rank has no pseudo-inverse of this form, the inverse of A A^T or A^T A is not finite or huge, unlike kindr's pseudoInverse(), which takes the singular value decomposition, which not every value matrix backend provides. It needs matrix inverses (InvertibleValueMatrixBackend) and floating-point values.
Definition at line 228 of file Quantities.hpp.