wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
Loading...
Searching...
No Matches
traits.hpp File Reference
#include <type_traits>
#include <utility>
#include "wuzp/core/helpers.hpp"

Go to the source code of this file.

Classes

struct  wuzp::Tag< Label >
struct  wuzp::FromSimilarLabel
struct  wuzp::FromImplementationLabel
struct  wuzp::FromImplementationArgsLabel
struct  wuzp::GetTypes< T >
struct  wuzp::GetType< T >
struct  wuzp::GetValue< T >
struct  wuzp::Rows< T >
struct  wuzp::Cols< T >
struct  wuzp::Dimension< T >
struct  wuzp::Comparison< Lhs, Rhs >
struct  wuzp::Sum< ValueType< Lhs >, ValueType< Rhs > >
 The sum is performed elementwise. More...
struct  wuzp::Difference< ValueType< Lhs >, ValueType< Rhs > >
 The difference is performed elementwise. More...
struct  wuzp::Negation< Rhs >
 The negation is performed elementwise. More...
struct  wuzp::Product< ValueType< Lhs >, ValueType< Rhs > >
 The product is performed elementwise. More...
struct  wuzp::DotProduct< Lhs, Rhs >
struct  wuzp::CrossProduct< Lhs, Rhs >
struct  wuzp::Division< ValueType< Lhs >, ValueType< Rhs > >
 The division is performed elementwise. More...
struct  wuzp::Power< T, ExponentT_ >
struct  wuzp::Transpose< T >
struct  wuzp::Element< Object, ElementRowIdV_, ElementColIdV_ >
struct  wuzp::Block< Object, BlockRowIdV_, BlockColIdV_, BlockRowsV_, BlockColsV_ >
struct  wuzp::Norm< T >
struct  wuzp::SquaredNorm< T >
struct  wuzp::Determinant< T >
struct  wuzp::Inverse< T >
 The inverse: the matrix inverse of a matrix, like Eigen's MatrixBase::inverse(), and the reciprocal of a single unit or number. More...
struct  wuzp::CwiseInverse< T >
 The elementwise reciprocal of a matrix, like Eigen's ArrayBase::inverse() or cwiseInverse(). More...
struct  wuzp::CwiseFunction< T, FunctionT_ >
 A function applied to every element of a matrix, like Eigen's DenseBase::unaryExpr(): value(impl, function) returns the matrix of the results. More...
struct  wuzp::Identity< T >
struct  wuzp::Zero< T >
struct  wuzp::Random< T >
struct  wuzp::Evaluate< T >
struct  wuzp::Copy< T >
 Copies a matrix of a value matrix backend: value returns the copy, which must not share its values with the original. More...
struct  wuzp::Move< T >
 Moves a matrix of a value matrix backend: construct returns the moved matrix, assign moves it into another one. More...
struct  wuzp::IsValidConversion< To, From >
 Whether converting a From into a To passes the checks of the converting constructor of To, e.g. whether the units of two quantity matrices match. More...
struct  wuzp::IsAbsolute< T >
struct  wuzp::MakeRelative< T >
struct  wuzp::MakeAbsolute< T >
struct  wuzp::GetCoordinateSystem< T >
struct  wuzp::CastCoordinateSystem< T, NewCoordinateSystemT_ >
struct  wuzp::Coefficient< T >
 Element access of a matrix of a value matrix backend: get(impl, row, col) returns an element, set(impl, row, col, value) sets it. More...
struct  wuzp::Rebind< T, ValueT_, RowsV_, ColsV_ >
 The evaluated type of another value type and size, of the same backend as T: e.g. the 1x1 values of a scalar that an operation combines with values of the type T. More...
struct  wuzp::AccessUnits< UnitT_ >
 The units for values of the arithmetic type ValueT_, e.g. double, specialized for AccessImplementation<ValueT_> by the units backend, e.g. Length and Force (see UnitSystem in concepts.hpp). More...
struct  wuzp::Precision< ValueT_ >
 The default precision of isApprox() for values of the type ValueT_, which compares relatively: 1e-12 for double and 1e-5 for float. More...
struct  wuzp::Precision< float >
struct  wuzp::Precision< double >
struct  wuzp::Precision< long double >

Namespaces

namespace  wuzp

Macros

#define WUZP_DEFINE_RECURSIVE_TRAIT_IMPL(Name, NameStr)
#define WUZP_DEFINE_RECURSIVE_TRAIT(Name)

Typedefs

using wuzp::FromSimilar = Tag<FromSimilarLabel>
using wuzp::FromImplementation = Tag<FromImplementationLabel>
using wuzp::FromImplementationArgs = Tag<FromImplementationArgsLabel>

Functions

template<typename Lhs, typename Rhs>
auto wuzp::sum (const Lhs &lhs, const Rhs &rhs)
template<typename Lhs, typename Rhs>
auto wuzp::difference (const Lhs &lhs, const Rhs &rhs)
template<typename Rhs>
auto wuzp::negation (const Rhs &rhs)
template<typename Lhs, typename Rhs>
auto wuzp::product (const Lhs &lhs, const Rhs &rhs)
template<typename Lhs, typename Rhs>
auto wuzp::innerProduct (const Lhs &lhs, const Rhs &rhs)
template<typename Lhs, typename Rhs>
auto wuzp::outerProduct (const Lhs &lhs, const Rhs &rhs)
template<typename Lhs, typename Rhs>
auto wuzp::dotProduct (const Lhs &lhs, const Rhs &rhs)
template<typename Lhs, typename Rhs>
auto wuzp::crossProduct (const Lhs &lhs, const Rhs &rhs)
template<typename Lhs, typename Rhs>
auto wuzp::division (const Lhs &lhs, const Rhs &rhs)
template<typename T>
auto wuzp::makeRelative (T t)
 The vector from the origin of the coordinate system to a point, p - o: the same components, as a relative object.
template<typename T>
auto wuzp::makeAbsolute (T t)
 The point at a vector from the origin of the coordinate system, o + v: the same components, as an absolute object.
template<typename To, typename T>
auto wuzp::castCoordinateSystem (T t)

Macro Definition Documentation

◆ WUZP_DEFINE_RECURSIVE_TRAIT

#define WUZP_DEFINE_RECURSIVE_TRAIT ( Name)
Value:
#define WUZP_DEFINE_RECURSIVE_TRAIT_IMPL(Name, NameStr)
Definition traits.hpp:12

Definition at line 29 of file traits.hpp.

◆ WUZP_DEFINE_RECURSIVE_TRAIT_IMPL

#define WUZP_DEFINE_RECURSIVE_TRAIT_IMPL ( Name,
NameStr )
Value:
template <typename... Ts> \
struct Name; \
template <typename T0> \
struct Name<T0> { \
using type = T0; \
}; \
template <typename T0, typename T1> \
struct Name<T0, T1> { \
\
static_assert(FailOnInstantiation<Name<T0, T1>>::value, "'" NameStr "' trait not specialized for given type."); \
}; \
template <typename T0, typename T1, typename T2, typename... Ts> \
struct Name<T0, T1, T2, Ts...> { \
\
using type = typename Name<typename Name<T0, T1>::type, T2, Ts...>::type; \
};

Definition at line 12 of file traits.hpp.