OpenKalman
|
Definition for values::abs. More...
Namespaces | |
internal | |
Definition of utilities for atan functions. | |
Typedefs | |
template<typename T , std::enable_if_t< values::value< T >, int > = 0> | |
using | number_type_of_t = std::decay_t< decltype(values::to_number(std::declval< T >()))> |
Obtain the values::number type associated with avalues::value. | |
template<typename T , std::enable_if_t< value< T >, int > = 0> | |
using | real_type_of_t = std::decay_t< decltype(values::real(std::declval< T >()))> |
Obtain the real type associated with a number (typically a values::complex number. More... | |
Functions | |
template<typename T > | |
constant_coefficient (const T &) -> constant_coefficient< T > | |
Deduction guide for constant_coefficient. | |
template<typename T > | |
constant_diagonal_coefficient (T &&) -> constant_diagonal_coefficient< std::decay_t< T >> | |
Deduction guide for constant_diagonal_coefficient. | |
template<typename T , std::enable_if_t< values::fixed< T >, int > = 0> | |
Fixed (const T &) -> Fixed< std::decay_t< T >> | |
template<typename Operation , typename... Args> | |
operation (const Operation &, const Args &...) -> operation< Operation, Args... > | |
Deduction guide. | |
template<typename T , typename Arg , std::enable_if_t< values::number< T > and values::value< Arg >, int > = 0> | |
decltype(auto) constexpr | cast_to (Arg &&arg) |
template<typename Arg > | |
constexpr auto | to_number (Arg arg) |
Convert any values::value to a values::number. | |
template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
constexpr Arg && | operator+ (Arg &&arg) |
template<typename Arg , std::enable_if_t< value< Arg >, int > = 0> | |
constexpr auto | operator- (Arg arg) |
template<typename Arg1 , typename Arg2 , std::enable_if_t< detail::value_common_with< Arg1, Arg2 > and std::is_invocable< std::plus< detail::binary_common_type_t< Arg1, Arg2 >>, Arg1 &&, Arg2 &&>::value, int > = 0> | |
constexpr auto | operator+ (Arg1 arg1, Arg2 arg2) |
template<typename Arg1 , typename Arg2 , std::enable_if_t< detail::value_common_with< Arg1, Arg2 > and std::is_invocable< std::minus< detail::binary_common_type_t< Arg1, Arg2 >>, Arg1 &&, Arg2 &&>::value, int > = 0> | |
constexpr auto | operator- (Arg1 arg1, Arg2 arg2) |
template<typename Arg1 , typename Arg2 , std::enable_if_t< detail::value_common_with< Arg1, Arg2 > and std::is_invocable< std::multiplies< detail::binary_common_type_t< Arg1, Arg2 >>, Arg1 &&, Arg2 &&>::value, int > = 0> | |
constexpr auto | operator* (Arg1 arg1, Arg2 arg2) |
template<typename Arg1 , typename Arg2 , std::enable_if_t< detail::value_common_with< Arg1, Arg2 > and std::is_invocable< std::divides< detail::binary_common_type_t< Arg1, Arg2 >>, Arg1 &&, Arg2 &&>::value, int > = 0> | |
constexpr auto | operator/ (Arg1 arg1, Arg2 arg2) |
template<typename A , typename B , std::enable_if_t< detail::value_common_with< A, B > and std::is_invocable< std::equal_to< detail::binary_common_type_t< A, B >>, const A &, const B &>::value, int > = 0> | |
constexpr bool | operator== (const A &a, const B &b) |
template<typename A , typename B , std::enable_if_t< detail::value_common_with< A, B > and std::is_invocable< std::not_equal_to< detail::binary_common_type_t< A, B >>, const A &, const B &>::value, int > = 0> | |
constexpr bool | operator!= (const A &a, const B &b) |
template<typename A , typename B , std::enable_if_t< detail::value_common_with< A, B > and std::is_invocable< std::less< detail::binary_common_type_t< A, B >>, const A &, const B &>::value, int > = 0> | |
constexpr auto | operator< (const A &a, const B &b) |
template<typename A , typename B , std::enable_if_t< detail::value_common_with< A, B > and std::is_invocable< std::greater< detail::binary_common_type_t< A, B >>, const A &, const B &>::value, int > = 0> | |
constexpr auto | operator> (const A &a, const B &b) |
template<typename A , typename B , std::enable_if_t< detail::value_common_with< A, B > and std::is_invocable< std::less_equal< detail::binary_common_type_t< A, B >>, const A &, const B &>::value, int > = 0> | |
constexpr auto | operator<= (const A &a, const B &b) |
template<typename A , typename B , std::enable_if_t< detail::value_common_with< A, B > and std::is_invocable< std::greater_equal< detail::binary_common_type_t< A, B >>, const A &, const B &>::value, int > = 0> | |
constexpr auto | operator>= (const A &a, const B &b) |
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< values::value< Arg >, int > = 0> | |
constexpr auto | acosh (const Arg &arg) |
Constexpr alternative to the std::acosh function. | |
template<typename Arg , std::enable_if_t< values::value< Arg >, int > = 0> | |
constexpr auto | asin (const Arg &arg) |
Constexpr alternative to the std::asin function. | |
template<typename Arg , std::enable_if_t< values::value< Arg >, int > = 0> | |
constexpr auto | asinh (const Arg &arg) |
Constexpr alternative to the std::asinh function. | |
template<typename Arg , std::enable_if_t< values::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< values::value< Y > and values::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< values::value< Arg >, int > = 0> | |
constexpr auto | atanh (const Arg &arg) |
Constexpr alternative to the std::atanh function. | |
template<typename Arg , std::enable_if_t< values::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 > | |
constexpr auto | cos (const Arg &arg, std::enable_if_t< values::value< Arg >, int >=0) |
Constexpr alternative to the std::cos function. | |
template<typename Arg , std::enable_if_t< values::value< Arg >, int > = 0> | |
constexpr auto | cosh (const Arg &arg) |
Constexpr alternative to the std::cosh function. | |
template<typename Arg , std::enable_if_t< values::value< Arg >, int > = 0> | |
constexpr auto | exp (const Arg &arg) |
template<typename Arg , std::enable_if_t< values::value< Arg >, int > = 0> | |
constexpr auto | expm1 (const Arg &arg) |
Constexpr alternative to the std::expm1 function (exponential function minus 1). More... | |
template<typename... Args, std::enable_if_t<(... and values::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 (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< values::value< Arg >, int > = 0> | |
constexpr auto | log (const Arg &arg) |
Constexpr alternative to the std::log function. | |
template<typename Arg , std::enable_if_t< values::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 (Arg arg) |
A constexpr function to obtain the real part of a (complex) number. More... | |
template<typename Arg , std::enable_if_t< values::value< Arg > and not values::complex< values::number_type_of_t< Arg >>, int > = 0> | |
constexpr bool | signbit (const Arg &arg) |
A constexpr function analogous to std::signbit. More... | |
template<typename Arg , std::enable_if_t< values::value< Arg >, int > = 0> | |
constexpr auto | sin (const Arg &arg) |
Constexpr alternative to the std::sin function. | |
template<typename Arg , std::enable_if_t< values::value< Arg >, int > = 0> | |
constexpr auto | sinh (const Arg &arg) |
Constexpr alternative to the std::sinh function. | |
template<typename Arg , std::enable_if_t< values::value< Arg >, int > = 0> | |
constexpr auto | sqrt (const Arg &arg) |
A constexpr alternative to std::sqrt. More... | |
template<typename Arg , std::enable_if_t< values::value< Arg >, int > = 0> | |
constexpr auto | tan (const Arg &arg) |
Constexpr alternative to the std::tan function. | |
template<typename Arg , std::enable_if_t< values::value< Arg >, int > = 0> | |
constexpr auto | tanh (const Arg &arg) |
Variables | |
template<typename T > | |
constexpr auto | constant_coefficient_v = constant_coefficient<T>::value |
Helper template for constant_coefficient. | |
template<typename T > | |
constexpr auto | constant_diagonal_coefficient_v = constant_diagonal_coefficient<T>::value |
Helper template for constant_diagonal_coefficient. | |
template<typename T > | |
constexpr bool | complex = detail::complex_impl<std::decay_t<T>>::value |
T is a values::value that reduces to std::complex or a custom complex type. | |
template<typename T > | |
constexpr bool | dynamic |
T is a values::value that is not determinable at compile time. More... | |
template<typename T > | |
constexpr bool | fixed |
T is a values::value that is determinable at compile time. More... | |
template<typename T > | |
constexpr bool | floating |
T is a floating-point values::value. More... | |
template<typename T > | |
constexpr bool | index = values::integral<T> and (detail::number_type_is_unsigned<T>::value or detail::fixed_integral_gt_0<T>::value) |
T is an index value. | |
template<typename T > | |
constexpr bool | integral = values::value<T> and detail::reduces_to_integral<T>::value |
T is an index value. | |
template<typename T > | |
constexpr bool | not_complex |
T is a values::value in which either its type is not a values::complex or its imaginary component is 0. More... | |
template<typename T > | |
constexpr bool | number |
T is a numerical type. More... | |
template<typename T > | |
constexpr bool | size = index<T> or std::is_same_v<std::decay_t<T>, unreachable_sentinel_t> |
T is either an index representing a size, or void which represents that there is no size. | |
template<typename T > | |
constexpr bool | value |
T is numerical value or is reducible to a numerical value. More... | |
template<typename T > | |
constexpr auto | fixed_number_of_v = fixed_number_of<T>::value |
Helper template for fixed_number_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::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.
using OpenKalman::values::real_type_of_t = typedef std::decay_t<decltype(values::real(std::declval<T>()))> |
Obtain the real type associated with a number (typically a values::complex number.
This will be the type of the result of values::real(...)
.
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::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).
constexpr auto OpenKalman::values::imag | ( | 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_number(arg))
or some defined function imag(values::to_number(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::real | ( | 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_number(arg))
or some defined function real(values::to_number(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 bool 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 values::value that is not determinable at compile time.
constexpr bool OpenKalman::values::fixed |
T is a values::value that is determinable at compile time.
constexpr bool OpenKalman::values::floating |
T is a floating-point values::value.
constexpr bool OpenKalman::values::not_complex |
T is a values::value in which either its type is not a values::complex or its imaginary component is 0.
constexpr bool OpenKalman::values::number |
T is a numerical 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::value |
T is numerical value or is reducible to a numerical value.