Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
NumTraits.hpp File Reference

Scalar-type concepts and per-scalar numeric traits (limits, precision, related types). More...

Classes

struct  mundy::is_passive_scalar< T >
 Whether T is a real scalar that carries no derivatives: arithmetic types, plus custom types that opt in. More...
struct  mundy::is_autodiff_scalar< T >
 Whether T is a forward-mode autodiff scalar: a value plus derivatives. More...
struct  mundy::GenericNumTraits< T >
 Numeric traits for an arithmetic scalar type; the reusable base NumTraits forwards to. More...
struct  mundy::NumTraits< T >
 Numeric traits for a scalar-like type T. More...
struct  mundy::NumTraits< float >
 float traits; nonzero fuzzy-comparison precision. More...
struct  mundy::NumTraits< double >
 double traits; nonzero fuzzy-comparison precision. More...
struct  mundy::NumTraits< long double >
 long double traits; nonzero fuzzy-comparison precision. More...

Namespaces

namespace  mundy

Concepts

concept  mundy::ValidScalarType
 Concept satisfied by any type that is a mathematical scalar. It is a single value closed under +, -, *, /, unary - and constructible from a numeric literal.

Variables

Scalar kinds
template<typename T>
constexpr bool mundy::is_passive_scalar_v = is_passive_scalar<std::remove_cv_t<T>>::value
template<typename T>
constexpr bool mundy::is_autodiff_scalar_v = is_autodiff_scalar<std::remove_cv_t<T>>::value

Detailed Description

A pure traits header: it describes a scalar type and performs no arithmetic. A custom scalar (e.g. an autodiff dual) becomes usable across MundyMath by satisfying ValidScalarType and specializing NumTraits<T> with the member set shown in GenericNumTraits.