16#include "wuzp/core/internal/skew_symmetric.hpp"
26template <
bool TransposeV_>
28 template <
typename QuantitiesT_>
29 using type = QuantitiesT_;
31 template <
typename QuantitiesT_>
32 static QuantitiesT_&& value(QuantitiesT_&& quantities) {
33 return std::forward<QuantitiesT_>(quantities);
37struct TransposeIf<true> {
38 template <
typename QuantitiesT_>
39 using type =
typename Evaluate<typename Transpose<QuantitiesT_>::type>::type;
40 template <
typename QuantitiesT_>
41 static auto value(
const QuantitiesT_& quantities) {
42 return quantities.transpose();
48template <
typename IndicesT_,
typename QuantitiesT_>
49inline constexpr bool isBatch = std::is_same_v<IndicesT_, Indices<Up>> && Cols<QuantitiesT_>::value > 1;
54template <
typename IndicesT_,
typename QuantitiesT_>
56 static_assert(!isBatch<IndicesT_, QuantitiesT_>,
57 "A batch of vectors, one per column, only supports transformations, sums, differences, comparisons, and products and "
58 "quotients with scalars.");
59 static constexpr bool value =
true;
72template <
typename IndicesT_,
typename CoordinateSystemT_>
73struct RequireEuclidean {
74 static_assert(IndicesT_::RankV != 1 || EuclideanCoordinateSystem<CoordinateSystemT_>,
75 "dotProduct, norm, squaredNorm, crossProduct and the transpose of a vector or a covector use the Euclidean metric, "
76 "which this coordinate system does not have. Pair a covector and a vector with innerProduct, which needs no metric, "
77 "or contract with the metric explicitly, e.g. with getInvariant() in a Minkowski coordinate system.");
78 static constexpr bool value =
true;
98template <AnyIndices IndicesT_, AnyQuantities QuantitiesT_, AnyCoordinateSystem CoordinateSystemT_, AbsoluteOrRelative AbsoluteT_>
104 using UnitsT =
typename QuantitiesT::UnitsT;
105 using ValuesT =
typename QuantitiesT::ValuesT;
106 using ValueT =
typename QuantitiesT::ValueT;
110 static_assert(IndicesT::RankV <= 2,
"Tensors of rank 3 or more are not supported at the moment.");
113 "A tensor of rank 0 is stored as a 1x1 matrix.");
115 "A covector, a tensor with one lower index, is stored as a row.");
117 "A tensor of rank 2 is stored as a square matrix.");
120 static_assert(!AbsoluteT::value || std::is_same_v<IndicesT, Indices<Up>>,
121 "Only a tensor with one upper index, a vector or a batch of vectors, can be absolute (a point).");
126 template <
typename T0,
typename... Ts>
135 template <
typename ValuesOtherT_,
typename UnitsOtherT_>
144 template <
typename ValuesOtherT_>
146 quantities_.setValues(values);
165 template <
typename IndicesOtherT_,
typename QuantitiesOtherT_,
typename CoordinateSystemOtherT_,
typename AbsoluteOtherT_>
169 static_assert(std::is_same_v<IndicesT, IndicesOtherT_>,
"Indices do not match.");
170 static_assert(std::is_same_v<CoordinateSystemT, CoordinateSystemOtherT_>,
"Coordinate systems do not match.");
171 static_assert(std::is_same_v<AbsoluteT, AbsoluteOtherT_>,
"Absolute/relative mismatch.");
172 return quantities_.isApprox(other.
getQuantities(), precision);
178 return quantities_.get();
181 template <
int RowIdV_,
int ColIdV_>
183 return quantities_.template get<RowIdV_, ColIdV_>();
200 static_assert(internal::RejectBatch<IndicesT, QuantitiesT>::value);
201 return quantities_.template get<IdV_>();
204 auto getQuantity(
const int rowId,
const int colId)
const {
return quantities_.get(rowId, colId); }
211 static_assert(internal::RejectBatch<IndicesT, QuantitiesT>::value);
212 return quantities_.get(
id);
215 template <
typename QuantityT_>
219 return quantities_.set(quantity);
222 template <
int RowIdV_,
int ColIdV_,
typename QuantityT_>
224 return quantities_.template set<RowIdV_, ColIdV_>(quantity);
229 template <
int IdV_,
typename QuantityT_>
233 static_assert(internal::RejectBatch<IndicesT, QuantitiesT>::value);
234 quantities_.template set<IdV_>(quantity);
237 template <
typename QuantityT_>
238 void setQuantity(
const int rowId,
const int colId,
const QuantityT_& quantity) {
239 quantities_.set(rowId, colId, quantity);
244 template <
typename QuantityT_>
248 static_assert(internal::RejectBatch<IndicesT, QuantitiesT>::value);
249 quantities_.set(
id, quantity);
254 template <
int BlockRowIdV_,
int BlockColIdV_,
int BlockRowsV_,
int BlockColsV_>
267 template <
typename IndicesOtherT_,
typename QuantitiesOtherT_,
typename CoordinateSystemOtherT_,
typename AbsoluteOtherT_>
269 using TraitT = InnerProduct<ThisT, Tensor<IndicesOtherT_, QuantitiesOtherT_, CoordinateSystemOtherT_, AbsoluteOtherT_>>;
272 internal::TransposeIf<TraitT::TransposeRhsV>::value(other.
getQuantities())))};
278 template <
typename IndicesOtherT_,
typename QuantitiesOtherT_,
typename CoordinateSystemOtherT_,
typename AbsoluteOtherT_>
296 template <
typename IndicesOtherT_,
typename QuantitiesOtherT_,
typename CoordinateSystemOtherT_,
typename AbsoluteOtherT_>
315 static_assert(std::is_same_v<typename Inverse<AbsoluteT>::type,
Relative>);
316 return quantities_.cwiseInverse();
327 static_assert(internal::RejectBatch<IndicesT, QuantitiesT>::value);
328 static_assert(std::is_same_v<typename Norm<AbsoluteT>::type,
Relative>);
329 static_assert(internal::RequireEuclidean<IndicesT, CoordinateSystemT>::value);
330 return quantities_.norm();
336 static_assert(internal::RejectBatch<IndicesT, QuantitiesT>::value);
337 static_assert(std::is_same_v<typename Norm<AbsoluteT>::type,
Relative>);
338 static_assert(internal::RequireEuclidean<IndicesT, CoordinateSystemT>::value);
339 return quantities_.squaredNorm();
355 template <
typename IndicesOtherT_,
typename QuantitiesOtherT_,
typename CoordinateSystemOtherT_,
typename AbsoluteOtherT_>
361 static_assert(ConversionT::IndicesMatchV,
"Indices do not match.");
362 static_assert(ConversionT::CoordinateSystemsMatchV,
"Coordinate systems do not match.");
364 static_assert(ConversionT::AbsoluteMatchV,
"Absolute/relative mismatch.");
367 template <
typename... Ts>
373template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_,
typename IndicesOtherT_,
374 typename QuantitiesOtherT_,
typename CoordinateSystemOtherT_,
typename AbsoluteOtherT_>
376 Tensor<IndicesOtherT_, QuantitiesOtherT_, CoordinateSystemOtherT_, AbsoluteOtherT_>> {
379 static constexpr bool IndicesMatchV = std::is_same_v<IndicesT_, IndicesOtherT_>;
381 static constexpr bool AbsoluteMatchV = std::is_same_v<AbsoluteT_, AbsoluteOtherT_>;
386template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_,
typename... Ts>
387struct GetTag<
Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>, Ts...> {
388 using first = std::decay_t<std::tuple_element_t<0, std::tuple<Ts...>>>;
392template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
397template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
398struct Rows<
Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
402template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
403struct Cols<
Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
407template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
408 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
409struct Sum<
Tensor<IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_>,
410 Tensor<IndicesRhsT_, QuantitiesRhsT_, CoordinateSystemRhsT_, AbsoluteRhsT_>> {
412 typename Sum<CoordinateSystemLhsT_, CoordinateSystemRhsT_>::type,
typename Sum<AbsoluteLhsT_, AbsoluteRhsT_>::type>;
415template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
416 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
417struct Difference<
Tensor<IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_>,
418 Tensor<IndicesRhsT_, QuantitiesRhsT_, CoordinateSystemRhsT_, AbsoluteRhsT_>> {
420 typename Difference<CoordinateSystemLhsT_, CoordinateSystemRhsT_>::type,
421 typename Difference<AbsoluteLhsT_, AbsoluteRhsT_>::type>;
424template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
425struct Negation<
Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
431template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
432 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
433struct Product<
Tensor<IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_>,
434 Tensor<IndicesRhsT_, QuantitiesRhsT_, CoordinateSystemRhsT_, AbsoluteRhsT_>> {
437 typename Product<CoordinateSystemLhsT_, CoordinateSystemRhsT_>::type,
typename Product<AbsoluteLhsT_, AbsoluteRhsT_>::type>;
443template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename ValuesRhsT_,
445struct Product<
Tensor<IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_>,
Quantities<ValuesRhsT_, UnitsRhsT_>> {
447 "A tensor can only be multiplied by a scalar, a quantity or a tensor of rank 0. Use innerProduct, outerProduct or "
448 "cwiseProduct for other products.");
450 typename Product<AbsoluteLhsT_, Relative>::type>;
452template <
typename ValuesLhsT_,
typename UnitsLhsT_,
typename IndicesRhsT_,
typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
453 typename AbsoluteRhsT_>
454struct Product<
Quantities<ValuesLhsT_, UnitsLhsT_>,
Tensor<IndicesRhsT_, QuantitiesRhsT_, CoordinateSystemRhsT_, AbsoluteRhsT_>> {
455 using type =
typename Product<Tensor<IndicesRhsT_, QuantitiesRhsT_, CoordinateSystemRhsT_, AbsoluteRhsT_>,
468template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
469 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
470struct InnerProduct<
Tensor<IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_>,
471 Tensor<IndicesRhsT_, QuantitiesRhsT_, CoordinateSystemRhsT_, AbsoluteRhsT_>> {
472 static_assert(internal::RejectBatch<IndicesLhsT_, QuantitiesLhsT_>::value && internal::RejectBatch<IndicesRhsT_, QuantitiesRhsT_>::value);
473 using IndicesT =
typename InnerProduct<IndicesLhsT_, IndicesRhsT_>::type;
474 static constexpr bool TransposeLhsV = std::is_same_v<IndicesLhsT_, Indices<Up>>;
475 static constexpr bool TransposeRhsV = std::is_same_v<IndicesRhsT_, Indices<Down>>;
477 static constexpr bool TransposeResultV = IndicesT::RankV == 1 && ((IndicesLhsT_::RankV == 1) == std::is_same_v<IndicesT, Indices<Up>>);
480 typename internal::TransposeIf<TransposeResultV>::template
type<
typename Evaluate<
483 typename Product<CoordinateSystemLhsT_, CoordinateSystemRhsT_>::type,
typename Product<AbsoluteLhsT_, AbsoluteRhsT_>::type>;
488template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
489 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
490struct OuterProduct<
Tensor<IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_>,
491 Tensor<IndicesRhsT_, QuantitiesRhsT_, CoordinateSystemRhsT_, AbsoluteRhsT_>> {
492 static_assert(internal::RejectBatch<IndicesLhsT_, QuantitiesLhsT_>::value && internal::RejectBatch<IndicesRhsT_, QuantitiesRhsT_>::value);
493 static constexpr bool TransposeLhsV = !std::is_same_v<IndicesLhsT_, Indices<Up>>;
494 static constexpr bool TransposeRhsV = !std::is_same_v<IndicesRhsT_, Indices<Down>>;
499 typename Product<CoordinateSystemLhsT_, CoordinateSystemRhsT_>::type,
typename Product<AbsoluteLhsT_, AbsoluteRhsT_>::type>;
502template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
503 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
504struct DotProduct<
Tensor<IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_>,
505 Tensor<IndicesRhsT_, QuantitiesRhsT_, CoordinateSystemRhsT_, AbsoluteRhsT_>> {
506 static_assert(std::is_same_v<IndicesLhsT_, IndicesRhsT_>,
"Indices do not match.");
507 static_assert(internal::RejectBatch<IndicesLhsT_, QuantitiesLhsT_>::value && internal::RejectBatch<IndicesRhsT_, QuantitiesRhsT_>::value);
508 static_assert(std::is_same_v<CoordinateSystemLhsT_, CoordinateSystemRhsT_>,
"Coordinate systems do not match.");
509 static_assert(internal::RequireEuclidean<IndicesLhsT_, CoordinateSystemLhsT_>::value);
511 using AbsoluteT =
typename Product<AbsoluteLhsT_, AbsoluteRhsT_>::type;
515template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
516 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
518 Tensor<IndicesRhsT_, QuantitiesRhsT_, CoordinateSystemRhsT_, AbsoluteRhsT_>> {
519 static_assert(internal::RejectBatch<IndicesLhsT_, QuantitiesLhsT_>::value && internal::RejectBatch<IndicesRhsT_, QuantitiesRhsT_>::value);
520 static_assert(std::is_same_v<CoordinateSystemLhsT_, CoordinateSystemRhsT_>,
"Coordinate systems do not match.");
521 static_assert(internal::RequireEuclidean<IndicesLhsT_, CoordinateSystemLhsT_>::value);
523 using AbsoluteT =
typename Product<AbsoluteLhsT_, AbsoluteRhsT_>::type;
529template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
530 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
531struct Division<
Tensor<IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_>,
532 Tensor<IndicesRhsT_, QuantitiesRhsT_, CoordinateSystemRhsT_, AbsoluteRhsT_>> {
535 typename Division<CoordinateSystemLhsT_, CoordinateSystemRhsT_>::type,
typename Division<AbsoluteLhsT_, AbsoluteRhsT_>::type>;
539template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename ValuesRhsT_,
541struct Division<
Tensor<IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_>,
Quantities<ValuesRhsT_, UnitsRhsT_>> {
543 "A tensor can only be divided by a scalar, a quantity or a tensor of rank 0. Use cwiseQuotient for elementwise "
546 typename Division<AbsoluteLhsT_, Relative>::type>;
549template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
551 static_assert(internal::RejectBatch<IndicesT_, QuantitiesT_>::value);
553 static_assert(internal::RequireEuclidean<IndicesT_, CoordinateSystemT_>::value);
557template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_,
int BlockRowIdV_,
int BlockColIdV_,
558 int BlockRowsV_,
int BlockColsV_>
559struct Block<
Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>, BlockRowIdV_, BlockColIdV_, BlockRowsV_, BlockColsV_> {
561 CoordinateSystemT_, AbsoluteT_>;
565template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
566struct Inverse<
Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
567 static_assert(internal::RejectBatch<IndicesT_, QuantitiesT_>::value);
576template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
578 static_assert(internal::RejectBatch<IndicesT_, QuantitiesT_>::value);
583template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
585 using type = CoordinateSystemT_;
588template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
590 static constexpr bool value = AbsoluteT_::value;
594template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
598 std::move(
object).getQuantities());
603template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
607 std::move(
object).getQuantities());
611template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_,
typename NewCoordinateSystemT_>
616template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
617struct Evaluate<
Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
621template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
622 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
629template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
630 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
633 return sum(lhs, rhs);
636template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
637 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
644template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
645 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
651template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
656template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
667template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
668 ArithmeticValue ValueRhsT_>
671 return product(lhs, internal::toDimensionlessQuantity<typename QuantitiesLhsT_::ValuesT>(rhs));
673template <ArithmeticValue ValueLhsT_,
typename IndicesRhsT_,
typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
674 typename AbsoluteRhsT_>
679template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename MatrixSizeRhsT_,
680 typename ValueRhsT_,
typename ImplementationRhsT_>
687template <
typename MatrixSizeLhsT_,
typename ValueLhsT_,
typename ImplementationLhsT_,
typename IndicesRhsT_,
typename QuantitiesRhsT_,
688 typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
694template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename ValuesRhsT_,
701template <
typename ValuesLhsT_,
typename UnitsLhsT_,
typename IndicesRhsT_,
typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
702 typename AbsoluteRhsT_>
708template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
709 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
716template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
717 ArithmeticValue ValueRhsT_>
721template <ArithmeticValue ValueLhsT_,
typename IndicesRhsT_,
typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
722 typename AbsoluteRhsT_>
726template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename MatrixSizeRhsT_,
727 typename ValueRhsT_,
typename ImplementationRhsT_>
732template <
typename MatrixSizeLhsT_,
typename ValueLhsT_,
typename ImplementationLhsT_,
typename IndicesRhsT_,
typename QuantitiesRhsT_,
733 typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
738template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename ValuesRhsT_,
744template <
typename ValuesLhsT_,
typename UnitsLhsT_,
typename IndicesRhsT_,
typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
745 typename AbsoluteRhsT_>
750template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
751 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
762template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
763 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
773template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
774 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
777 using TraitT = OuterProduct<Tensor<IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_>,
781 internal::TransposeIf<TraitT::TransposeRhsV>::value(rhs.
getQuantities()))};
794template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
799 using ValueT =
typename QuantitiesT_::ValueT;
805 return internal::skewSymmetric<MatrixT, ValueT>(values.template get<0, 0>(), values.template get<1, 0>(), values.template get<2, 0>());
815template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
818 "The vector of a skew-symmetric matrix is only defined for three-dimensional linear maps, tensors with an upper and a "
820 using ValueT =
typename QuantitiesT_::ValueT;
821 const auto [first, second, third] = internal::vectorOfSkewSymmetricPart(matrix.
getQuantities());
823 typename GetType<
typename decltype(second)::UnitsT>::type,
824 typename GetType<
typename decltype(third)::UnitsT>::type>>;
829 return VectorT{
typename VectorT::QuantitiesT{first, second, third}};
838template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
839 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
842 static_assert(std::is_same_v<CoordinateSystemLhsT_, CoordinateSystemRhsT_>,
"Coordinate systems do not match.");
843 static_assert(std::is_same_v<typename Product<AbsoluteLhsT_, AbsoluteRhsT_>::type,
Relative>);
849template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
850 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
853 static_assert(std::is_same_v<CoordinateSystemLhsT_, CoordinateSystemRhsT_>,
"Coordinate systems do not match.");
854 static_assert(std::is_same_v<typename Division<AbsoluteLhsT_, AbsoluteRhsT_>::type,
Relative>);
862template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
863 ArithmeticValue ValueRhsT_>
866 return division(lhs, internal::toDimensionlessQuantity<typename QuantitiesLhsT_::ValuesT>(rhs));
868template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename MatrixSizeRhsT_,
869 typename ValueRhsT_,
typename ImplementationRhsT_>
876template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename ValuesRhsT_,
883template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
884 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
891template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
892 ArithmeticValue ValueRhsT_>
896template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename MatrixSizeRhsT_,
897 typename ValueRhsT_,
typename ImplementationRhsT_>
902template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename ValuesRhsT_,
908template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
909 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
915template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
916 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
919 static_assert(std::is_same_v<IndicesLhsT_, IndicesRhsT_>,
"Indices do not match.");
920 static_assert(std::is_same_v<CoordinateSystemLhsT_, CoordinateSystemRhsT_>,
"Coordinate systems do not match.");
921 static_assert(std::is_same_v<AbsoluteLhsT_, AbsoluteRhsT_>,
"Absolute/relative mismatch.");
925template <
typename IndicesLhsT_,
typename QuantitiesLhsT_,
typename CoordinateSystemLhsT_,
typename AbsoluteLhsT_,
typename IndicesRhsT_,
926 typename QuantitiesRhsT_,
typename CoordinateSystemRhsT_,
typename AbsoluteRhsT_>
929 return !(lhs == rhs);
932template <
typename IndicesT_,
typename QuantitiesT_,
typename CoordinateSystemT_,
typename AbsoluteT_>
941template <
typename QuantityVectorT_,
typename CoordinateSystemT_>
943template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename UnitT_,
typename CoordinateSystemT_>
947template <
typename QuantityVectorT_,
typename CoordinateSystemT_>
949template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename UnitT_,
typename CoordinateSystemT_>
959template <
typename QuantityVectorT_,
typename CoordinateSystemT_>
961template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename UnitT_,
typename CoordinateSystemT_>
965template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
968template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
970template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
979template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
983template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
986template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
988template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
991template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
994template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
996template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
999template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1002template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1004template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1007template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1010template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1012template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1015template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1018template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1020template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1023template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1026 CoordinateSystemT_>;
1027template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1029template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1032template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1035template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1037template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1048template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1051template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1053template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1056template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1059template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1061template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1066template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1069template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1077template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1080template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1082template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1084template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1091template <
int DimensionV_,
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1094template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1096template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
1098template <
template <
typename,
int,
int>
typename ValuesT_,
typename ValueT_,
typename CoordinateSystemT_>
Container to store quantities.
A tensor of rank 0, 1 or 2, whose components are quantities, expressed in a coordinate system,...
auto dotProduct(const Tensor< IndicesOtherT_, QuantitiesOtherT_, CoordinateSystemOtherT_, AbsoluteOtherT_ > &other) const
The dot product sum_i v_i w_i of two vectors in the same coordinate system, which must be Euclidean: ...
auto innerProduct(const Tensor< IndicesOtherT_, QuantitiesOtherT_, CoordinateSystemOtherT_, AbsoluteOtherT_ > &other) const
The inner product, see innerProduct().
const ValuesT & getValues() const &
void setQuantity(const QuantityT_ &quantity)
Sets the component with the single index IdV_ of a vector, a point or a covector, e....
const QuantitiesT & getQuantities() const &
auto determinant() const
The determinant of a tensor of rank 0 or of a mixed tensor of rank 2, e.g. a linear map T^i_j,...
void setQuantity(const int id, const QuantityT_ &quantity)
Sets the component with the single index id of a vector, a point or a covector, like setQuantity<IdV_...
typename QuantitiesT::ValueT ValueT
auto inverse() const
The matrix inverse of a tensor of rank 0 or 2, like Eigen's MatrixBase::inverse(): e....
void setQuantity(const int rowId, const int colId, const QuantityT_ &quantity)
QuantitiesT getQuantities() &&
The quantities of a temporary are moved out of it, which avoids a copy and does not refer to the dest...
typename QuantitiesT::ValuesT ValuesT
CoordinateSystemT_ CoordinateSystemT
auto hyperdeterminant() const
Not implemented. The return type is deduced, so that the message is the first error (see FailOnInstan...
auto crossProduct(const Tensor< IndicesOtherT_, QuantitiesOtherT_, CoordinateSystemOtherT_, AbsoluteOtherT_ > &other) const
The cross product a x b of two three-dimensional vectors in the same Euclidean coordinate system (see...
void setQuantities(const Quantities< ValuesOtherT_, UnitsOtherT_ > &component)
void setQuantity(const QuantityT_ &quantity)
auto getQuantity(const int rowId, const int colId) const
auto getQuantity(const int id) const
The component with the single index id of a vector, a point or a covector, like getQuantity<IdV_>(),...
Tensor< IndicesT, QuantitiesT, CoordinateSystemT, AbsoluteT > ThisT
bool isApprox(const Tensor< IndicesOtherT_, QuantitiesOtherT_, CoordinateSystemOtherT_, AbsoluteOtherT_ > &other, const ValueT precision=Precision< ValueT >::value()) const
Whether the components of both tensors, which must have the same indices, coordinate system and absol...
auto getQuantity() const
The component with the single index IdV_ of a vector, a point or a covector, e.g. velocity....
void setValues(const ValuesOtherT_ &values)
auto cwiseInverse() const
The elementwise reciprocal of the components, like Eigen's ArrayBase::inverse().
auto transpose() const
The transpose of the matrix of the components: a vector becomes a covector and vice versa,...
typename QuantitiesT::UnitsT UnitsT
void setQuantity(const QuantityT_ &quantity)
Wrapper for the actual implementation of a value container.
Any tensor: a specialization of Tensor, including points, vectors and their aliases.
The alias template ValueMatrix<ValueT_, RowsV_, ColsV_> of any value matrix backend,...
Whether constructing a Class from the arguments copies or moves it, i.e. whether they are a single Cl...
A coordinate system with the Minkowski metric, e.g. CoordinateSystem<Spacetime, Minkowski>: an inerti...
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Dimensionless, CoordinateSystemT_ > DirectionVector
auto cwiseQuotient(const Tensor< IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_ > &lhs, const Tensor< IndicesRhsT_, QuantitiesRhsT_, CoordinateSystemRhsT_, AbsoluteRhsT_ > &rhs)
The elementwise quotient of the components of two tensors in the same coordinate system,...
internal::AbsoluteImpl< true > Absolute
auto operator*(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const ValueRhsT_ rhs)
AccelerationVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > AccelerationVector2
auto product(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const ValueRhsT_ rhs)
ForceCovector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > ForceCovector3
AngularVelocityVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > AngularVelocityVector2
SpacetimeVector< 4, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimeVector4
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Acceleration, CoordinateSystemT_ > AccelerationVector
DirectionVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > DirectionVector3
TorqueVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > TorqueVector3
VelocityVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > VelocityVector3
auto negation(const Quantities< ValuesT_, UnitsT_ > &rhs)
SpacetimeVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimeVector2
auto outerProduct(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::AngularVelocity, CoordinateSystemT_ > AngularVelocityVector
AccelerationVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > AccelerationVector3
auto cwiseProduct(const Tensor< IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_ > &lhs, const Tensor< IndicesRhsT_, QuantitiesRhsT_, CoordinateSystemRhsT_, AbsoluteRhsT_ > &rhs)
The elementwise (Hadamard) product of the components of two tensors in the same coordinate system.
DirectionVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > DirectionVector2
ForceVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > ForceVector3
Tensor< Indices< Down >, QuantityVectorT_, CoordinateSystemT_, Relative > Covector
auto operator+(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
SpacetimePoint< 2, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimePoint2
bool operator!=(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
std::ostream & operator<<(std::ostream &lhs, const Quantities< ValuesT_, UnitsT_ > &rhs)
Tensor< Indices< Up >, QuantityVectorT_, CoordinateSystemT_, Relative > Vector
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::AngularAcceleration, CoordinateSystemT_ > AngularAccelerationVector
auto operator-(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
HomogeneousPoint< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Length, CoordinateSystemT_ > PositionPoint
PositionPoint< DimensionV_, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimePoint
An event, a point in spacetime, with the time component first, in length units (x^0 = c t),...
SpacetimePoint< 4, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimePoint4
PositionVector< DimensionV_, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimeVector
A displacement in spacetime, with the time component first, in length units (x^0 = c t),...
PositionVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > PositionVector2
auto innerProduct(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
TorqueVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > TorqueVector2
AngularVelocityVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > AngularVelocityVector3
internal::AbsoluteImpl< false > Relative
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Force, CoordinateSystemT_ > ForceVector
HomogeneousVector< 1, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Time, CoordinateSystemT_ > Duration
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Length, CoordinateSystemT_ > PositionVector
Tag< FromImplementationArgsLabel > FromImplementationArgs
SpacetimeVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimeVector3
bool operator==(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
PositionPoint< 2, ValuesT_, ValueT_, CoordinateSystemT_ > PositionPoint2
auto skewSymmetricMatrix(const Tensor< IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_ > &vector)
The skew-symmetric matrix [v]x of a three-dimensional vector v, the linear map of the cross product w...
HomogeneousCovector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Force, CoordinateSystemT_ > ForceCovector
A force as a covector, the dual of a velocity: their pairing innerProduct(force, velocity) is the pow...
HomogeneousPoint< 1, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Time, CoordinateSystemT_ > TimePoint
A point in time, a one-dimensional point in a coordinate system whose origin is an epoch,...
AngularAccelerationVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > AngularAccelerationVector2
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Torque, CoordinateSystemT_ > TorqueVector
Tag< FromSimilarLabel > FromSimilar
typename CreateTypeMatrix< RowsV_, ColsV_, Types... >::type TypeMatrix
A matrix storing types at compile-time.
HomogeneousVector< 3, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Angle, CoordinateSystemT_ > RotationVector3
A rotation vector, the angle of a rotation times its unit axis, e.g. the logarithm of a rotation,...
ForceCovector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > ForceCovector2
PositionVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > PositionVector3
PositionPoint< 3, ValuesT_, ValueT_, CoordinateSystemT_ > PositionPoint3
VelocityVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > VelocityVector2
auto vectorOfSkewSymmetricMatrix(const Tensor< IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_ > &matrix)
The vector v of the skew-symmetric matrix [v]x, the inverse of skewSymmetricMatrix(): for a three-dim...
Vector< Quantities< ValuesT_< ValueT_, DimensionV_, 1 >, TypeMatrix< DimensionV_, 1, UnitT_ > >, CoordinateSystemT_ > HomogeneousVector
auto division(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const ValueRhsT_ rhs)
auto difference(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
AngularAccelerationVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > AngularAccelerationVector3
auto sum(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
ForceVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > ForceVector2
auto operator/(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const ValueRhsT_ rhs)
Tensor< Indices< Up >, QuantityVectorT_, CoordinateSystemT_, Absolute > Point
A point, or a batch of points, one per column, e.g. a point cloud.
Covector< Quantities< ValuesT_< ValueT_, 1, DimensionV_ >, TypeMatrix< 1, DimensionV_, UnitT_ > >, CoordinateSystemT_ > HomogeneousCovector
Point< Quantities< ValuesT_< ValueT_, DimensionV_, 1 >, TypeMatrix< DimensionV_, 1, UnitT_ > >, CoordinateSystemT_ > HomogeneousPoint
SpacetimePoint< 3, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimePoint3
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Velocity, CoordinateSystemT_ > VelocityVector
Type wrapper which is used to access traits partially specialized in the implementation header files.
The units for values of the arithmetic type ValueT_, e.g. double, specialized for AccessImplementatio...
Tensor< IndicesT_, typename Block< QuantitiesT_, BlockRowIdV_, BlockColIdV_, BlockRowsV_, BlockColsV_ >::type, CoordinateSystemT_, AbsoluteT_ > type
Tensor< IndicesT_, QuantitiesT_, NewCoordinateSystemT_, AbsoluteT_ > type
static constexpr int value
typename Product< AbsoluteLhsT_, AbsoluteRhsT_ >::type AbsoluteT
The cross product of a point depends on the origin, so Product<Absolute, ...> rejects it.
Tensor< typename CrossProduct< IndicesLhsT_, IndicesRhsT_ >::type, typename CrossProduct< QuantitiesLhsT_, QuantitiesRhsT_ >::type, CoordinateSystemLhsT_, AbsoluteT > type
typename Determinant< QuantitiesT_ >::type type
typename Determinant< IndicesT_ >::type IndicesT
Tensor< typename Difference< IndicesLhsT_, IndicesRhsT_ >::type, typename Difference< QuantitiesLhsT_, QuantitiesRhsT_ >::type, typename Difference< CoordinateSystemLhsT_, CoordinateSystemRhsT_ >::type, typename Difference< AbsoluteLhsT_, AbsoluteRhsT_ >::type > type
static constexpr int value
static constexpr int value
Tensor< IndicesLhsT_, typename Division< QuantitiesLhsT_, Quantities< ValuesRhsT_, UnitsRhsT_ > >::type, CoordinateSystemLhsT_, typename Division< AbsoluteLhsT_, Relative >::type > type
Tensor< typename Division< IndicesLhsT_, IndicesRhsT_ >::type, typename Division< QuantitiesLhsT_, QuantitiesRhsT_ >::type, typename Division< CoordinateSystemLhsT_, CoordinateSystemRhsT_ >::type, typename Division< AbsoluteLhsT_, AbsoluteRhsT_ >::type > type
typename Product< AbsoluteLhsT_, AbsoluteRhsT_ >::type AbsoluteT
The dot product of a point depends on the origin, so Product<Absolute, ...> rejects it.
typename DotProduct< QuantitiesLhsT_, QuantitiesRhsT_ >::type type
Tensor< IndicesT_, typename Evaluate< QuantitiesT_ >::type, CoordinateSystemT_, AbsoluteT_ > type
False for every type, so that a static_assert on it fails only when the template that names it is ins...
std::decay_t< std::tuple_element_t< 0, std::tuple< Ts... > > > first
typename IfThenElse< sizeof...(Ts)==1 &&AnyTensor< first >, FromSimilar, FromImplementationArgs >::type type
Trait to select one type or another depending on a boolean. Note that both types must be defined even...
static constexpr bool TransposeRhsV
typename InnerProduct< IndicesLhsT_, IndicesRhsT_ >::type IndicesT
static constexpr bool TransposeResultV
The product of a row and a tensor of rank 2 is a row, the product of a tensor of rank 2 and a column ...
static constexpr bool TransposeLhsV
Tensor< IndicesT, typename internal::TransposeIf< TransposeResultV >::template type< typename Evaluate< typename InnerProduct< typename internal::TransposeIf< TransposeLhsV >::template type< QuantitiesLhsT_ >, typename internal::TransposeIf< TransposeRhsV >::template type< QuantitiesRhsT_ > >::type >::type >, typename Product< CoordinateSystemLhsT_, CoordinateSystemRhsT_ >::type, typename Product< AbsoluteLhsT_, AbsoluteRhsT_ >::type > type
Tensor< IndicesT, typename Inverse< QuantitiesT_ >::type, CoordinateSystemT_, AbsoluteT > type
typename Inverse< IndicesT_ >::type IndicesT
typename Inverse< AbsoluteT_ >::type AbsoluteT
The inverse: the matrix inverse of a matrix, like Eigen's MatrixBase::inverse(), and the reciprocal o...
static constexpr bool value
Whether T is a specialization of Template.
static constexpr bool AbsoluteMatchV
static constexpr bool CoordinateSystemsMatchV
static constexpr bool value
static constexpr bool IndicesMatchV
Whether converting a From into a To passes the checks of the converting constructor of To,...
static auto make(Tensor< IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_ > object)
static auto make(Tensor< IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_ > object)
Tensor< IndicesT_, typename Negation< QuantitiesT_ >::type, CoordinateSystemT_, typename Negation< AbsoluteT_ >::type > type
The negation is performed elementwise.
static constexpr bool TransposeRhsV
Tensor< typename OuterProduct< IndicesLhsT_, IndicesRhsT_ >::type, typename OuterProduct< typename internal::TransposeIf< TransposeLhsV >::template type< QuantitiesLhsT_ >, typename internal::TransposeIf< TransposeRhsV >::template type< QuantitiesRhsT_ > >::type, typename Product< CoordinateSystemLhsT_, CoordinateSystemRhsT_ >::type, typename Product< AbsoluteLhsT_, AbsoluteRhsT_ >::type > type
static constexpr bool TransposeLhsV
static constexpr ValueT_ value()
typename Product< Tensor< IndicesRhsT_, QuantitiesRhsT_, CoordinateSystemRhsT_, AbsoluteRhsT_ >, Quantities< ValuesLhsT_, UnitsLhsT_ > >::type type
Tensor< typename Product< IndicesLhsT_, IndicesRhsT_ >::type, typename Product< QuantitiesLhsT_, QuantitiesRhsT_ >::type, typename Product< CoordinateSystemLhsT_, CoordinateSystemRhsT_ >::type, typename Product< AbsoluteLhsT_, AbsoluteRhsT_ >::type > type
Tensor< IndicesLhsT_, typename Product< QuantitiesLhsT_, Quantities< ValuesRhsT_, UnitsRhsT_ > >::type, CoordinateSystemLhsT_, typename Product< AbsoluteLhsT_, Relative >::type > type
static constexpr int value
Tensor< typename Sum< IndicesLhsT_, IndicesRhsT_ >::type, typename Sum< QuantitiesLhsT_, QuantitiesRhsT_ >::type, typename Sum< CoordinateSystemLhsT_, CoordinateSystemRhsT_ >::type, typename Sum< AbsoluteLhsT_, AbsoluteRhsT_ >::type > type
Tensor< typename Transpose< IndicesT_ >::type, typename Transpose< QuantitiesT_ >::type, CoordinateSystemT_, AbsoluteT_ > type
A matrix of the types in the std::tuple Types, row by row, of the size MatrixSizeT_,...