Tannic
A C++ Tensor Library
Loading...
Searching...
No Matches
tannic::function Namespace Reference

Classes

struct  Abs
 Functor absolute value (|x|) Applies element-wise absolute value to tensor elements. More...
 
struct  Cos
 Functor cosine Applies element-wise cosine to tensor elements (radians) More...
 
struct  Cosh
 Functor hyperbolic cosine Applies element-wise hyperbolic cosine to tensor elements. More...
 
struct  Exp
 Functor exponential (e^x) Applies element-wise exponential to tensor elements. More...
 
class  Function
 Expression template for mathematical function operations. More...
 
struct  Log
 Functor natural logarithm (ln(x)) Applies element-wise natural logarithm to tensor elements. More...
 
struct  Rsqrt
 Functor inverse square root (1/√x) Applies element-wise inverse square root to tensor elements. More...
 
struct  Sin
 Functor sine Applies element-wise sine to tensor elements (radians) More...
 
struct  Sinh
 Functor hyperbolic sine Applies element-wise hyperbolic sine to tensor elements. More...
 
struct  Sqrt
 Functor square root (√x) Applies element-wise square root to tensor elements. More...
 
struct  Tan
 Functor tangent Applies element-wise tangent to tensor elements (radians) More...
 
struct  Tanh
 Functor hyperbolic tangent Applies element-wise hyperbolic tangent to tensor elements. More...
 

Functions

template<Expression Operand>
constexpr auto log (Operand &&operand)
 Creates a lazy-evaluated natural logarithm expression.
 
template<Expression Operand>
constexpr auto exp (Operand &&operand)
 Creates a lazy-evaluated exponential function expression.
 
template<Expression Operand>
constexpr auto sqrt (Operand &&operand)
 Creates a lazy-evaluated square root expression.
 
template<Expression Operand>
constexpr auto rsqrt (Operand &&operand, float epsilon=0.0f)
 Creates a lazy-evaluated inverse square root expression.
 
template<Expression Operand>
constexpr auto abs (Operand &&operand)
 Creates a lazy-evaluated absolute value expression.
 
template<Expression Operand>
constexpr auto sin (Operand &&operand)
 Creates a lazy-evaluated sine function expression.
 
template<Expression Operand>
constexpr auto cos (Operand &&operand)
 Creates a lazy-evaluated cosine function expression.
 
template<Expression Operand>
constexpr auto tan (Operand &&operand)
 Creates a lazy-evaluated tangent function expression.
 
template<Expression Operand>
constexpr auto sinh (Operand &&operand)
 Creates a lazy-evaluated hyperbolic sine expression.
 
template<Expression Operand>
constexpr auto cosh (Operand &&operand)
 Creates a lazy-evaluated hyperbolic cosine expression.
 
template<Expression Operand>
constexpr auto tanh (Operand &&operand)
 Creates a lazy-evaluated hyperbolic tangent expression.
 

Function Documentation

◆ abs()

template<Expression Operand>
constexpr auto tannic::function::abs ( Operand &&  operand)
constexpr

Creates a lazy-evaluated absolute value expression.

Template Parameters
OperandType satisfying Expression concept
Parameters
operandInput tensor expression
Returns
Functor expression representing element-wise |operand|
See also
Abs

◆ cos()

template<Expression Operand>
constexpr auto tannic::function::cos ( Operand &&  operand)
constexpr

Creates a lazy-evaluated cosine function expression.

Template Parameters
OperandType satisfying Expression concept
Parameters
operandInput tensor expression (in radians)
Returns
Functor expression representing element-wise cos(operand)
See also
Cos

◆ cosh()

template<Expression Operand>
constexpr auto tannic::function::cosh ( Operand &&  operand)
constexpr

Creates a lazy-evaluated hyperbolic cosine expression.

Template Parameters
OperandType satisfying Expression concept
Parameters
operandInput tensor expression
Returns
Functor expression representing element-wise cosh(operand)
See also
Cosh

◆ exp()

template<Expression Operand>
constexpr auto tannic::function::exp ( Operand &&  operand)
constexpr

Creates a lazy-evaluated exponential function expression.

Template Parameters
OperandType satisfying Expression concept
Parameters
operandInput tensor expression
Returns
Functor expression representing element-wise e^(operand)
See also
Exp

◆ log()

template<Expression Operand>
constexpr auto tannic::function::log ( Operand &&  operand)
constexpr

Creates a lazy-evaluated natural logarithm expression.

Template Parameters
OperandType satisfying Expression concept
Parameters
operandInput tensor expression
Returns
Functor expression representing element-wise ln(operand)
Note
Computes natural logarithm (base e) for each element
See also
Log

◆ rsqrt()

template<Expression Operand>
constexpr auto tannic::function::rsqrt ( Operand &&  operand,
float  epsilon = 0.0f 
)
constexpr

Creates a lazy-evaluated inverse square root expression.

Template Parameters
OperandType satisfying Expression concept
Parameters
operandInput tensor expression
Returns
Functor expression representing element-wise √operand
Note
Returns NaN for negative inputs
See also
Rsqrt

◆ sin()

template<Expression Operand>
constexpr auto tannic::function::sin ( Operand &&  operand)
constexpr

Creates a lazy-evaluated sine function expression.

Template Parameters
OperandType satisfying Expression concept
Parameters
operandInput tensor expression (in radians)
Returns
Functor expression representing element-wise sin(operand)
See also
Sin

◆ sinh()

template<Expression Operand>
constexpr auto tannic::function::sinh ( Operand &&  operand)
constexpr

Creates a lazy-evaluated hyperbolic sine expression.

Template Parameters
OperandType satisfying Expression concept
Parameters
operandInput tensor expression
Returns
Functor expression representing element-wise sinh(operand)
See also
Sinh

◆ sqrt()

template<Expression Operand>
constexpr auto tannic::function::sqrt ( Operand &&  operand)
constexpr

Creates a lazy-evaluated square root expression.

Template Parameters
OperandType satisfying Expression concept
Parameters
operandInput tensor expression
Returns
Functor expression representing element-wise √operand
Note
Returns NaN for negative inputs
See also
Sqrt

◆ tan()

template<Expression Operand>
constexpr auto tannic::function::tan ( Operand &&  operand)
constexpr

Creates a lazy-evaluated tangent function expression.

Template Parameters
OperandType satisfying Expression concept
Parameters
operandInput tensor expression (in radians)
Returns
Functor expression representing element-wise tan(operand)
Note
Returns NaN where cosine equals zero
See also
Tan

◆ tanh()

template<Expression Operand>
constexpr auto tannic::function::tanh ( Operand &&  operand)
constexpr

Creates a lazy-evaluated hyperbolic tangent expression.

Template Parameters
OperandType satisfying Expression concept
Parameters
operandInput tensor expression
Returns
Functor expression representing element-wise tanh(operand)
See also
Tanh