template<typename F, Array... As>
struct nda::expr_call< F, As >
A lazy function call expression on arrays/views.
The lazy expression call fulfils the nda::Array concept and can therefore be assigned to other nda::basic_array or nda::basic_array_view objects. For example:
A generic multi-dimensional array.
auto pow(A &&a, double p)
Function pow for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
Here, nda::pow(mat, 2)
returns a lazy expression call object which is then used in the constructor of pmat
.
The callable object should take the array/view elements as arguments.
- Template Parameters
-
Definition at line 90 of file map.hpp.
template<typename F , Array... As>
template<typename... Args>
auto nda::expr_call< F, As >::operator() |
( |
Args const &... | args | ) |
const |
|
inline |
Function call operator.
The arguments (usually multi-dimensional indices) are passed to all the nda::Array objects stored in the tuple and the results are then passed to the callable object.
If the arguments contain a range, a new lazy function call expression is returned.
- Template Parameters
-
- Parameters
-
args | Function call arguments. |
- Returns
- The result of the function call (depends on the callable and the arguments).
Definition at line 129 of file map.hpp.
template<typename F , Array... As>
template<typename Arg >
Subscript operator.
The argument (usually a 1-dimensional index) is passed to all the nda::Array objects stored in the tuple and the results are then passed to the callable object.
If the argument is a range, a new lazy function call expression is returned.
- Template Parameters
-
- Parameters
-
- Returns
- The result of the subscript operation (depends on the callable and the arguments).
Definition at line 146 of file map.hpp.