Expressions¶
abs
function¶
template <typename E1, KFR_ACCEPT_EXPRESSIONS(E1)>
expression_make_function<fn::abs, E1> abs(E1 &&x)
Returns template expression that returns the absolute value of x.
absmax
function¶
template <typename E1, typename E2,
KFR_ACCEPT_EXPRESSIONS(E1, E2)>
expression_make_function<fn::absmax, E1, E2> absmax(E1 &&x,
E2 &&y)
Returns the greater in magnitude of two values. Accepts and returns expressions.
absmin
function¶
template <typename E1, typename E2,
KFR_ACCEPT_EXPRESSIONS(E1, E2)>
expression_make_function<fn::absmin, E1, E2> absmin(E1 &&x,
E2 &&y)
Returns the smaller in magnitude of two values. Accepts and returns expressions.
add
function¶
template <typename... E, KFR_ACCEPT_EXPRESSIONS(E...)>
expression_make_function<fn::add, E...> add(E &&...x)
Returns template expression that returns sum of all the arguments passed to a function.
adjacent
function¶
template <typename Fn, typename E1>
expression_adjacent<Fn, E1> adjacent(Fn &&fn, E1 &&e1)
Returns template expression that returns the result of calling \(fn(x_i, x_{i-1})\)
cconj
function¶
template <typename E1, KFR_ACCEPT_EXPRESSIONS(E1)>
expression_make_function<fn::cconj, E1> cconj(E1 &&x)
Returns template expression that returns the complex conjugate of the complex number x
clamp
function¶
template <typename E1, typename E2, typename E3,
KFR_ACCEPT_EXPRESSIONS(E1, E2, E3)>
expression_make_function<fn::clamp, E1, E2, E3>
clamp(E1 &&x, E2 &&lo, E3 &&hi)
Creates an expression that returns the first argument clamped to a range [lo, hi]
template <typename E1, typename E2,
KFR_ACCEPT_EXPRESSIONS(E1, E2)>
expression_make_function<fn::clamp, E1, E2> clamp(E1 &&x,
E2 &&hi)
Creates an expression that returns the first argument clamped to a range [0, hi]
cub
function¶
template <typename E1, KFR_ACCEPT_EXPRESSIONS(E1)>
expression_make_function<fn::cub, E1> cub(E1 &&x)
Returns template expression that returns cube of x.
dimensions
function¶
template <index_t Dims, typename E1>
expression_dimensions<Dims, E1> dimensions(E1 &&e1)
Returns template expression with gien number of dimensions
floor
function¶
template <typename E1, KFR_ACCEPT_EXPRESSIONS(E1)>
expression_make_function<fn::floor, E1> floor(E1 &&x)
Returns the largest integer value not greater than x. Accepts and returns expressions.
imag
function¶
template <typename E1, KFR_ACCEPT_EXPRESSIONS(E1)>
expression_make_function<fn::imag, E1> imag(E1 &&x)
Returns the imaginary part of the complex value
linspace
function¶
template <typename T = void, bool precise = false, bool truncated = false, typename T1, typename T2,
typename Tout = or_type<T, ftype<std::common_type_t<T1, T2>>>>
expression_linspace<Tout, truncated> linspace(T1 start, T2 stop, size_t size,
bool endpoint = false, cbool_t<truncated> =
Returns evenly spaced numbers over a specified interval.
Param start
The starting value of the sequence
Param stop
The end value of the sequence. if endpoint
is false
, the last value is excluded
Param size
Number of samples to generate
Param endpoint
If true
, stop
is the last sample. Otherwise, it is not included
Template param truncated
If true
, linspace returns exactly size elements, otherwise, returns infinite sequence
Template param precise
No longer used since KFR5, calculations are always precise
make_complex
function¶
template <typename E1, typename E2,
KFR_ACCEPT_EXPRESSIONS(E1, E2)>
expression_make_function<fn::make_complex, E1, E2>
make_complex(E1 &&re, E2 &&im)
Constructs complex value from real and imaginary parts
max
function¶
template <typename E1, typename E2,
KFR_ACCEPT_EXPRESSIONS(E1, E2)>
expression_make_function<fn::max, E1, E2> max(E1 &&x,
E2 &&y)
Returns the greater of two values. Accepts and returns expressions.
min
function¶
template <typename E1, typename E2,
KFR_ACCEPT_EXPRESSIONS(E1, E2)>
expression_make_function<fn::min, E1, E2> min(E1 &&x,
E2 &&y)
Returns the smaller of two values. Accepts and returns expressions.
mul
function¶
template <typename... E, KFR_ACCEPT_EXPRESSIONS(E...)>
expression_make_function<fn::mul, E...> mul(E &&...x)
Returns template expression that returns product of all the arguments passed to a function.
real
function¶
template <typename E1, KFR_ACCEPT_EXPRESSIONS(E1)>
expression_make_function<fn::real, E1> real(E1 &&x)
Returns the real part of the complex value
rebind
function¶
template <typename Fn, typename... OldArgs,
typename... NewArgs>
expression_function<Fn, NewArgs...>
rebind(const expression_function<Fn, OldArgs...> &e,
NewArgs &&...args)
Construct a new expression using the same function as in e
and new arguments
Param e
an expression
Param args
new arguments for the function
satadd
function¶
template <typename E1, typename E2,
KFR_ACCEPT_EXPRESSIONS(E1, E2)>
expression_make_function<fn::satadd, E1, E2> satadd(E1 &&x,
E2 &&y)
Creates an expression that adds two arguments using saturation
satsub
function¶
template <typename E1, typename E2,
KFR_ACCEPT_EXPRESSIONS(E1, E2)>
expression_make_function<fn::satsub, E1, E2> satsub(E1 &&x,
E2 &&y)
Creates an expression that subtracts two arguments using saturation
select
function¶
template <typename E1, typename E2, typename E3,
KFR_ACCEPT_EXPRESSIONS(E1, E2, E3)>
expression_make_function<fn::select, E1, E2, E3>
select(E1 &&m, E2 &&x, E3 &&y)
Returns template expression that returns x if m is true, otherwise return y. Order of the arguments is same as in ternary operator.
sink
function¶
template <size_t width = 0, index_t Axis = infinite_size,
typename E,
typename Traits = expression_traits<E>>
const E &sink(E &&expr)
Read the expression expr
through the whole range.
Param expr
the input expression
Returns the input expression is returned
sqr
function¶
template <typename E1, KFR_ACCEPT_EXPRESSIONS(E1)>
expression_make_function<fn::sqr, E1> sqr(E1 &&x)
Returns template expression that returns square of x.
symmlinspace
function¶
template <typename T, bool precise = false, bool truncated = false, typename Tout = ftype<T>>
expression_linspace<Tout, truncated> symmlinspace(T symsize, size_t size,
cbool_t<truncated> =
Returns evenly spaced numbers over a specified interval.
Param symsize
The sequence will have interval [-symsize..symsize]
Param size
Number of samples to generate
Template param truncated
If true
, linspace returns exactly size elements, otherwise, returns infinite sequence
Template param precise
No longer used since KFR5, calculations are always precise
trace
function¶
template <typename E1> expression_trace<E1> trace(E1 &&e1)
Returns template expression that prints all processed values for debug
Auto-generated from sources, Revision 6aea976a464de59d522d0c629e64bf0c044e6777, https://github.com/kfrlib/kfr/blob/6aea976a464de59d522d0c629e64bf0c044e6777/include/kfr/