TRIQS/nda 1.3.0
Multi-dimensional array library for C++
|
Various mathematical functions that can be applied to arrays and views.
Mathematical functions are (mostly) implemented as lazy expressions. That means they do not return the result right away but the following proxy object instead:
This lazy function call expression satisfies 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:
Output:
Classes | |
struct | nda::conj_f |
Wrapper for nda::conj. More... | |
struct | nda::expr_call< F, As > |
A lazy function call expression on arrays/views. More... | |
struct | nda::mapped< F > |
Functor that is returned by the nda::map function. More... | |
Functions | |
template<Array A> | |
auto | nda::abs (A &&a) |
Lazy, coefficient-wise abs function for nda::Array types. | |
template<Array A> | |
auto | nda::abs2 (A &&a) |
Lazy, coefficient-wise abs2 function for nda::Array types. | |
double | nda::abs2 (double x) |
Get the squared absolute value of a double. | |
double | nda::abs2 (std::complex< double > z) |
Get the squared absolute value of a std::complex<double>. | |
template<Array A> requires (get_algebra<A> != 'M') | |
auto | nda::acos (A &&a) |
Lazy, coefficient-wise acos function for non-matrix nda::Array types. | |
template<Array A> requires (get_algebra<A> != 'M') | |
auto | nda::asin (A &&a) |
Lazy, coefficient-wise asin function for non-matrix nda::Array types. | |
template<Array A> requires (get_algebra<A> != 'M') | |
auto | nda::atan (A &&a) |
Lazy, coefficient-wise atan function for non-matrix nda::Array types. | |
template<Array A> | |
decltype(auto) | nda::conj (A &&a) |
Lazy, coefficient-wise complex conjugate function for nda::Array types. | |
template<typename T > requires (nda::is_scalar_v<T>) | |
auto | nda::conj (T t) |
Get the complex conjugate of a scalar. | |
template<Array A> requires (get_algebra<A> != 'M') | |
auto | nda::cos (A &&a) |
Lazy, coefficient-wise cos function for non-matrix nda::Array types. | |
template<Array A> requires (get_algebra<A> != 'M') | |
auto | nda::cosh (A &&a) |
Lazy, coefficient-wise cosh function for non-matrix nda::Array types. | |
template<ArrayOfRank< 2 > M> | |
ArrayOfRank< 2 > auto | nda::dagger (M const &m) |
Get the conjugate transpose of 2-dimensional array/view. | |
template<Array A> requires (get_algebra<A> != 'M') | |
auto | nda::exp (A &&a) |
Lazy, coefficient-wise exp function for non-matrix nda::Array types. | |
template<Array A> | |
auto | nda::floor (A &&a) |
Lazy, coefficient-wise floor function for nda::Array types. | |
template<ArrayOfRank< 2 > A> | |
double | nda::frobenius_norm (A const &a) |
Calculate the Frobenius norm of a 2-dimensional array. | |
template<Array A> | |
auto | nda::imag (A &&a) |
Lazy, coefficient-wise imag function for nda::Array types. | |
template<Array A> | |
auto | nda::isnan (A &&a) |
Lazy, coefficient-wise isnan function for nda::Array types. | |
bool | nda::isnan (std::complex< double > const &z) |
Check if a std::complex<double> is NaN. | |
template<Array A> requires (get_algebra<A> != 'M') | |
auto | nda::log (A &&a) |
Lazy, coefficient-wise log function for non-matrix nda::Array types. | |
template<class F > | |
mapped< F > | nda::map (F f) |
Create a lazy function call expression on arrays/views. | |
template<Array A> | |
auto | nda::pow (A &&a, double p) |
Lazy, coefficient-wise power function for nda::Array types. | |
template<typename T > requires (std::is_integral_v<T>) | |
T | nda::pow (T x, int n) |
Calculate the integer power of an integer. | |
template<Array A> | |
auto | nda::real (A &&a) |
Lazy, coefficient-wise real function for nda::Array types. | |
template<typename T > requires (nda::is_scalar_v<T>) | |
auto | nda::real (T t) |
Get the real part of a scalar. | |
template<Array A> requires (get_algebra<A> != 'M') | |
auto | nda::sin (A &&a) |
Lazy, coefficient-wise sin function for non-matrix nda::Array types. | |
template<Array A> requires (get_algebra<A> != 'M') | |
auto | nda::sinh (A &&a) |
Lazy, coefficient-wise sinh function for non-matrix nda::Array types. | |
template<Array A> requires (get_algebra<A> != 'M') | |
auto | nda::sqrt (A &&a) |
Lazy, coefficient-wise sqrt function for non-matrix nda::Array types. | |
template<Array A> requires (get_algebra<A> != 'M') | |
auto | nda::tan (A &&a) |
Lazy, coefficient-wise tan function for non-matrix nda::Array types. | |
template<Array A> requires (get_algebra<A> != 'M') | |
auto | nda::tanh (A &&a) |
Lazy, coefficient-wise tanh function for non-matrix nda::Array types. | |
template<ArrayOfRank< 2 > M> | |
auto | nda::trace (M const &m) |
Get the trace of a 2-dimensional square array/view. | |
auto nda::abs | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise abs function for nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 95 of file mapped_functions.hxx.
auto nda::abs2 | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise abs2 function for nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 148 of file mapped_functions.hxx.
|
inline |
#include <nda/mapped_functions.hpp>
Get the squared absolute value of a double.
x | Double value. |
Definition at line 83 of file mapped_functions.hpp.
|
inline |
#include <nda/mapped_functions.hpp>
Get the squared absolute value of a std::complex<double>.
z | std::complex<double> value. |
Definition at line 91 of file mapped_functions.hpp.
auto nda::acos | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise acos function for non-matrix nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 268 of file mapped_functions.hxx.
auto nda::asin | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise asin function for non-matrix nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 282 of file mapped_functions.hxx.
auto nda::atan | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise atan function for non-matrix nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 296 of file mapped_functions.hxx.
decltype(auto) nda::conj | ( | A && | a | ) |
#include <nda/mapped_functions.hpp>
Lazy, coefficient-wise complex conjugate function for nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 148 of file mapped_functions.hpp.
auto nda::conj | ( | T | t | ) |
#include <nda/mapped_functions.hpp>
Get the complex conjugate of a scalar.
T | Scalar type. |
t | Scalar value. |
Definition at line 67 of file mapped_functions.hpp.
auto nda::cos | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise cos function for non-matrix nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 184 of file mapped_functions.hxx.
auto nda::cosh | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise cosh function for non-matrix nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 226 of file mapped_functions.hxx.
ArrayOfRank< 2 > auto nda::dagger | ( | M const & | m | ) |
#include <nda/matrix_functions.hpp>
Get the conjugate transpose of 2-dimensional array/view.
It first calls nda::transpose and then the lazy nda::conj function in case the array/view is complex valued.
M | nda::ArrayOfRank<2> type. |
m | 2-dimensional array/view. |
Definition at line 91 of file matrix_functions.hpp.
auto nda::exp | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise exp function for non-matrix nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 170 of file mapped_functions.hxx.
auto nda::floor | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise floor function for nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 123 of file mapped_functions.hxx.
double nda::frobenius_norm | ( | A const & | a | ) |
#include <nda/algorithms.hpp>
Calculate the Frobenius norm of a 2-dimensional array.
A | nda::ArrayOfRank<2> type. |
a | Array object. |
Definition at line 165 of file algorithms.hpp.
auto nda::imag | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise imag function for nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 109 of file mapped_functions.hxx.
auto nda::isnan | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise isnan function for nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 159 of file mapped_functions.hxx.
|
inline |
#include <nda/mapped_functions.hpp>
Check if a std::complex<double> is NaN.
z | std::complex<double> value. |
NaN
, false otherwise. Definition at line 99 of file mapped_functions.hpp.
auto nda::log | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise log function for non-matrix nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 310 of file mapped_functions.hxx.
mapped< F > nda::map | ( | F | f | ) |
#include <nda/map.hpp>
Create a lazy function call expression on arrays/views.
The callable should take the array/view elements as arguments.
F | Callable type. |
f | Callable object. |
auto nda::pow | ( | A && | a, |
double | p ) |
#include <nda/mapped_functions.hpp>
Lazy, coefficient-wise power function for nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
p | Exponent value. |
Definition at line 127 of file mapped_functions.hpp.
T nda::pow | ( | T | x, |
int | n ) |
#include <nda/mapped_functions.hpp>
Calculate the integer power of an integer.
T | Integer type. |
x | Base value. |
n | Exponent value. |
Definition at line 110 of file mapped_functions.hpp.
auto nda::real | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise real function for nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 137 of file mapped_functions.hxx.
auto nda::real | ( | T | t | ) |
#include <nda/mapped_functions.hpp>
Get the real part of a scalar.
T | Scalar type. |
t | Scalar value. |
Definition at line 49 of file mapped_functions.hpp.
auto nda::sin | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise sin function for non-matrix nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 198 of file mapped_functions.hxx.
auto nda::sinh | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise sinh function for non-matrix nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 240 of file mapped_functions.hxx.
auto nda::sqrt | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise sqrt function for non-matrix nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 324 of file mapped_functions.hxx.
auto nda::tan | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise tan function for non-matrix nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 212 of file mapped_functions.hxx.
auto nda::tanh | ( | A && | a | ) |
#include <nda/mapped_functions.hxx>
Lazy, coefficient-wise tanh function for non-matrix nda::Array types.
A | nda::Array type. |
a | nda::Array object. |
Definition at line 254 of file mapped_functions.hxx.
auto nda::trace | ( | M const & | m | ) |
#include <nda/matrix_functions.hpp>
Get the trace of a 2-dimensional square array/view.
M | nda::ArrayOfRank<2> type. |
m | 2-dimensional array/view. |
Definition at line 70 of file matrix_functions.hpp.