|
OpenKalman
|
Definition for values::abs. More...
Namespaces | |
| internal | |
| Definition of utilities for atan functions. | |
Classes | |
| struct | consteval_operation |
| An operation involving some number of values. More... | |
| struct | fixed_2pi |
| A fixed version of 2*pi. More... | |
| struct | fixed_cast |
| A fixed value cast from another fixed value. More... | |
| struct | fixed_half_pi |
| A fixed version of pi/2. More... | |
| struct | fixed_minus_half_pi |
| A fixed version of -pi/2. More... | |
| struct | fixed_minus_pi |
| A fixed version of -pi. More... | |
| struct | fixed_partial_ordering_equivalent |
| A fixed version of std::partial_ordering::equivalent. More... | |
| struct | fixed_partial_ordering_greater |
| A fixed version of std::partial_ordering::greater. More... | |
| struct | fixed_partial_ordering_less |
| A fixed version of std::partial_ordering::less. More... | |
| struct | fixed_partial_ordering_unordered |
| A fixed version of std::partial_ordering::unordered. More... | |
| struct | fixed_pi |
| A fixed version of pi. More... | |
| struct | fixed_value |
| struct | fixed_value_of |
| The fixed value associated with a fixed. More... | |
| struct | fixed_value_of< T, std::enable_if_t< fixed< T > > > |
| struct | real_type_of |
| Obtain the real type associated with a value (typically a complex number). More... | |
| struct | real_type_of< T, std::enable_if_t< value< T > > > |
| struct | unbounded_size_t |
| A type reflecting an unbound size. More... | |
| struct | value_type_of |
| Obtain the underlying value type associated with a value. More... | |
| struct | value_type_of< T, std::void_t< decltype(to_value_type(std::declval< T >()))> > |
Typedefs | |
| template<typename Operation , typename... Args> | |
| using | operation_t = decltype(operation(std::declval< Operation && >(), std::declval< Args && >()...)) |
| The resulting type from an values::operation. | |
| template<typename T > | |
| using | real_type_of_t = typename real_type_of< T >::type |
| Helper template for real_type_of. | |
| template<typename T > | |
| using | value_type_of_t = typename value_type_of< T >::type |
| Helper template for value_type_of. | |
Functions | |
| template<typename T , std::enable_if_t< fixed< T > and not complex< T >, int > = 0> | |
| fixed_value (const T &) -> fixed_value< typename fixed_value_of< T >::value_type, values::real(fixed_value_of_v< T >), values::imag(fixed_value_of_v< T >)> | |
| template<typename T , typename Arg , std::enable_if_t<(not number< T > or not complex< Arg >) and std::is_same_v< T, std::decay_t< T >> and detail::value_type_convertible< Arg, T >::value, int > = 0> | |
| decltype(auto) constexpr | cast_to (Arg &&arg) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename Operation , typename... Args> | |
| consteval_operation (const Operation &, const Args &...) -> consteval_operation< Operation, Args... > | |
| Deduction guide. | |
| template<typename Operation , typename... Args> | |
| constexpr auto | operation (Operation &&op, Args &&...args) |
| A potentially constant-evaluated operation involving some number of values. More... | |
| template<typename Arg > | |
| decltype(auto) constexpr | to_value_type (Arg &&arg) |
| Convert, if necessary, a fixed or dynamic value to its underlying base type. | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | abs (const Arg &arg) |
| A constexpr alternative to std::abs. | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | acos (const Arg &arg) |
| Constexpr alternative to the std::acos function. | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | acosh (const Arg &arg) |
| Constexpr alternative to the std::acosh function. | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | asin (const Arg &arg) |
| Constexpr alternative to the std::asin function. | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | asinh (const Arg &arg) |
| Constexpr alternative to the std::asinh function. | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | atan (const Arg &arg) |
| Constexpr alternative to the std::atan function. | |
| template<typename Y , typename X , std::enable_if_t< value< Y > and value< X >, int > = 0> | |
| constexpr auto | atan2 (const Y &y_arg, const X &x_arg) |
| Constexpr alternative to the std::atan2 function. More... | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | atanh (const Arg &arg) |
| Constexpr alternative to the std::atanh function. | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | conj (const Arg &arg) |
| A constexpr function for the complex conjugate of a (complex) number. | |
| template<typename Mag , typename Sgn > | |
| constexpr auto | copysign (const Mag &mag, const Sgn &sgn) |
| A constexpr function for copysign. More... | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | cos (const Arg &arg) |
| Constexpr alternative to the std::cos function. | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | cosh (const Arg &arg) |
| Constexpr alternative to the std::cosh function. | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | exp (const Arg &arg) |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | expm1 (const Arg &arg) |
| Constexpr alternative to the std::expm1 function (exponential function minus 1). More... | |
| template<typename X , typename Y > | |
| constexpr auto | fmod (const X &x, const Y &y) |
| A constexpr function for fmod. More... | |
| template<typename... Args, std::enable_if_t<(... and value< Args >) and(sizeof...(Args) > 0> | |
| constexpr auto | hypot (const Args &...args) |
| A constexpr alternative to std::hypot. More... | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | imag (const Arg &arg) |
| A constexpr function to obtain the imaginary part of a (complex) number. More... | |
| template<typename Arg > | |
| constexpr bool | isinf (const Arg &arg) |
| Constexpr alternative to std::isinf. More... | |
| template<typename Arg > | |
| constexpr bool | isnan (const Arg &arg) |
| Constexpr alternative to std::isnan. More... | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | log (const Arg &arg) |
| Constexpr alternative to the std::log function. | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | log1p (const Arg &arg) |
| Constexpr alternative to the std::log1p function, where log1p(x) = log(x+1). More... | |
| template<typename Arg , typename Exponent > | |
| constexpr auto | pow (const Arg &arg, const Exponent &exponent) |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | real (const Arg &arg) |
| A constexpr function to obtain the real part of a (complex) number. More... | |
| template<typename Arg , std::enable_if_t< value< Arg > and not complex< value_type_of_t< Arg >>, int > = 0> | |
| constexpr auto | signbit (const Arg &arg) |
| A constexpr function analogous to std::signbit. More... | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | sin (const Arg &arg) |
| Constexpr alternative to the std::sin function. | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | sinh (const Arg &arg) |
| Constexpr alternative to the std::sinh function. | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | sqrt (const Arg &arg) |
| A constexpr alternative to std::sqrt. More... | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | tan (const Arg &arg) |
| Constexpr alternative to the std::tan function. | |
| template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
| constexpr auto | tanh (const Arg &arg) |
Variables | |
| template<typename T > | |
| constexpr bool | complex = value<T> and detail::complex_impl<std::decay_t<T>>::value |
| T is a value that reduces to std::complex or a custom complex type. | |
| template<typename T > | |
| constexpr bool | dynamic |
| T is a value that is not fixed at compile time. More... | |
| template<typename T > | |
| constexpr bool | fixed |
| T is a value that is determinable at compile time. More... | |
| template<typename T , auto N, auto comp = &stdex::is_eq, unsigned int epsilon_factor = 0U> | |
| constexpr bool | fixed_value_compares_with = detail::fixed_value_compares_with_impl<T, N, comp, epsilon_factor>::value |
| T has a fixed value that compares with N in a particular way based on parameter comp. More... | |
| template<typename T > | |
| constexpr bool | floating |
| T is a floating-point value. More... | |
| template<typename T > | |
| constexpr bool | index |
| T is an index value. More... | |
| template<typename T > | |
| constexpr bool | integral = value<T> and detail::reduces_to_integral<T>::value |
| T is an integral value. | |
| template<typename T > | |
| constexpr bool | not_complex |
| T is a value in which either its type is not complex or its imaginary component is 0. More... | |
| template<typename T > | |
| constexpr bool | number |
| T is a numerical field type. More... | |
| constexpr unbounded_size_t | unbounded_size {} |
| An instance of unbounded_size_t;. | |
| template<typename T > | |
| constexpr bool | size |
| T is either an index representing a size, or unbounded_size_t, which indicates that the size is unbounded. More... | |
| template<typename T , typename U , auto comp = &stdex::is_eq, applicability a = applicability::guaranteed> | |
| constexpr bool | size_compares_with |
| T and U are sizes that compare in a particular way based on parameter comp. More... | |
| template<typename T > | |
| constexpr bool | value = detail::value_impl<T>::value |
| T is a fixed or dynamic value that is reducible to a number. | |
| template<typename T > | |
| constexpr auto | fixed_value_of_v = fixed_value_of<T>::value |
| Helper template for fixed_value_of. | |
Definition for values::abs.
Definition for values::tanh.
Definition for values::tan.
Definition for values::sqrt.
Definition for values::sinh.
Definition for values::sin.
Definition for values::signbit.
Definition for values::pow.
Definition for values::log1p.
Definition for values::log.
Definition for values::isnan.
Definition for values::isinf.
Definition for values::hypot.
Definition for values::fmod.
Definition for values::expm1.
Definition for values::exp.
Definition for values::cosh.
Definition for values::cos.
Definition for values::copysign.
Definition for values::atanh.
Definition for values::atan2.
Definition for values::atan.
Definition for values::asinh.
Definition for values::asin.
Definition for values::acosh.
Definition for values::acos.
| constexpr auto OpenKalman::values::atan2 | ( | const Y & | y_arg, |
| const X & | x_arg | ||
| ) |
Constexpr alternative to the std::atan2 function.
Unlike the standard function, this one accepts complex arguments.
| constexpr auto OpenKalman::values::copysign | ( | const Mag & | mag, |
| const Sgn & | sgn | ||
| ) |
A constexpr function for copysign.
If the compiler offers a constexpr version of std::copysign, it will be called. Otherwise, this function determines the sign of sgn and potentially negates mag.
| mag | The magnitude of the result. |
| sgn | A value reflecting the sign of the result. |
| constexpr auto OpenKalman::values::expm1 | ( | const Arg & | arg | ) |
Constexpr alternative to the std::expm1 function (exponential function minus 1).
Thus uses a Maclaurin series expansion For floating-point values, or multiplication for integral values.
| constexpr auto OpenKalman::values::fmod | ( | const X & | x, |
| const Y & | y | ||
| ) |
A constexpr function for fmod.
If the compiler offers a constexpr version of std::fmod, it will be called. Otherwise, this function returns x - iquot * y, where iquot is x / y with its fractional part truncated.
| constexpr auto OpenKalman::values::hypot | ( | const Args &... | args | ) |
A constexpr alternative to std::hypot.
This version can take one or more parameters (not limited to 2 or 3 as std::hypot is). Also, this function can take complex arguments
| constexpr auto OpenKalman::values::imag | ( | const Arg & | arg | ) |
A constexpr function to obtain the imaginary part of a (complex) number.
If arg is complex, arg must either match std::imag(values::to_value_type(arg)) or some defined function imag(values::to_value_type(arg)). If arg is not complex and no imag function is defined, the result will be
static_cast<double>(0) if Arg is integral orstatic_cast<std::decay_t<Arg>>(0) otherwise. | constexpr bool OpenKalman::values::isinf | ( | const Arg & | arg | ) |
Constexpr alternative to std::isinf.
Checks whether the input is positive or negative infinity.
| constexpr bool OpenKalman::values::isnan | ( | const Arg & | arg | ) |
Constexpr alternative to std::isnan.
Checks whether the input is not a number (NaN).
| constexpr auto OpenKalman::values::log1p | ( | const Arg & | arg | ) |
Constexpr alternative to the std::log1p function, where log1p(x) = log(x+1).
Unlike the standard function, this one accepts complex arguments.
| constexpr auto OpenKalman::values::operation | ( | Operation && | op, |
| Args &&... | args | ||
| ) |
A potentially constant-evaluated operation involving some number of values.
In this unspecialized case, the operation is not constant-evaluated.
| Operation | An operation taking sizeof...(Args) parameters |
| Args | A set of values |
| constexpr auto OpenKalman::values::real | ( | const Arg & | arg | ) |
A constexpr function to obtain the real part of a (complex) number.
If arg is complex, arg must either match std::real(values::to_value_type(arg)) or some defined function real(values::to_value_type(arg)). If arg is not complex and no real function is defined, the result will be
static_cast<double>(std::forward<Arg>(arg)) if Arg is integral orstatic_cast<std::decay_t<Arg>>(std::forward<Arg>(arg)) otherwise. | constexpr auto OpenKalman::values::signbit | ( | const Arg & | arg | ) |
A constexpr function analogous to std::signbit.
If the compiler offers a constexpr version of std::signbit, it will be called. Otherwise, the argument will be compared with zero.
| constexpr auto OpenKalman::values::sqrt | ( | const Arg & | arg | ) |
A constexpr alternative to std::sqrt.
Uses the Newton-Raphson method
// Code for a purely integral version: T lo = 0 , hi = x / 2 + 1; while (lo != hi) { const T mid = (lo + hi + 1) / 2; if (x / mid < mid) hi = mid - 1; else lo = mid; } return lo;
| constexpr bool OpenKalman::values::dynamic |
T is a value that is not fixed at compile time.
| constexpr bool OpenKalman::values::fixed |
T is a value that is determinable at compile time.
| constexpr bool OpenKalman::values::fixed_value_compares_with = detail::fixed_value_compares_with_impl<T, N, comp, epsilon_factor>::value |
T has a fixed value that compares with N in a particular way based on parameter comp.
| comp | A consteval-callable object taking the comparison result (e.g., std::partial_ordering) and returning a bool value |
| epsilon_factor | An epsilon value to account for rounding error. This is multiplied by std::numeric_limits<std::decay_t<T::epsilon(), if it exists. If it is zero, the match must be exact. |
| constexpr bool OpenKalman::values::floating |
T is a floating-point value.
| constexpr bool OpenKalman::values::index |
T is an index value.
| constexpr bool OpenKalman::values::not_complex |
| constexpr bool OpenKalman::values::number |
T is a numerical field type.
T can be any arithmetic, complex, or custom number type in which certain traits in interface::number_traits are defined and typical math operations (+, -, *, /, and ==) are also defined.
| constexpr bool OpenKalman::values::size |
T is either an index representing a size, or unbounded_size_t, which indicates that the size is unbounded.
| constexpr bool OpenKalman::values::size_compares_with |
T and U are sizes that compare in a particular way based on parameter comp.
| comp | A consteval-callable object taking the comparison result (e.g., std::partial_ordering) and returning a bool value |
1.8.13