wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
Loading...
Searching...
No Matches
Tensor.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <ostream>
4#include <tuple>
5#include <type_traits>
6#include <utility>
7
10#include "wuzp/core/Indices.hpp"
15#include "wuzp/core/helpers.hpp"
16#include "wuzp/core/internal/skew_symmetric.hpp"
17#include "wuzp/core/traits.hpp"
18
19namespace wuzp {
20
21namespace internal {
22
26template <bool TransposeV_>
27struct TransposeIf {
28 template <typename QuantitiesT_>
29 using type = QuantitiesT_;
31 template <typename QuantitiesT_>
32 static QuantitiesT_&& value(QuantitiesT_&& quantities) {
33 return std::forward<QuantitiesT_>(quantities);
34 }
35};
36template <>
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();
43 }
44};
45
48template <typename IndicesT_, typename QuantitiesT_>
49inline constexpr bool isBatch = std::is_same_v<IndicesT_, Indices<Up>> && Cols<QuantitiesT_>::value > 1;
50
54template <typename IndicesT_, typename QuantitiesT_>
55struct RejectBatch {
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;
60};
61
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;
79};
80
81} // namespace internal
82
98template <AnyIndices IndicesT_, AnyQuantities QuantitiesT_, AnyCoordinateSystem CoordinateSystemT_, AbsoluteOrRelative AbsoluteT_>
99class Tensor {
100 public:
101 using IndicesT = IndicesT_;
102 using QuantitiesT = QuantitiesT_;
103 using CoordinateSystemT = CoordinateSystemT_;
104 using UnitsT = typename QuantitiesT::UnitsT;
105 using ValuesT = typename QuantitiesT::ValuesT;
106 using ValueT = typename QuantitiesT::ValueT;
107 using AbsoluteT = AbsoluteT_;
109
110 static_assert(IndicesT::RankV <= 2, "Tensors of rank 3 or more are not supported at the moment.");
111 // The components are stored in a canonical shape, so that the shape of a tensor follows from its indices (see Indices).
112 static_assert(IndicesT::RankV != 0 || (Rows<QuantitiesT>::value == 1 && Cols<QuantitiesT>::value == 1),
113 "A tensor of rank 0 is stored as a 1x1 matrix.");
114 static_assert(!std::is_same_v<IndicesT, Indices<Down>> || Rows<QuantitiesT>::value == 1,
115 "A covector, a tensor with one lower index, is stored as a row.");
116 static_assert(IndicesT::RankV != 2 || Rows<QuantitiesT>::value == Cols<QuantitiesT>::value,
117 "A tensor of rank 2 is stored as a square matrix.");
118 // Points have no counterpart in other ranks: e.g. a covector pairs with vectors, not with points, and an absolute scalar is a
119 // one-dimensional point (see "Points and vectors" in DESIGN.md).
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).");
122
123 Tensor() = default;
124
125 // Copies and moves are left to the implicit constructors, see CopiesOrMoves.
126 template <typename T0, typename... Ts>
128 // Allow implicit construction from similar tensors if the conversion is valid. NOLINTNEXTLINE(google-explicit-constructor)
129 explicit(!IsValidConversion<ThisT, std::remove_cvref_t<T0>, std::remove_cvref_t<Ts>...>::value) Tensor(T0&& t0, Ts&&... ts)
130 : Tensor(typename GetTag<ThisT, T0, Ts...>::type{}, std::forward<T0>(t0), std::forward<Ts>(ts)...) {}
131
132 static ThisT zero() { return ThisT(QuantitiesT::zero()); }
133 static ThisT random() { return ThisT(QuantitiesT::random()); }
134
135 template <typename ValuesOtherT_, typename UnitsOtherT_>
137 // Direct initialization checks the units, see the converting constructor of Quantities.
138 quantities_ = QuantitiesT(component);
139 }
140 const QuantitiesT& getQuantities() const& { return quantities_; }
142 QuantitiesT getQuantities() && { return std::move(quantities_); }
143
144 template <typename ValuesOtherT_>
145 void setValues(const ValuesOtherT_& values) {
146 quantities_.setValues(values);
147 }
148 const ValuesT& getValues() const& { return quantities_.getValues(); }
149 ValuesT getValues() && { return std::move(quantities_).getValues(); }
150
165 template <typename IndicesOtherT_, typename QuantitiesOtherT_, typename CoordinateSystemOtherT_, typename AbsoluteOtherT_>
167 const ValueT precision = Precision<ValueT>::value()) const {
168 // Note: Allow other tensor types to support lazy evaluation.
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);
173 }
174
175 auto getQuantity() const
176 requires(Dimension<ThisT>::value == 0)
177 {
178 return quantities_.get();
179 }
180
181 template <int RowIdV_, int ColIdV_>
182 auto getQuantity() const {
183 return quantities_.template get<RowIdV_, ColIdV_>();
184 }
185
186 // The members with a single index are defined for tensors of dimension 0 and 1. Batches of vectors and points have them too, so
187 // that they are rejected with a clear message, also those of dimension 1, e.g. of time points, stored as a row, whose single
188 // index would select a member of the batch rather than a component. getQuantity<RowIdV_, ColIdV_>() selects the component
189 // RowIdV_ of the member ColIdV_.
190
196 template <int IdV_>
197 auto getQuantity() const
198 requires(Dimension<ThisT>::value <= 1 || internal::isBatch<IndicesT, QuantitiesT>)
199 {
200 static_assert(internal::RejectBatch<IndicesT, QuantitiesT>::value);
201 return quantities_.template get<IdV_>();
202 }
203
204 auto getQuantity(const int rowId, const int colId) const { return quantities_.get(rowId, colId); }
205
208 auto getQuantity(const int id) const
209 requires(Dimension<ThisT>::value <= 1 || internal::isBatch<IndicesT, QuantitiesT>)
210 {
211 static_assert(internal::RejectBatch<IndicesT, QuantitiesT>::value);
212 return quantities_.get(id);
213 }
214
215 template <typename QuantityT_>
216 void setQuantity(const QuantityT_& quantity)
217 requires(Dimension<ThisT>::value == 0)
218 {
219 return quantities_.set(quantity);
220 }
221
222 template <int RowIdV_, int ColIdV_, typename QuantityT_>
223 void setQuantity(const QuantityT_& quantity) {
224 return quantities_.template set<RowIdV_, ColIdV_>(quantity);
225 }
226
229 template <int IdV_, typename QuantityT_>
230 void setQuantity(const QuantityT_& quantity)
231 requires(Dimension<ThisT>::value <= 1 || internal::isBatch<IndicesT, QuantitiesT>)
232 {
233 static_assert(internal::RejectBatch<IndicesT, QuantitiesT>::value);
234 quantities_.template set<IdV_>(quantity);
235 }
236
237 template <typename QuantityT_>
238 void setQuantity(const int rowId, const int colId, const QuantityT_& quantity) {
239 quantities_.set(rowId, colId, quantity);
240 }
241
244 template <typename QuantityT_>
245 void setQuantity(const int id, const QuantityT_& quantity)
246 requires(Dimension<ThisT>::value <= 1 || internal::isBatch<IndicesT, QuantitiesT>)
247 {
248 static_assert(internal::RejectBatch<IndicesT, QuantitiesT>::value);
249 quantities_.set(id, quantity);
250 }
251
252 // The member functions and operators return evaluated results (see ValuesWrapper), of the evaluated types of the traits.
253
254 template <int BlockRowIdV_, int BlockColIdV_, int BlockRowsV_, int BlockColsV_>
259
264 auto transpose() const { return typename Evaluate<typename Transpose<ThisT>::type>::type{quantities_.transpose()}; }
265
267 template <typename IndicesOtherT_, typename QuantitiesOtherT_, typename CoordinateSystemOtherT_, typename AbsoluteOtherT_>
269 using TraitT = InnerProduct<ThisT, Tensor<IndicesOtherT_, QuantitiesOtherT_, CoordinateSystemOtherT_, AbsoluteOtherT_>>;
270 return typename Evaluate<typename TraitT::type>::type{internal::TransposeIf<TraitT::TransposeResultV>::value(
271 wuzp::innerProduct(internal::TransposeIf<TraitT::TransposeLhsV>::value(quantities_),
272 internal::TransposeIf<TraitT::TransposeRhsV>::value(other.getQuantities())))};
273 }
274
278 template <typename IndicesOtherT_, typename QuantitiesOtherT_, typename CoordinateSystemOtherT_, typename AbsoluteOtherT_>
284
296 template <typename IndicesOtherT_, typename QuantitiesOtherT_, typename CoordinateSystemOtherT_, typename AbsoluteOtherT_>
302
309 auto inverse() const { return typename Evaluate<typename Inverse<ThisT>::type>::type{quantities_.inverse()}; }
310
314 auto cwiseInverse() const {
315 static_assert(std::is_same_v<typename Inverse<AbsoluteT>::type, Relative>);
316 return quantities_.cwiseInverse();
317 }
318
319 // The norms are defined for tensors of dimension 0 and 1. Batches of vectors have them too, so that they are rejected with a
320 // clear message. The norms of a point depend on the origin, so Norm<Absolute> rejects them. The norm of a vector or a covector
321 // uses the Euclidean metric, so it requires a Euclidean coordinate system (see Metric); in a Minkowski coordinate system,
322 // getInvariant() computes the interval of a vector.
323
324 auto norm() const
325 requires(Dimension<ThisT>::value <= 1 || internal::isBatch<IndicesT, QuantitiesT>)
326 {
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();
331 }
332
333 auto squaredNorm() const
334 requires(Dimension<ThisT>::value <= 1 || internal::isBatch<IndicesT, QuantitiesT>)
335 {
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();
340 }
341
346 auto determinant() const { return typename Determinant<ThisT>::type{quantities_.determinant()}; }
347
349 auto hyperdeterminant() const { static_assert(FailOnInstantiation<ThisT>::value, "Not implemented"); }
350
351 auto evaluate() const& { return typename Evaluate<ThisT>::type{quantities_.evaluate()}; }
352 auto evaluate() && { return typename Evaluate<ThisT>::type{std::move(quantities_).evaluate()}; }
353
354 private:
355 template <typename IndicesOtherT_, typename QuantitiesOtherT_, typename CoordinateSystemOtherT_, typename AbsoluteOtherT_>
356 // Allow other tensor types to support lazy evaluation.
358 : quantities_(other.getQuantities()) {
359 // The converting constructor of the quantities checks the units.
361 static_assert(ConversionT::IndicesMatchV, "Indices do not match.");
362 static_assert(ConversionT::CoordinateSystemsMatchV, "Coordinate systems do not match.");
363 // Points and vectors must not be converted into each other implicitly; use makeRelative() and makeAbsolute() instead.
364 static_assert(ConversionT::AbsoluteMatchV, "Absolute/relative mismatch.");
365 }
366
367 template <typename... Ts>
368 explicit Tensor(FromImplementationArgs /*tag*/, Ts&&... ts) : quantities_{std::forward<Ts>(ts)...} {}
369
370 QuantitiesT quantities_;
371};
372
373template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_, typename IndicesOtherT_,
374 typename QuantitiesOtherT_, typename CoordinateSystemOtherT_, typename AbsoluteOtherT_>
375struct IsValidConversion<Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>,
376 Tensor<IndicesOtherT_, QuantitiesOtherT_, CoordinateSystemOtherT_, AbsoluteOtherT_>> {
377 // The converting constructor checks these with static_asserts, which explain why a conversion fails, and the converting
378 // constructor of the quantities checks their units.
379 static constexpr bool IndicesMatchV = std::is_same_v<IndicesT_, IndicesOtherT_>;
380 static constexpr bool CoordinateSystemsMatchV = std::is_same_v<CoordinateSystemT_, CoordinateSystemOtherT_>;
381 static constexpr bool AbsoluteMatchV = std::is_same_v<AbsoluteT_, AbsoluteOtherT_>;
382 static constexpr bool value =
384};
385
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...>>>;
390};
391
392template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
393struct Dimension<Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
394 static constexpr int value = Dimension<QuantitiesT_>::value;
395};
396
397template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
398struct Rows<Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
399 static constexpr int value = Rows<QuantitiesT_>::value;
400};
401
402template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
403struct Cols<Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
404 static constexpr int value = Cols<QuantitiesT_>::value;
405};
406
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_>> {
411 using type = Tensor<typename Sum<IndicesLhsT_, IndicesRhsT_>::type, typename Sum<QuantitiesLhsT_, QuantitiesRhsT_>::type,
412 typename Sum<CoordinateSystemLhsT_, CoordinateSystemRhsT_>::type, typename Sum<AbsoluteLhsT_, AbsoluteRhsT_>::type>;
413};
414
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_>> {
419 using type = Tensor<typename Difference<IndicesLhsT_, IndicesRhsT_>::type, typename Difference<QuantitiesLhsT_, QuantitiesRhsT_>::type,
420 typename Difference<CoordinateSystemLhsT_, CoordinateSystemRhsT_>::type,
421 typename Difference<AbsoluteLhsT_, AbsoluteRhsT_>::type>;
422};
423
424template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
425struct Negation<Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
427};
428
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_>> {
435 using type =
436 Tensor<typename Product<IndicesLhsT_, IndicesRhsT_>::type, typename Product<QuantitiesLhsT_, QuantitiesRhsT_>::type,
437 typename Product<CoordinateSystemLhsT_, CoordinateSystemRhsT_>::type, typename Product<AbsoluteLhsT_, AbsoluteRhsT_>::type>;
438};
439
443template <typename IndicesLhsT_, typename QuantitiesLhsT_, typename CoordinateSystemLhsT_, typename AbsoluteLhsT_, typename ValuesRhsT_,
444 typename UnitsRhsT_>
445struct Product<Tensor<IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_>, Quantities<ValuesRhsT_, UnitsRhsT_>> {
446 static_assert(Rows<UnitsRhsT_>::value == 1 && Cols<UnitsRhsT_>::value == 1,
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>;
451};
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_>,
457};
458
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>>);
478 using type =
480 typename internal::TransposeIf<TransposeResultV>::template type<typename Evaluate<
481 typename InnerProduct<typename internal::TransposeIf<TransposeLhsV>::template type<QuantitiesLhsT_>,
482 typename internal::TransposeIf<TransposeRhsV>::template type<QuantitiesRhsT_>>::type>::type>,
483 typename Product<CoordinateSystemLhsT_, CoordinateSystemRhsT_>::type, typename Product<AbsoluteLhsT_, AbsoluteRhsT_>::type>;
484};
485
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>>;
495 using type =
497 typename OuterProduct<typename internal::TransposeIf<TransposeLhsV>::template type<QuantitiesLhsT_>,
498 typename internal::TransposeIf<TransposeRhsV>::template type<QuantitiesRhsT_>>::type,
499 typename Product<CoordinateSystemLhsT_, CoordinateSystemRhsT_>::type, typename Product<AbsoluteLhsT_, AbsoluteRhsT_>::type>;
500};
501
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;
513};
514
515template <typename IndicesLhsT_, typename QuantitiesLhsT_, typename CoordinateSystemLhsT_, typename AbsoluteLhsT_, typename IndicesRhsT_,
516 typename QuantitiesRhsT_, typename CoordinateSystemRhsT_, typename AbsoluteRhsT_>
517struct CrossProduct<Tensor<IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_>,
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;
525 typename CrossProduct<QuantitiesLhsT_, QuantitiesRhsT_>::type, CoordinateSystemLhsT_, AbsoluteT>;
526};
527
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_>> {
533 using type =
534 Tensor<typename Division<IndicesLhsT_, IndicesRhsT_>::type, typename Division<QuantitiesLhsT_, QuantitiesRhsT_>::type,
535 typename Division<CoordinateSystemLhsT_, CoordinateSystemRhsT_>::type, typename Division<AbsoluteLhsT_, AbsoluteRhsT_>::type>;
536};
537
539template <typename IndicesLhsT_, typename QuantitiesLhsT_, typename CoordinateSystemLhsT_, typename AbsoluteLhsT_, typename ValuesRhsT_,
540 typename UnitsRhsT_>
541struct Division<Tensor<IndicesLhsT_, QuantitiesLhsT_, CoordinateSystemLhsT_, AbsoluteLhsT_>, Quantities<ValuesRhsT_, UnitsRhsT_>> {
542 static_assert(Rows<UnitsRhsT_>::value == 1 && Cols<UnitsRhsT_>::value == 1,
543 "A tensor can only be divided by a scalar, a quantity or a tensor of rank 0. Use cwiseQuotient for elementwise "
544 "quotients.");
546 typename Division<AbsoluteLhsT_, Relative>::type>;
547};
548
549template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
550struct Transpose<Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
551 static_assert(internal::RejectBatch<IndicesT_, QuantitiesT_>::value);
552 // The transpose of a vector or a covector lowers or raises its index with the Euclidean metric.
553 static_assert(internal::RequireEuclidean<IndicesT_, CoordinateSystemT_>::value);
554 using type = Tensor<typename Transpose<IndicesT_>::type, typename Transpose<QuantitiesT_>::type, CoordinateSystemT_, AbsoluteT_>;
555};
556
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_>;
562};
563
565template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
566struct Inverse<Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
567 static_assert(internal::RejectBatch<IndicesT_, QuantitiesT_>::value);
568 // The absoluteness and the indices first, which reject points, vectors and covectors with a clearer message than the size of
569 // their components.
573};
574
576template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
577struct Determinant<Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
578 static_assert(internal::RejectBatch<IndicesT_, QuantitiesT_>::value);
581};
582
583template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
584struct GetCoordinateSystem<Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
585 using type = CoordinateSystemT_;
586};
587
588template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
589struct IsAbsolute<Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
590 static constexpr bool value = AbsoluteT_::value;
591};
592
594template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
595struct MakeRelative<Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
598 std::move(object).getQuantities());
599 }
600};
601
603template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
604struct MakeAbsolute<Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
607 std::move(object).getQuantities());
608 }
609};
610
611template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_, typename NewCoordinateSystemT_>
612struct CastCoordinateSystem<Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>, NewCoordinateSystemT_> {
614};
615
616template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
617struct Evaluate<Tensor<IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_>> {
618 using type = Tensor<IndicesT_, typename Evaluate<QuantitiesT_>::type, CoordinateSystemT_, AbsoluteT_>;
619};
620
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_>
635
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_>
650
651template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
656template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
660
661// The products with scalars: arithmetic values, values and quantities of size 1x1, and tensors of rank 0. The result has the
662// indices and the coordinate system of the tensor (see Product<Indices<...>, Indices<...>>). The product of a point depends on
663// the origin, so it is rejected (see Product<Absolute, Relative>).
664
667template <typename IndicesLhsT_, typename QuantitiesLhsT_, typename CoordinateSystemLhsT_, typename AbsoluteLhsT_,
668 ArithmeticValue ValueRhsT_>
670 // The scalar has the value matrix backend of the tensor.
671 return product(lhs, internal::toDimensionlessQuantity<typename QuantitiesLhsT_::ValuesT>(rhs));
672}
673template <ArithmeticValue ValueLhsT_, typename IndicesRhsT_, typename QuantitiesRhsT_, typename CoordinateSystemRhsT_,
674 typename AbsoluteRhsT_>
676 return product(rhs, lhs);
677}
678
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_>
693
694template <typename IndicesLhsT_, typename QuantitiesLhsT_, typename CoordinateSystemLhsT_, typename AbsoluteLhsT_, typename ValuesRhsT_,
695 typename UnitsRhsT_>
701template <typename ValuesLhsT_, typename UnitsLhsT_, typename IndicesRhsT_, typename QuantitiesRhsT_, typename CoordinateSystemRhsT_,
702 typename AbsoluteRhsT_>
707
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_>
719 return product(lhs, rhs);
720}
721template <ArithmeticValue ValueLhsT_, typename IndicesRhsT_, typename QuantitiesRhsT_, typename CoordinateSystemRhsT_,
722 typename AbsoluteRhsT_>
724 return product(lhs, rhs);
725}
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_,
739 typename UnitsRhsT_>
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_>
756
762template <typename IndicesLhsT_, typename QuantitiesLhsT_, typename CoordinateSystemLhsT_, typename AbsoluteLhsT_, typename IndicesRhsT_,
763 typename QuantitiesRhsT_, typename CoordinateSystemRhsT_, typename AbsoluteRhsT_>
768
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_>,
780 outerProduct(internal::TransposeIf<TraitT::TransposeLhsV>::value(lhs.getQuantities()),
781 internal::TransposeIf<TraitT::TransposeRhsV>::value(rhs.getQuantities()))};
782}
783
794template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
797 // The checks of the cross product: a single three-dimensional vector in a Euclidean coordinate system, not a point.
799 using ValueT = typename QuantitiesT_::ValueT;
800 using UnitT = typename GetType<typename GetType<QuantitiesT_>::type::UnitsT>::type;
801 using MatrixT =
803 CoordinateSystemT_, Relative>;
804 const auto& values = vector.getValues();
805 return internal::skewSymmetric<MatrixT, ValueT>(values.template get<0, 0>(), values.template get<1, 0>(), values.template get<2, 0>());
806}
807
815template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
817 static_assert(std::is_same_v<IndicesT_, Indices<Up, Down>> && Rows<QuantitiesT_>::value == 3,
818 "The vector of a skew-symmetric matrix is only defined for three-dimensional linear maps, tensors with an upper and a "
819 "lower index.");
820 using ValueT = typename QuantitiesT_::ValueT;
821 const auto [first, second, third] = internal::vectorOfSkewSymmetricPart(matrix.getQuantities());
822 using UnitsT = TypeMatrixImpl<MatrixSize<3, 1>, std::tuple<typename GetType<typename decltype(first)::UnitsT>::type,
823 typename GetType<typename decltype(second)::UnitsT>::type,
824 typename GetType<typename decltype(third)::UnitsT>::type>>;
826 CoordinateSystemT_, Relative>;
827 // The checks of the cross product, e.g. a Euclidean coordinate system.
829 return VectorT{typename VectorT::QuantitiesT{first, second, third}};
830}
831
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>);
844 return product(lhs.getQuantities(), rhs.getQuantities());
845}
846
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>);
855 return division(lhs.getQuantities(), rhs.getQuantities());
856}
857
858// The quotients by scalars: arithmetic values, values and quantities of size 1x1, and tensors of rank 0 (see
859// Division<Indices<...>, Indices<...>>).
860
862template <typename IndicesLhsT_, typename QuantitiesLhsT_, typename CoordinateSystemLhsT_, typename AbsoluteLhsT_,
863 ArithmeticValue ValueRhsT_>
865 // The scalar has the value matrix backend of the tensor.
866 return division(lhs, internal::toDimensionlessQuantity<typename QuantitiesLhsT_::ValuesT>(rhs));
867}
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_,
877 typename UnitsRhsT_>
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_>
894 return division(lhs, rhs);
895}
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_,
903 typename UnitsRhsT_>
908template <typename IndicesLhsT_, typename QuantitiesLhsT_, typename CoordinateSystemLhsT_, typename AbsoluteLhsT_, typename IndicesRhsT_,
909 typename QuantitiesRhsT_, typename CoordinateSystemRhsT_, typename AbsoluteRhsT_>
914
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.");
922 return lhs.getQuantities() == rhs.getQuantities();
923}
924
925template <typename IndicesLhsT_, typename QuantitiesLhsT_, typename CoordinateSystemLhsT_, typename AbsoluteLhsT_, typename IndicesRhsT_,
926 typename QuantitiesRhsT_, typename CoordinateSystemRhsT_, typename AbsoluteRhsT_>
931
932template <typename IndicesT_, typename QuantitiesT_, typename CoordinateSystemT_, typename AbsoluteT_>
934 lhs << rhs.getQuantities();
935 return lhs;
936}
937
938// The aliases with a value matrix backend, e.g. HomogeneousVector<3, wuzp_eigen::ValueMatrix, double, Length, CoordinateSystemT_>,
939// take it as its alias template ValueMatrix (AnyValueMatrix).
940
941template <typename QuantityVectorT_, typename CoordinateSystemT_>
942using Vector = Tensor<Indices<Up>, QuantityVectorT_, CoordinateSystemT_, Relative>;
943template <int DimensionV_, template <typename, int, int> typename ValuesT_, typename ValueT_, typename UnitT_, typename CoordinateSystemT_>
946
947template <typename QuantityVectorT_, typename CoordinateSystemT_>
948using Covector = Tensor<Indices<Down>, QuantityVectorT_, CoordinateSystemT_, Relative>;
949template <int DimensionV_, template <typename, int, int> typename ValuesT_, typename ValueT_, typename UnitT_, typename CoordinateSystemT_>
952
959template <typename QuantityVectorT_, typename CoordinateSystemT_>
960using Point = Tensor<Indices<Up>, QuantityVectorT_, CoordinateSystemT_, Absolute>;
961template <int DimensionV_, template <typename, int, int> typename ValuesT_, typename ValueT_, typename UnitT_, typename CoordinateSystemT_>
964
965template <int DimensionV_, template <typename, int, int> typename ValuesT_, typename ValueT_, typename CoordinateSystemT_>
966using DirectionVector = HomogeneousVector<DimensionV_, ValuesT_, ValueT_,
967 typename AccessUnits<AccessImplementation<ValueT_>>::Dimensionless, CoordinateSystemT_>;
968template <template <typename, int, int> typename ValuesT_, typename ValueT_, typename CoordinateSystemT_>
970template <template <typename, int, int> typename ValuesT_, typename ValueT_, typename CoordinateSystemT_>
972
979template <template <typename, int, int> typename ValuesT_, typename ValueT_, typename CoordinateSystemT_>
982
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_>
990
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_>
998
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_>
1006
1007template <int DimensionV_, template <typename, int, int> typename ValuesT_, typename ValueT_, typename CoordinateSystemT_>
1008using AccelerationVector = HomogeneousVector<DimensionV_, ValuesT_, ValueT_,
1009 typename AccessUnits<AccessImplementation<ValueT_>>::Acceleration, CoordinateSystemT_>;
1010template <template <typename, int, int> typename ValuesT_, typename ValueT_, typename CoordinateSystemT_>
1012template <template <typename, int, int> typename ValuesT_, typename ValueT_, typename CoordinateSystemT_>
1014
1015template <int DimensionV_, template <typename, int, int> typename ValuesT_, typename ValueT_, typename CoordinateSystemT_>
1016using AngularVelocityVector = HomogeneousVector<DimensionV_, ValuesT_, ValueT_,
1017 typename AccessUnits<AccessImplementation<ValueT_>>::AngularVelocity, CoordinateSystemT_>;
1018template <template <typename, int, int> typename ValuesT_, typename ValueT_, typename CoordinateSystemT_>
1020template <template <typename, int, int> typename ValuesT_, typename ValueT_, typename CoordinateSystemT_>
1022
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_>
1031
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_>
1039
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_>
1055
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_>
1063
1066template <template <typename, int, int> typename ValuesT_, typename ValueT_, typename CoordinateSystemT_>
1068
1069template <template <typename, int, int> typename ValuesT_, typename ValueT_, typename CoordinateSystemT_>
1071
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_>
1100
1101} // namespace wuzp
Container to store quantities.
A tensor of rank 0, 1 or 2, whose components are quantities, expressed in a coordinate system,...
Definition Tensor.hpp:99
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: ...
Definition Tensor.hpp:279
auto innerProduct(const Tensor< IndicesOtherT_, QuantitiesOtherT_, CoordinateSystemOtherT_, AbsoluteOtherT_ > &other) const
The inner product, see innerProduct().
Definition Tensor.hpp:268
const ValuesT & getValues() const &
Definition Tensor.hpp:148
auto evaluate() &&
Definition Tensor.hpp:352
void setQuantity(const QuantityT_ &quantity)
Sets the component with the single index IdV_ of a vector, a point or a covector, e....
Definition Tensor.hpp:230
const QuantitiesT & getQuantities() const &
Definition Tensor.hpp:140
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,...
Definition Tensor.hpp:346
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_...
Definition Tensor.hpp:245
QuantitiesT_ QuantitiesT
Definition Tensor.hpp:102
typename QuantitiesT::ValueT ValueT
Definition Tensor.hpp:106
auto inverse() const
The matrix inverse of a tensor of rank 0 or 2, like Eigen's MatrixBase::inverse(): e....
Definition Tensor.hpp:309
void setQuantity(const int rowId, const int colId, const QuantityT_ &quantity)
Definition Tensor.hpp:238
QuantitiesT getQuantities() &&
The quantities of a temporary are moved out of it, which avoids a copy and does not refer to the dest...
Definition Tensor.hpp:142
ValuesT getValues() &&
Definition Tensor.hpp:149
typename QuantitiesT::ValuesT ValuesT
Definition Tensor.hpp:105
CoordinateSystemT_ CoordinateSystemT
Definition Tensor.hpp:103
auto hyperdeterminant() const
Not implemented. The return type is deduced, so that the message is the first error (see FailOnInstan...
Definition Tensor.hpp:349
static ThisT random()
Definition Tensor.hpp:133
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...
Definition Tensor.hpp:297
void setQuantities(const Quantities< ValuesOtherT_, UnitsOtherT_ > &component)
Definition Tensor.hpp:136
static ThisT zero()
Definition Tensor.hpp:132
void setQuantity(const QuantityT_ &quantity)
Definition Tensor.hpp:216
auto squaredNorm() const
Definition Tensor.hpp:333
auto getQuantity() const
Definition Tensor.hpp:182
auto getQuantity(const int rowId, const int colId) const
Definition Tensor.hpp:204
AbsoluteT_ AbsoluteT
Definition Tensor.hpp:107
auto norm() const
Definition Tensor.hpp:324
IndicesT_ IndicesT
Definition Tensor.hpp:101
auto getQuantity(const int id) const
The component with the single index id of a vector, a point or a covector, like getQuantity<IdV_>(),...
Definition Tensor.hpp:208
Tensor()=default
Tensor< IndicesT, QuantitiesT, CoordinateSystemT, AbsoluteT > ThisT
Definition Tensor.hpp:108
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...
Definition Tensor.hpp:166
auto evaluate() const &
Definition Tensor.hpp:351
auto getQuantity() const
The component with the single index IdV_ of a vector, a point or a covector, e.g. velocity....
Definition Tensor.hpp:197
auto block() const
Definition Tensor.hpp:255
void setValues(const ValuesOtherT_ &values)
Definition Tensor.hpp:145
auto cwiseInverse() const
The elementwise reciprocal of the components, like Eigen's ArrayBase::inverse().
Definition Tensor.hpp:314
auto transpose() const
The transpose of the matrix of the components: a vector becomes a covector and vice versa,...
Definition Tensor.hpp:264
typename QuantitiesT::UnitsT UnitsT
Definition Tensor.hpp:104
auto getQuantity() const
Definition Tensor.hpp:175
void setQuantity(const QuantityT_ &quantity)
Definition Tensor.hpp:223
Wrapper for the actual implementation of a value container.
Any tensor: a specialization of Tensor, including points, vectors and their aliases.
Definition concepts.hpp:118
The alias template ValueMatrix<ValueT_, RowsV_, ColsV_> of any value matrix backend,...
Definition concepts.hpp:89
Whether constructing a Class from the arguments copies or moves it, i.e. whether they are a single Cl...
Definition helpers.hpp:69
A coordinate system with the Minkowski metric, e.g. CoordinateSystem<Spacetime, Minkowski>: an inerti...
Definition concepts.hpp:40
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Dimensionless, CoordinateSystemT_ > DirectionVector
Definition Tensor.hpp:966
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,...
Definition Tensor.hpp:851
internal::AbsoluteImpl< true > Absolute
Definition Absolute.hpp:17
auto operator*(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const ValueRhsT_ rhs)
AccelerationVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > AccelerationVector2
Definition Tensor.hpp:1011
auto product(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const ValueRhsT_ rhs)
ForceCovector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > ForceCovector3
Definition Tensor.hpp:1054
AngularVelocityVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > AngularVelocityVector2
Definition Tensor.hpp:1019
SpacetimeVector< 4, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimeVector4
Definition Tensor.hpp:1099
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Acceleration, CoordinateSystemT_ > AccelerationVector
Definition Tensor.hpp:1008
DirectionVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > DirectionVector3
Definition Tensor.hpp:971
TorqueVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > TorqueVector3
Definition Tensor.hpp:1062
VelocityVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > VelocityVector3
Definition Tensor.hpp:1005
auto negation(const Quantities< ValuesT_, UnitsT_ > &rhs)
SpacetimeVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimeVector2
Definition Tensor.hpp:1095
auto outerProduct(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::AngularVelocity, CoordinateSystemT_ > AngularVelocityVector
Definition Tensor.hpp:1016
AccelerationVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > AccelerationVector3
Definition Tensor.hpp:1013
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.
Definition Tensor.hpp:840
DirectionVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > DirectionVector2
Definition Tensor.hpp:969
ForceVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > ForceVector3
Definition Tensor.hpp:1038
Tensor< Indices< Down >, QuantityVectorT_, CoordinateSystemT_, Relative > Covector
Definition Tensor.hpp:948
auto operator+(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
SpacetimePoint< 2, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimePoint2
Definition Tensor.hpp:1081
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
Definition Tensor.hpp:942
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::AngularAcceleration, CoordinateSystemT_ > AngularAccelerationVector
Definition Tensor.hpp:1024
auto operator-(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
HomogeneousPoint< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Length, CoordinateSystemT_ > PositionPoint
Definition Tensor.hpp:984
PositionPoint< DimensionV_, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimePoint
An event, a point in spacetime, with the time component first, in length units (x^0 = c t),...
Definition Tensor.hpp:1079
SpacetimePoint< 4, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimePoint4
Definition Tensor.hpp:1085
PositionVector< DimensionV_, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimeVector
A displacement in spacetime, with the time component first, in length units (x^0 = c t),...
Definition Tensor.hpp:1093
PositionVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > PositionVector2
Definition Tensor.hpp:995
auto innerProduct(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
TorqueVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > TorqueVector2
Definition Tensor.hpp:1060
AngularVelocityVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > AngularVelocityVector3
Definition Tensor.hpp:1021
internal::AbsoluteImpl< false > Relative
Definition Absolute.hpp:18
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Force, CoordinateSystemT_ > ForceVector
Definition Tensor.hpp:1033
HomogeneousVector< 1, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Time, CoordinateSystemT_ > Duration
Definition Tensor.hpp:1070
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Length, CoordinateSystemT_ > PositionVector
Definition Tensor.hpp:992
Tag< FromImplementationArgsLabel > FromImplementationArgs
Definition traits.hpp:41
SpacetimeVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimeVector3
Definition Tensor.hpp:1097
bool operator==(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
PositionPoint< 2, ValuesT_, ValueT_, CoordinateSystemT_ > PositionPoint2
Definition Tensor.hpp:987
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...
Definition Tensor.hpp:795
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...
Definition Tensor.hpp:1049
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,...
Definition Tensor.hpp:1067
AngularAccelerationVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > AngularAccelerationVector2
Definition Tensor.hpp:1028
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Torque, CoordinateSystemT_ > TorqueVector
Definition Tensor.hpp:1057
Tag< FromSimilarLabel > FromSimilar
Definition traits.hpp:37
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,...
Definition Tensor.hpp:980
ForceCovector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > ForceCovector2
Definition Tensor.hpp:1052
PositionVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > PositionVector3
Definition Tensor.hpp:997
PositionPoint< 3, ValuesT_, ValueT_, CoordinateSystemT_ > PositionPoint3
Definition Tensor.hpp:989
VelocityVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > VelocityVector2
Definition Tensor.hpp:1003
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...
Definition Tensor.hpp:816
Vector< Quantities< ValuesT_< ValueT_, DimensionV_, 1 >, TypeMatrix< DimensionV_, 1, UnitT_ > >, CoordinateSystemT_ > HomogeneousVector
Definition Tensor.hpp:945
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
Definition Tensor.hpp:1030
auto sum(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const Quantities< ValuesRhsT_, UnitsRhsT_ > &rhs)
ForceVector< 2, ValuesT_, ValueT_, CoordinateSystemT_ > ForceVector2
Definition Tensor.hpp:1036
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.
Definition Tensor.hpp:960
Covector< Quantities< ValuesT_< ValueT_, 1, DimensionV_ >, TypeMatrix< 1, DimensionV_, UnitT_ > >, CoordinateSystemT_ > HomogeneousCovector
Definition Tensor.hpp:951
Point< Quantities< ValuesT_< ValueT_, DimensionV_, 1 >, TypeMatrix< DimensionV_, 1, UnitT_ > >, CoordinateSystemT_ > HomogeneousPoint
Definition Tensor.hpp:963
SpacetimePoint< 3, ValuesT_, ValueT_, CoordinateSystemT_ > SpacetimePoint3
Definition Tensor.hpp:1083
HomogeneousVector< DimensionV_, ValuesT_, ValueT_, typename AccessUnits< AccessImplementation< ValueT_ > >::Velocity, CoordinateSystemT_ > VelocityVector
Definition Tensor.hpp:1000
Type wrapper which is used to access traits partially specialized in the implementation header files.
Definition helpers.hpp:114
The units for values of the arithmetic type ValueT_, e.g. double, specialized for AccessImplementatio...
Definition traits.hpp:338
Tensor< IndicesT_, typename Block< QuantitiesT_, BlockRowIdV_, BlockColIdV_, BlockRowsV_, BlockColsV_ >::type, CoordinateSystemT_, AbsoluteT_ > type
Definition Tensor.hpp:560
typename Product< AbsoluteLhsT_, AbsoluteRhsT_ >::type AbsoluteT
The cross product of a point depends on the origin, so Product<Absolute, ...> rejects it.
Definition Tensor.hpp:523
Tensor< typename CrossProduct< IndicesLhsT_, IndicesRhsT_ >::type, typename CrossProduct< QuantitiesLhsT_, QuantitiesRhsT_ >::type, CoordinateSystemLhsT_, AbsoluteT > type
Definition Tensor.hpp:524
Tensor< typename Difference< IndicesLhsT_, IndicesRhsT_ >::type, typename Difference< QuantitiesLhsT_, QuantitiesRhsT_ >::type, typename Difference< CoordinateSystemLhsT_, CoordinateSystemRhsT_ >::type, typename Difference< AbsoluteLhsT_, AbsoluteRhsT_ >::type > type
Definition Tensor.hpp:419
static constexpr int value
Definition traits.hpp:70
Tensor< IndicesLhsT_, typename Division< QuantitiesLhsT_, Quantities< ValuesRhsT_, UnitsRhsT_ > >::type, CoordinateSystemLhsT_, typename Division< AbsoluteLhsT_, Relative >::type > type
Definition Tensor.hpp:545
Tensor< typename Division< IndicesLhsT_, IndicesRhsT_ >::type, typename Division< QuantitiesLhsT_, QuantitiesRhsT_ >::type, typename Division< CoordinateSystemLhsT_, CoordinateSystemRhsT_ >::type, typename Division< AbsoluteLhsT_, AbsoluteRhsT_ >::type > type
Definition Tensor.hpp:533
typename Product< AbsoluteLhsT_, AbsoluteRhsT_ >::type AbsoluteT
The dot product of a point depends on the origin, so Product<Absolute, ...> rejects it.
Definition Tensor.hpp:511
Tensor< IndicesT_, typename Evaluate< QuantitiesT_ >::type, CoordinateSystemT_, AbsoluteT_ > type
Definition Tensor.hpp:618
std::decay_t< T > type
Definition traits.hpp:224
False for every type, so that a static_assert on it fails only when the template that names it is ins...
Definition helpers.hpp:21
std::decay_t< std::tuple_element_t< 0, std::tuple< Ts... > > > first
Definition Tensor.hpp:388
typename IfThenElse< sizeof...(Ts)==1 &&AnyTensor< first >, FromSimilar, FromImplementationArgs >::type type
Definition Tensor.hpp:389
Trait to select one type or another depending on a boolean. Note that both types must be defined even...
Definition helpers.hpp:51
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 ...
Definition Tensor.hpp:477
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
Definition Tensor.hpp:478
Tensor< IndicesT, typename Inverse< QuantitiesT_ >::type, CoordinateSystemT_, AbsoluteT > type
Definition Tensor.hpp:572
The inverse: the matrix inverse of a matrix, like Eigen's MatrixBase::inverse(), and the reciprocal o...
Definition traits.hpp:188
Whether T is a specialization of Template.
Definition helpers.hpp:74
Whether converting a From into a To passes the checks of the converting constructor of To,...
Definition traits.hpp:265
static auto make(Tensor< IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_ > object)
Definition Tensor.hpp:605
static auto make(Tensor< IndicesT_, QuantitiesT_, CoordinateSystemT_, AbsoluteT_ > object)
Definition Tensor.hpp:596
Tensor< IndicesT_, typename Negation< QuantitiesT_ >::type, CoordinateSystemT_, typename Negation< AbsoluteT_ >::type > type
Definition Tensor.hpp:426
The negation is performed elementwise.
Definition traits.hpp:101
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
Definition Tensor.hpp:495
static constexpr ValueT_ value()
Definition traits.hpp:356
typename Product< Tensor< IndicesRhsT_, QuantitiesRhsT_, CoordinateSystemRhsT_, AbsoluteRhsT_ >, Quantities< ValuesLhsT_, UnitsLhsT_ > >::type type
Definition Tensor.hpp:455
Tensor< typename Product< IndicesLhsT_, IndicesRhsT_ >::type, typename Product< QuantitiesLhsT_, QuantitiesRhsT_ >::type, typename Product< CoordinateSystemLhsT_, CoordinateSystemRhsT_ >::type, typename Product< AbsoluteLhsT_, AbsoluteRhsT_ >::type > type
Definition Tensor.hpp:435
Tensor< IndicesLhsT_, typename Product< QuantitiesLhsT_, Quantities< ValuesRhsT_, UnitsRhsT_ > >::type, CoordinateSystemLhsT_, typename Product< AbsoluteLhsT_, Relative >::type > type
Definition Tensor.hpp:449
Tensor< typename Sum< IndicesLhsT_, IndicesRhsT_ >::type, typename Sum< QuantitiesLhsT_, QuantitiesRhsT_ >::type, typename Sum< CoordinateSystemLhsT_, CoordinateSystemRhsT_ >::type, typename Sum< AbsoluteLhsT_, AbsoluteRhsT_ >::type > type
Definition Tensor.hpp:411
Tensor< typename Transpose< IndicesT_ >::type, typename Transpose< QuantitiesT_ >::type, CoordinateSystemT_, AbsoluteT_ > type
Definition Tensor.hpp:554
A matrix of the types in the std::tuple Types, row by row, of the size MatrixSizeT_,...