|
Theoretica
Mathematical Library
|
Real functions. More...
Go to the source code of this file.
Namespaces | |
| namespace | theoretica |
| Main namespace of the library which contains all functions and objects. | |
Functions | |
| TH_CONSTEXPR real | theoretica::identity (real x) |
| Identity. | |
| template<typename Type , typename = std::enable_if<is_real_type<Type>::value>> | |
| TH_CONSTEXPR Type | theoretica::conjugate (Type x) |
| Complex conjugate of a real number (identity) | |
| TH_CONSTEXPR real | theoretica::square (real x) |
| Compute the square of a real number. | |
| TH_CONSTEXPR real | theoretica::cube (real x) |
| Compute the cube of a real number. | |
| template<typename UnsignedIntType = uint64_t> | |
| UnsignedIntType | theoretica::isqrt (UnsignedIntType n) |
| Compute the integer square root of a positive integer. | |
| template<typename UnsignedIntType = uint64_t> | |
| UnsignedIntType | theoretica::icbrt (UnsignedIntType n) |
| Compute the integer cubic root of a positive integer. | |
| real | theoretica::sqrt (real x) |
| Compute the square root of a real number. | |
| real | theoretica::cbrt (real x) |
| Compute the cubic root of x. | |
| real | theoretica::abs (real x) |
| Compute the absolute value of a real number. | |
| int | theoretica::sgn (real x) |
| Return the sign of x (1 if positive, -1 if negative, 0 if null) | |
| TH_CONSTEXPR int | theoretica::floor (real x) |
| Compute the floor of x Computes the maximum integer number that is smaller than x. | |
| real | theoretica::fract (real x) |
| Compute the fractional part of a real number. | |
| real | theoretica::max (real x, real y) |
| Return the greatest number between two real numbers. | |
| template<typename T > | |
| T | theoretica::max (T x, T y) |
| Compare two objects and return the greatest. | |
| real | theoretica::min (real x, real y) |
| Return the smallest number between two real numbers. | |
| template<typename T > | |
| T | theoretica::min (T x, T y) |
| Compare two objects and return the greatest. | |
| real | theoretica::clamp (real x, real a, real b) |
| Clamp x between a and b. | |
| template<typename T > | |
| T | theoretica::clamp (T x, T a, T b) |
| Clamp a value between two other values. | |
| real | theoretica::log2 (real x) |
| Compute the binary logarithm of a real number. | |
| real | theoretica::log10 (real x) |
| Compute the base-10 logarithm of x. | |
| real | theoretica::ln (real x) |
| Compute the natural logarithm of x. | |
| template<typename UnsignedIntType = uint64_t> | |
| UnsignedIntType | theoretica::ilog2 (UnsignedIntType x) |
| Find the integer logarithm of x. | |
| template<typename UnsignedIntType = uint64_t> | |
| UnsignedIntType | theoretica::pad2 (UnsignedIntType x) |
| Get the smallest power of 2 bigger than or equal to x. | |
| template<typename T = real> | |
| TH_CONSTEXPR T | theoretica::pow (T x, int n) |
| Compute the n-th power of x (where n is natural) | |
| template<typename T = real> | |
| TH_CONSTEXPR T | theoretica::ipow (T x, unsigned int n, T neutral_element=T(1)) |
| Compute the n-th positive power of x (where n is natural) | |
| template<typename IntType = uint64_t> | |
| TH_CONSTEXPR IntType | theoretica::fact (unsigned int n) |
| Compute the factorial of n. | |
| template<typename T = uint64_t> | |
| TH_CONSTEXPR T | theoretica::falling_fact (T x, unsigned int n) |
| Compute the falling factorial of n. | |
| template<typename T = uint64_t> | |
| TH_CONSTEXPR T | theoretica::rising_fact (T x, unsigned int n) |
| Compute the rising factorial of n. | |
| template<typename IntType = unsigned long long int> | |
| TH_CONSTEXPR IntType | theoretica::double_fact (unsigned int n) |
| Compute the double factorial of n. | |
| real | theoretica::exp (real x) |
| Compute the real exponential. | |
| real | theoretica::expm1 (real x) |
| Compute the exponential of x minus 1 more accurately for really small x. | |
| real | theoretica::powf (real x, real a) |
| Approximate x elevated to a real exponent. | |
| real | theoretica::root (real x, int n) |
| Compute the n-th root of x. | |
| real | theoretica::sin (real x) |
| Compute the sine of a real number. | |
| real | theoretica::cos (real x) |
| Compute the cosine of a real number. | |
| real | theoretica::tan (real x) |
| Compute the tangent of x. | |
| real | theoretica::cot (real x) |
| Compute the cotangent of x. | |
| real | theoretica::atan (real x) |
| Compute the arctangent. | |
| real | theoretica::asin (real x) |
| Compute the arcsine. | |
| real | theoretica::acos (real x) |
| Compute the arccosine. | |
| real | theoretica::atan2 (real y, real x) |
| Compute the 2 argument arctangent. | |
| real | theoretica::sinh (real x) |
| Compute the hyperbolic sine. | |
| real | theoretica::cosh (real x) |
| Compute the hyperbolic cosine. | |
| real | theoretica::tanh (real x) |
| Compute the hyperbolic tangent. | |
| real | theoretica::coth (real x) |
| Compute the hyperbolic cotangent. | |
| real | theoretica::asinh (real x) |
| Compute the inverse hyperbolic sine. | |
| real | theoretica::acosh (real x) |
| Compute the inverse hyperbolic cosine. | |
| real | theoretica::atanh (real x) |
| Compute the inverse hyperbolic tangent. | |
| real | theoretica::sigmoid (real x) |
| Compute the sigmoid function. | |
| real | theoretica::sinc (real x) |
| Compute the normalized sinc function. | |
| real | theoretica::heaviside (real x) |
| Compute the heaviside function. | |
| template<typename IntType = unsigned long long int> | |
| TH_CONSTEXPR IntType | theoretica::binomial_coeff (unsigned int n, unsigned int m) |
| Compute the binomial coefficient. | |
| TH_CONSTEXPR real | theoretica::radians (real degrees) |
| Convert degrees to radians. | |
| TH_CONSTEXPR real | theoretica::degrees (real radians) |
| Convert radians to degrees. | |
| template<typename T > | |
| TH_CONSTEXPR T | theoretica::kronecker_delta (T i, T j) |
| Kronecker delta, equals 1 if i is equal to j, 0 otherwise. | |
| template<typename IntType = unsigned long long int> | |
| TH_CONSTEXPR IntType | theoretica::catalan (unsigned int n) |
| The n-th Catalan number. | |
Real functions.