TRIQS/nda 1.3.0
Multi-dimensional array library for C++
|
All the usual arithmetic operations that can be applied to arrays and views.
Arithmetic operations are (mostly) implemented as lazy expressions. That means they do not return the result right away but one of the following proxy objects instead:
+
, -
, *
, /
).These lazy expressions all satisfy the nda::Array concept and can therefore be used to assign to or construct nda::basic_array and nda::basic_array_view objects. Another way to evaluate lazy expressions is with nda::make_regular:
Note that the behavior of the arithmetic operations depends on the algebra of the involved array or view types:
Output:
Classes | |
struct | nda::expr< OP, L, R > |
Lazy binary expression for nda::ArrayOrScalar types. More... | |
struct | nda::expr_unary< OP, A > |
Lazy unary expression for nda::Array types. More... | |
Functions | |
template<Array A, Scalar S> | |
Array auto | nda::operator* (A &&a, S &&s) |
Multiplication operator for an nda::Array and an nda::Scalar. | |
template<Array L, Array R> | |
auto | nda::operator* (L &&l, R &&r) |
Multiplication operator for two nda::Array types. | |
template<Scalar S, Array A> | |
Array auto | nda::operator* (S &&s, A &&a) |
Multiplication operator for an nda::Scalar and an nda::Array. | |
template<Array A, Scalar S> | |
Array auto | nda::operator+ (A &&a, S &&s) |
Addition operator for an nda::Array and an nda::Scalar. | |
template<Array L, Array R> | |
Array auto | nda::operator+ (L &&l, R &&r) |
Addition operator for two nda::Array types. | |
template<Scalar S, Array A> | |
Array auto | nda::operator+ (S &&s, A &&a) |
Addition operator for an nda::Scalar and an nda::Array. | |
template<Array A> | |
expr_unary<'-', A > | nda::operator- (A &&a) |
Unary minus operator for nda::Array types. | |
template<Array A, Scalar S> | |
Array auto | nda::operator- (A &&a, S &&s) |
Subtraction operator for an nda::Array and an nda::Scalar. | |
template<Array L, Array R> | |
Array auto | nda::operator- (L &&l, R &&r) |
Subtraction operator for two nda::Array types. | |
template<Scalar S, Array A> | |
Array auto | nda::operator- (S &&s, A &&a) |
Subtraction operator for an nda::Scalar and an nda::Array. | |
template<Array A, Scalar S> | |
Array auto | nda::operator/ (A &&a, S &&s) |
Division operator for an nda::Array and an nda::Scalar. | |
template<Array L, Array R> | |
Array auto | nda::operator/ (L &&l, R &&r) |
Division operator for two nda::Array types. | |
template<Scalar S, Array A> | |
Array auto | nda::operator/ (S &&s, A &&a) |
Division operator for an nda::Scalar and an nda::Array. | |
Array auto nda::operator* | ( | A && | a, |
S && | s ) |
#include <nda/arithmetic.hpp>
Multiplication operator for an nda::Array and an nda::Scalar.
It performs lazy elementwise multiplication.
A | nda::Array type. |
S | nda::Scalar type. |
a | nda::Array left hand side operand. |
s | nda::Scalar right hand side operand. |
Definition at line 453 of file arithmetic.hpp.
auto nda::operator* | ( | L && | l, |
R && | r ) |
#include <nda/arithmetic.hpp>
Multiplication operator for two nda::Array types.
The input arrays must have one of the following algebras:
Obvious restrictions on the ranks and shapes of the input arrays apply.
L | nda::Array type of left hand side. |
R | nda::Array type of right hand side. |
l | nda::Array left hand side operand. |
r | nda::Array right hand side operand. |
Definition at line 413 of file arithmetic.hpp.
Array auto nda::operator* | ( | S && | s, |
A && | a ) |
#include <nda/arithmetic.hpp>
Multiplication operator for an nda::Scalar and an nda::Array.
It performs elementwise multiplication.
S | nda::Scalar type. |
A | nda::Array type. |
s | nda::Scalar left hand side operand. |
a | nda::Array right hand side operand. |
Definition at line 469 of file arithmetic.hpp.
Array auto nda::operator+ | ( | A && | a, |
S && | s ) |
#include <nda/arithmetic.hpp>
Addition operator for an nda::Array and an nda::Scalar.
Depending on the algebra of the nda::Array, it performs the following lazy operations:
A | nda::Array type. |
S | nda::Scalar type. |
a | nda::Array left hand side operand. |
s | nda::Scalar right hand side operand. |
Definition at line 320 of file arithmetic.hpp.
Array auto nda::operator+ | ( | L && | l, |
R && | r ) |
#include <nda/arithmetic.hpp>
Addition operator for two nda::Array types.
It performs lazy elementwise addition.
L | nda::Array type of left hand side. |
R | nda::Array type of right hand side. |
l | nda::Array left hand side operand. |
r | nda::Array right hand side operand. |
Definition at line 301 of file arithmetic.hpp.
Array auto nda::operator+ | ( | S && | s, |
A && | a ) |
#include <nda/arithmetic.hpp>
Addition operator for an nda::Scalar and an nda::Array.
Depending on the algebra of the nda::Array, it performs the following lazy operations:
S | nda::Scalar type. |
A | nda::Array type. |
s | nda::Scalar left hand side operand. |
a | nda::Array right hand side operand. |
Definition at line 338 of file arithmetic.hpp.
expr_unary<'-', A > nda::operator- | ( | A && | a | ) |
#include <nda/arithmetic.hpp>
Unary minus operator for nda::Array types.
It performs lazy elementwise negation.
A | nda::Array type. |
a | nda::Array operand. |
Definition at line 285 of file arithmetic.hpp.
Array auto nda::operator- | ( | A && | a, |
S && | s ) |
#include <nda/arithmetic.hpp>
Subtraction operator for an nda::Array and an nda::Scalar.
Depending on the algebra of the nda::Array, it performs the following lazy operations:
A | nda::Array type. |
S | nda::Scalar type. |
a | nda::Array left hand side operand. |
s | nda::Scalar right hand side operand. |
Definition at line 373 of file arithmetic.hpp.
Array auto nda::operator- | ( | L && | l, |
R && | r ) |
#include <nda/arithmetic.hpp>
Subtraction operator for two nda::Array types.
It performs lazy elementwise subtraction.
L | nda::Array type of left hand side. |
R | nda::Array type of right hand side. |
l | nda::Array left hand side operand. |
r | nda::Array right hand side operand. |
Definition at line 354 of file arithmetic.hpp.
Array auto nda::operator- | ( | S && | s, |
A && | a ) |
#include <nda/arithmetic.hpp>
Subtraction operator for an nda::Scalar and an nda::Array.
Depending on the algebra of the nda::Array, it performs the following lazy operations:
S | nda::Scalar type. |
A | nda::Array type. |
s | nda::Scalar left hand side operand. |
a | nda::Array right hand side operand. |
Definition at line 391 of file arithmetic.hpp.
Array auto nda::operator/ | ( | A && | a, |
S && | s ) |
#include <nda/arithmetic.hpp>
Division operator for an nda::Array and an nda::Scalar.
It performs lazy elementwise division.
A | nda::Array type. |
S | nda::Scalar type. |
a | nda::Array left hand side operand. |
s | nda::Scalar right hand side operand. |
Definition at line 525 of file arithmetic.hpp.
Array auto nda::operator/ | ( | L && | l, |
R && | r ) |
#include <nda/arithmetic.hpp>
Division operator for two nda::Array types.
The input arrays must have one of the following algebras:
Obvious restrictions on the ranks and shapes of the input arrays apply.
L | nda::Array type of left hand side. |
R | nda::Array type of right hand side. |
l | nda::Array left hand side operand. |
r | nda::Array right hand side operand. |
Definition at line 490 of file arithmetic.hpp.
Array auto nda::operator/ | ( | S && | s, |
A && | a ) |
#include <nda/arithmetic.hpp>
Division operator for an nda::Scalar and an nda::Array.
Depending on the algebra of the nda::Array, it performs the following lazy operations:
S | nda::Scalar type. |
A | nda::Array type. |
s | nda::Scalar left hand side operand. |
a | nda::Array right hand side operand. |
Definition at line 543 of file arithmetic.hpp.