TRIQS/nda 1.3.0
Multi-dimensional array library for C++
Loading...
Searching...
No Matches
nda::array_adapter< R, F >

#include <nda/array_adapter.hpp>

Detailed Description

template<int R, typename F>
class nda::array_adapter< R, F >

Adapter that consists of a shape and a callable object, which takes R integers as arguments (just like an nda::basic_array or nda::basic_array_view).

Template Parameters
RRank of the adapter.
FCallable type.

Definition at line 45 of file array_adapter.hpp.

Public Member Functions

template<typename Int >
 array_adapter (std::array< Int, R > const &shape, F f)
 Construct a new array adapter object.
 
template<typename... Ints>
auto operator() (long i0, Ints... is) const
 Function call operator simply forwards the arguments to the callable object.
 
auto const & shape () const
 Get shape of the adapter.
 
long size () const
 Get the total size of the adapter.
 

Constructor & Destructor Documentation

◆ array_adapter()

template<int R, typename F >
template<typename Int >
nda::array_adapter< R, F >::array_adapter ( std::array< Int, R > const & shape,
F f )
inline

Construct a new array adapter object.

Template Parameters
IntInteger type.
Parameters
shapeShape of the adapater.
fCallable object.

Definition at line 63 of file array_adapter.hpp.

Member Function Documentation

◆ operator()()

template<int R, typename F >
template<typename... Ints>
auto nda::array_adapter< R, F >::operator() ( long i0,
Ints... is ) const
inline

Function call operator simply forwards the arguments to the callable object.

Template Parameters
IntsInteger types (convertible to long).
Parameters
i0First argument.
isRest of the arguments.

Definition at line 85 of file array_adapter.hpp.

◆ shape()

template<int R, typename F >
auto const & nda::array_adapter< R, F >::shape ( ) const
inlinenodiscard

Get shape of the adapter.

Returns
std::array<long, R> object specifying the shape of the adapter.

Definition at line 69 of file array_adapter.hpp.

◆ size()

template<int R, typename F >
long nda::array_adapter< R, F >::size ( ) const
inlinenodiscard

Get the total size of the adapter.

Returns
Number of elements in the adapter.

Definition at line 75 of file array_adapter.hpp.


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