TRIQS/nda 1.3.0
Multi-dimensional array library for C++
|
Classes that represent lazy expressions, functions and operations.
Functions | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::abs (A &&...__a) |
Lazy version of std::abs. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::acos (A &&...__a) |
Lazy version of std::acos. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::asin (A &&...__a) |
Lazy version of std::asin. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::atan (A &&...__a) |
Lazy version of std::atan. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::conj (A &&...__a) |
Lazy version of std::conj. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::cos (A &&...__a) |
Lazy version of std::cos. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::cosh (A &&...__a) |
Lazy version of std::cosh. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::exp (A &&...__a) |
Lazy version of std::exp. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::floor (A &&...__a) |
Lazy version of std::floor. | |
template<typename C , typename A , typename B > | |
__inline__ auto | nda::clef::if_else (C &&c, A &&a, B &&b) |
Create a lazy ternary (if-else) expression. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::log (A &&...__a) |
Lazy version of std::log. | |
template<typename T > | |
auto | nda::clef::make_expr (T &&t) |
Create a terminal expression node of an object. | |
template<typename F , typename... Args> requires (is_any_lazy<Args...>) | |
auto | nda::clef::make_expr_call (F &&f, Args &&...args) |
Create a function call expression from a callable object and a list of arguments. | |
template<typename T > | |
auto | nda::clef::make_expr_from_clone (T &&t) |
Create a terminal expression node of an object. | |
template<typename T , typename... Args> requires (is_any_lazy<Args...>) | |
auto | nda::clef::make_expr_subscript (T &&t, Args &&...args) |
Create a subscript expression from an object and a list of arguments. | |
template<typename T , typename... Phs> | |
__inline__ auto | nda::clef::make_function (T &&obj, Phs...) |
Factory function for nda::clef::make_fun_impl objects. | |
template<typename Tag , typename... Args> | |
__inline__ decltype(auto) | nda::clef::op_dispatch (std::false_type, Args &&...args) |
Dispatch operations containing only non-lazy operands. | |
template<typename Tag , typename... Args> | |
__inline__ auto | nda::clef::op_dispatch (std::true_type, Args &&...args) |
Dispatch operations containing at least one lazy operand. | |
template<typename L > requires (is_any_lazy<L>) | |
__inline__ auto | nda::clef::operator! (L &&l) |
Implementation of the lazy unary ! operation. | |
template<typename L , typename R > requires (is_any_lazy<L, R>) | |
__inline__ auto | nda::clef::operator* (L &&l, R &&r) |
Implementation of the lazy binary * operation. | |
template<typename L > requires (is_any_lazy<L>) | |
__inline__ auto | nda::clef::operator+ (L &&l) |
Implementation of the lazy unary + operation. | |
template<typename L , typename R > requires (is_any_lazy<L, R>) | |
__inline__ auto | nda::clef::operator+ (L &&l, R &&r) |
Implementation of the lazy binary + operation. | |
template<typename L > requires (is_any_lazy<L>) | |
__inline__ auto | nda::clef::operator- (L &&l) |
Implementation of the lazy unary - operation. | |
template<typename L , typename R > requires (is_any_lazy<L, R>) | |
__inline__ auto | nda::clef::operator- (L &&l, R &&r) |
Implementation of the lazy binary - operation. | |
template<typename L , typename R > requires (is_any_lazy<L, R>) | |
__inline__ auto | nda::clef::operator/ (L &&l, R &&r) |
Implementation of the lazy binary / operation. | |
template<typename L , typename R > requires (is_any_lazy<L, R>) | |
__inline__ auto | nda::clef::operator< (L &&l, R &&r) |
Implementation of the lazy binary < operation. | |
template<typename L , typename R > requires (is_any_lazy<L, R>) | |
__inline__ auto | nda::clef::operator<= (L &&l, R &&r) |
Implementation of the lazy binary <= operation. | |
template<typename L , typename R > requires (is_any_lazy<L, R>) | |
__inline__ auto | nda::clef::operator== (L &&l, R &&r) |
Implementation of the lazy binary == operation. | |
template<typename L , typename R > requires (is_any_lazy<L, R>) | |
__inline__ auto | nda::clef::operator> (L &&l, R &&r) |
Implementation of the lazy binary > operation. | |
template<typename L , typename R > requires (is_any_lazy<L, R>) | |
__inline__ auto | nda::clef::operator>= (L &&l, R &&r) |
Implementation of the lazy binary >= operation. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::pow (A &&...__a) |
Lazy version of std::pow. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::sin (A &&...__a) |
Lazy version of std::sin. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::sinh (A &&...__a) |
Lazy version of std::sinh. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::sqrt (A &&...__a) |
Lazy version of std::sqrt. | |
template<typename Expr , int N, typename D > | |
decltype(auto) | nda::clef::sum (Expr const &ex, clef::pair< N, D > d) |
Sum an expression over a 1-dimensional domain. | |
template<typename Expr , typename D0 , typename D1 , typename... Ds> | |
auto | nda::clef::sum (Expr const &ex, D0 &&d0, D1 &&d1, Ds &&...ds) |
Sum an expression over a multi-dimensional domain. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::tan (A &&...__a) |
Lazy version of std::tan. | |
template<typename... A> requires (nda::clef::is_any_lazy<A...>) | |
auto | nda::clef::tanh (A &&...__a) |
Lazy version of std::tanh. | |
__inline__ auto nda::clef::if_else | ( | C && | c, |
A && | a, | ||
B && | b ) |
#include <nda/clef/operation.hpp>
Create a lazy ternary (if-else) expression.
C | Type of the conditional expression. |
A | Type of the return expression when the condition is true. |
B | Type of the return expression when the condition is false. |
c | Conditional expression. |
a | Return expression when the condition is true. |
b | Return expression when the condition is false. |
Definition at line 222 of file operation.hpp.
auto nda::clef::make_expr | ( | T && | t | ) |
#include <nda/clef/make_lazy.hpp>
Create a terminal expression node of an object.
T | Type of the object. |
t | Given object. |
Definition at line 45 of file make_lazy.hpp.
auto nda::clef::make_expr_call | ( | F && | f, |
Args &&... | args ) |
#include <nda/clef/make_lazy.hpp>
Create a function call expression from a callable object and a list of arguments.
Note that this is equivalent to nda::clef::make_expr(t)(args...)
.
F | Type of the callable object. |
Args | Types of the arguments. |
f | Callable object. |
args | Function arguments. |
Definition at line 74 of file make_lazy.hpp.
auto nda::clef::make_expr_from_clone | ( | T && | t | ) |
#include <nda/clef/make_lazy.hpp>
Create a terminal expression node of an object.
T | Type of the object. |
t | Given object. |
Definition at line 57 of file make_lazy.hpp.
auto nda::clef::make_expr_subscript | ( | T && | t, |
Args &&... | args ) |
#include <nda/clef/make_lazy.hpp>
Create a subscript expression from an object and a list of arguments.
Note that this is equivalent to nda::clef::make_expr(t)[args...]
.
T | Type of the object to be subscripted. |
Args | Types of the arguments. |
t | Object to be subscripted. |
args | Subscript arguments. |
Definition at line 93 of file make_lazy.hpp.
__inline__ auto nda::clef::make_function | ( | T && | obj, |
Phs... | ) |
#include <nda/clef/function.hpp>
Factory function for nda::clef::make_fun_impl objects.
The given arguments are used to construct a new nda::clef::make_fun_impl object. The first argument is forwarded to its constructor and the integer labels of the remaining placeholder arguments are used in its template argument list.
The following example shows how to turn a binary lazy expression ex
into a callable object f
that takes two arguments:
T | Type of the object. |
Phs | Types of the placeholders. |
obj | Object to be stored in the nda::clef::make_fun_impl object. |
Definition at line 100 of file function.hpp.
__inline__ decltype(auto) nda::clef::op_dispatch | ( | std::false_type | , |
Args &&... | args ) |
#include <nda/clef/operation.hpp>
Dispatch operations containing only non-lazy operands.
Since all operands are non-lazy, the operation is performed immediately by calling the corresponding nda::clef::operation with the forwarded operands.
Tag | Tag of the operation. |
Args | Types of the operands. |
args | Operands. |
Definition at line 255 of file operation.hpp.
__inline__ auto nda::clef::op_dispatch | ( | std::true_type | , |
Args &&... | args ) |
#include <nda/clef/operation.hpp>
Dispatch operations containing at least one lazy operand.
Since at least one operand is lazy, the operation is not performed immediately. Instead, a new nda::clef::expr object is created with the given operation and operands.
Tag | Tag of the operation. |
Args | Types of the operands. |
args | Operands. |
Definition at line 239 of file operation.hpp.
decltype(auto) nda::clef::sum | ( | Expr const & | ex, |
clef::pair< N, D > | d ) |
#include <nda/clef/sum.hpp>
Sum an expression over a 1-dimensional domain.
The following example sums the squared elements of a vector:
Expr | Type of the expression. |
N | Integer label of the placeholder to be replaced by the domain. |
D | Type of the domain. |
ex | Lazy expression. |
d | Pair containing the nda::clef::placeholder and the domain. |
auto nda::clef::sum | ( | Expr const & | ex, |
D0 && | d0, | ||
D1 && | d1, | ||
Ds &&... | ds ) |
#include <nda/clef/sum.hpp>
Sum an expression over a multi-dimensional domain.
The following example sums an expression over a 2-dimensional domain:
Expr | Type of the expression. |
D0 | nda::clef::pair type. |
D1 | nda::clef::pair type. |
Ds | Parameter pack of the remaining nda::clef::pair types. |
ex | Lazy expression. |
d0 | Pair containing an nda::clef::placeholder and a domain. |
d1 | Pair containing an nda::clef::placeholder and another domain. |
ds | Parameter pack of the remaining pairs. |