tesseract++ 0.0.1
N-dimensional tensor library for embedded systems
Loading...
Searching...
No Matches
Functions
math Namespace Reference

Functions

template<typename T >
atan (T x)
 
template<typename T >
atan2 (T x)
 
template<typename T >
cos (T x)
 
template<typename T >
divide (T x, T y)
 
template<typename T >
constexpr T sqrt (T x) noexcept
 Compute the square root of a floating-point value.
 
template<typename T >
constexpr T abs (T x) noexcept
 Compute the absolute value of a numeric value.
 
template<typename T >
constexpr T sin (T x) noexcept
 Compute the sine of a floating-point value (radians).
 
template<typename T >
constexpr T cos (T x) noexcept
 Compute the cosine of a floating-point value (radians).
 
template<typename T >
constexpr T acos (T x) noexcept
 Compute the arc cosine of a floating-point value.
 

Function Documentation

◆ abs()

template<typename T >
constexpr T math::abs ( x)
constexprnoexcept

Compute the absolute value of a numeric value.

Maps to hardware instructions via compiler builtins for float, double, int, and long. Falls back to branch for other types.

Template Parameters
TNumeric type.
Parameters
xInput value.
Returns
Absolute value of x.

◆ acos()

template<typename T >
constexpr T math::acos ( x)
constexprnoexcept

Compute the arc cosine of a floating-point value.

Template Parameters
TFloating-point type (float or double).
Parameters
xValue in [-1, 1].
Returns
Arc cosine in radians [0, π].

◆ atan()

template<typename T >
T math::atan ( x)

◆ atan2()

template<typename T >
T math::atan2 ( x)

◆ cos() [1/2]

template<typename T >
T math::cos ( x)

◆ cos() [2/2]

template<typename T >
constexpr T math::cos ( x)
constexprnoexcept

Compute the cosine of a floating-point value (radians).

Template Parameters
TFloating-point type (float or double).
Parameters
xAngle in radians.
Returns
Cosine of x.

◆ divide()

template<typename T >
T math::divide ( x,
y 
)

◆ sin()

template<typename T >
constexpr T math::sin ( x)
constexprnoexcept

Compute the sine of a floating-point value (radians).

Template Parameters
TFloating-point type (float or double).
Parameters
xAngle in radians.
Returns
Sine of x.

◆ sqrt()

template<typename T >
constexpr T math::sqrt ( x)
constexprnoexcept

Compute the square root of a floating-point value.

Maps to a single hardware instruction (sqrtss/sqrtsd) via compiler builtins. Errors on negative input via MyErrorHandler.

Template Parameters
TFloating-point type (float or double).
Parameters
xNon-negative input value.
Returns
Square root of x.
Here is the call graph for this function: