TRIQS/nda 1.3.0
Multi-dimensional array library for C++
Loading...
Searching...
No Matches
nda::expr_unary< OP, A >

#include <nda/arithmetic.hpp>

Detailed Description

template<char OP, Array A>
struct nda::expr_unary< OP, A >

Lazy unary expression for nda::Array types.

A lazy unary expression contains a single operand and a unary operation. It fulfills the nda::Array concept and can therefore be used in any other expression or function that expects an nda::Array type.

The only supported unary operation is the negation operation ('-').

Template Parameters
OPChar representing the unary operation.
Parameters
Anda::Array type.

Definition at line 59 of file arithmetic.hpp.

Public Member Functions

template<typename... Args>
auto operator() (Args &&...args) const
 Function call operator.
 
constexpr auto shape () const
 Get the shape of the nda::Array operand.
 
constexpr long size () const
 Get the total size of the nda::Array operand.
 

Public Attributes

a
 nda::Array object.
 

Member Function Documentation

◆ operator()()

template<char OP, Array A>
template<typename... Args>
auto nda::expr_unary< OP, A >::operator() ( Args &&... args) const
inline

Function call operator.

Forwards the arguments to the nda::Array operand and negates the result.

Template Parameters
ArgsTypes of the arguments.
Parameters
argsFunction call arguments.
Returns
If the result of the forwarded function call is another nda::Array, a new lazy expression is returned. Otherwise the result is negated and returned.

Definition at line 76 of file arithmetic.hpp.

◆ shape()

template<char OP, Array A>
auto nda::expr_unary< OP, A >::shape ( ) const
inlinenodiscardconstexpr

Get the shape of the nda::Array operand.

Returns
std::array<long, Rank> object specifying the shape of the operand.

Definition at line 84 of file arithmetic.hpp.

◆ size()

template<char OP, Array A>
long nda::expr_unary< OP, A >::size ( ) const
inlinenodiscardconstexpr

Get the total size of the nda::Array operand.

Returns
Number of elements contained in the operand.

Definition at line 90 of file arithmetic.hpp.


The documentation for this struct was generated from the following file: