Class expression_with_arguments¶
class expression_with_arguments<Args> base¶
template <typename... Args>
struct expression_with_arguments { … } Holds the arguments of an expression along with their dimension masks.
Stores a tuple of arguments and an array of masks used to adapt indices when the arguments have different dimensionalities. Provides helpers to access the first argument, query per-argument masks, and fold a callable over all arguments.
| Args | Argument types stored by the expression. |
variable count ¶
constexpr static size_t count = sizeof...(Args) Number of arguments held by the expression.
Fully qualified name: kfr::expression_with_arguments<Args>::count
Declared at base/expression.hpp:489
typedef type_list ¶
using type_list = ctypes_t<Args...> Fully qualified name: kfr::expression_with_arguments<Args>::type_list
Declared at base/expression.hpp:491
typedef nth ¶
using nth = typename type_list::template nth<idx> Alias for the type of the argument at position
idx.
Fully qualified name: kfr::expression_with_arguments<Args>::nth
Declared at base/expression.hpp:495
typedef first_arg ¶
using first_arg = typename type_list::template nth<0> Alias for the type of the first argument.
Fully qualified name: kfr::expression_with_arguments<Args>::first_arg
Declared at base/expression.hpp:498
typedef nth_trait ¶
using nth_trait = expression_traits<typename type_list::template nth<idx>> Alias for the traits of the argument at position
idx.
Fully qualified name: kfr::expression_with_arguments<Args>::nth_trait
Declared at base/expression.hpp:502
typedef first_arg_traits ¶
using first_arg_traits = expression_traits<first_arg> Traits of the first argument.
Fully qualified name: kfr::expression_with_arguments<Args>::first_arg_traits
Declared at base/expression.hpp:505
variable args ¶
std::tuple<Args...> args Tuple holding all arguments.
Fully qualified name: kfr::expression_with_arguments<Args>::args
Declared at base/expression.hpp:508
variable masks ¶
std::array<dimset, count> masks Per-argument dimension masks computed from each argument's shape.
Fully qualified name: kfr::expression_with_arguments<Args>::masks
Declared at base/expression.hpp:510
function first() ¶
Returns a reference to the first argument.
| Reference to the first stored argument. |
Fully qualified name: kfr::expression_with_arguments<Args>::first()
Declared at base/expression.hpp:516
function first() ¶
Returns a const reference to the first argument.
| Const reference to the first stored argument. |
Fully qualified name: kfr::expression_with_arguments<Args>::first()
Declared at base/expression.hpp:521
function getmask(csize_t<idx>) ¶
template <size_t idx>
KFR_INTRINSIC dimset getmask(csize_t<idx> = { … } Returns the dimension mask for the argument at position idx.
| idx | Compile-time index of the argument. |
| Dimension mask for the requested argument. |
Fully qualified name: kfr::expression_with_arguments<Args>::getmask(csize_t<idx>)
Declared at base/expression.hpp:533
function fold(Fn &&) ¶
template <typename Fn>
KFR_INTRINSIC constexpr auto fold(Fn&& fn) const { … } Folds a callable over the stored arguments, passing them by value.
| fn | Callable invoked as fn(args...) . |
Result of fn(args...) . |
Fully qualified name: kfr::expression_with_arguments<Args>::fold(Fn &&)
Declared at base/expression.hpp:560
function fold_idx(Fn &&) ¶
template <typename Fn>
KFR_INTRINSIC constexpr static auto fold_idx(Fn&& fn) { … } Folds a callable over compile-time indices of the arguments.
| fn | Callable invoked as fn(csize<0>, csize<1>, ...) . |
| Result of the fold. |
Fully qualified name: kfr::expression_with_arguments<Args>::fold_idx(Fn &&)
Declared at base/expression.hpp:570
constructor expression_with_arguments<Args...>(arg<Args &&>...) ¶
Constructs the expression from a pack of arguments.
Numeric/boolean arguments are decayed before being stored. The per-argument masks are computed from each argument's shape at construction time.
| args | Arguments to store. |
Fully qualified name: kfr::expression_with_arguments<Args>::expression_with_arguments<Args...>(arg<Args &&>...)
Declared at base/expression.hpp:582
Fully qualified name: kfr::expression_with_arguments<Args>
Declared at base/expression.hpp:486
Class expression_with_arguments¶
class expression_with_arguments<Arg> base¶
template <typename Arg>
struct expression_with_arguments<Arg> { … } Single-argument specialization of expression_with_arguments .
| Arg | Argument type. |
variable count ¶
constexpr static size_t count = 1 Number of arguments held by the expression (always 1).
Fully qualified name: kfr::expression_with_arguments<Arg>::count
Declared at base/expression.hpp:617
typedef type_list ¶
using type_list = ctypes_t<Arg> Fully qualified name: kfr::expression_with_arguments<Arg>::type_list
Declared at base/expression.hpp:619
typedef nth ¶
using nth = Arg Alias for the argument type (any index).
Fully qualified name: kfr::expression_with_arguments<Arg>::nth
Declared at base/expression.hpp:623
typedef first_arg ¶
using first_arg = Arg Alias for the argument type.
Fully qualified name: kfr::expression_with_arguments<Arg>::first_arg
Declared at base/expression.hpp:626
typedef nth_trait ¶
using nth_trait = expression_traits<Arg> Alias for the traits of the argument.
Fully qualified name: kfr::expression_with_arguments<Arg>::nth_trait
Declared at base/expression.hpp:630
typedef first_arg_traits ¶
using first_arg_traits = expression_traits<first_arg> Traits of the argument.
Fully qualified name: kfr::expression_with_arguments<Arg>::first_arg_traits
Declared at base/expression.hpp:633
variable args ¶
std::tuple<Arg> args Tuple holding the single argument.
Fully qualified name: kfr::expression_with_arguments<Arg>::args
Declared at base/expression.hpp:636
function first() ¶
Returns a reference to the stored argument.
| Reference to the stored argument. |
Fully qualified name: kfr::expression_with_arguments<Arg>::first()
Declared at base/expression.hpp:642
function first() ¶
Returns a const reference to the stored argument.
| Const reference to the stored argument. |
Fully qualified name: kfr::expression_with_arguments<Arg>::first()
Declared at base/expression.hpp:647
function getmask(csize_t<idx>) ¶
Returns the sentinel dimension mask for the single argument.
| idx | Compile-time index (ignored). |
Sentinel mask of -1 . |
Fully qualified name: kfr::expression_with_arguments<Arg>::getmask(csize_t<idx>)
Declared at base/expression.hpp:655
function fold(Fn &&) ¶
template <typename Fn>
KFR_MEM_INTRINSIC constexpr auto fold(Fn&& fn) const { … } Folds a callable over the stored argument.
| fn | Callable invoked as fn(arg) . |
Result of fn(arg) . |
Fully qualified name: kfr::expression_with_arguments<Arg>::fold(Fn &&)
Declared at base/expression.hpp:666
function fold_idx(Fn &&) ¶
template <typename Fn>
KFR_INTRINSIC constexpr static auto fold_idx(Fn&& fn) { … } Folds a callable over the compile-time index of the argument.
| fn | Callable invoked as fn(csize<0>) . |
| Result of the fold. |
Fully qualified name: kfr::expression_with_arguments<Arg>::fold_idx(Fn &&)
Declared at base/expression.hpp:676
constructor expression_with_arguments<Arg>(Arg &&) ¶
Constructs the expression from a single argument.
| arg | Argument to store. |
Fully qualified name: kfr::expression_with_arguments<Arg>::expression_with_arguments<Arg>(Arg &&)
Declared at base/expression.hpp:685
Fully qualified name: kfr::expression_with_arguments<Arg>
Declared at base/expression.hpp:614