ARTS 2.5.4 (git: 4c0d3b4d)
Grid< b, n > Class Template Reference

Row-major grid creation. More...

#include <grids.h>

Public Types

using base = b
 

Public Member Functions

template<typename... Inds>
 Grid (Inds... inds) noexcept
 
 Grid (Grid &&g) noexcept
 
Gridoperator= (Grid &&g) noexcept
 
template<typename... Inds>
baseoperator() (Inds... inds) noexcept
 
template<typename... Inds>
const baseoperator() (Inds... inds) const noexcept
 
baseoperator[] (std::size_t ind) noexcept
 
const baseoperator[] (std::size_t ind) const noexcept
 

Static Public Attributes

static constexpr std::size_t N = n
 

Private Member Functions

std::size_t size () const noexcept
 

Private Attributes

std::vector< bptr
 
std::array< std::size_t, n > gridsize
 

Friends

std::ostream & operator<< (std::ostream &os, const Grid &g)
 

Detailed Description

template<typename b, std::size_t n>
class Grid< b, n >

Row-major grid creation.

Definition at line 52 of file grids.h.

Member Typedef Documentation

◆ base

template<typename b , std::size_t n>
using Grid< b, n >::base = b

Base unit of the Grid

Definition at line 67 of file grids.h.

Constructor & Destructor Documentation

◆ Grid() [1/2]

template<typename b , std::size_t n>
template<typename... Inds>
Grid< b, n >::Grid ( Inds...  inds)
inlinenoexcept

Initialization of grid with size of the input list of indices

Definition at line 73 of file grids.h.

References Grid< b, n >::N.

◆ Grid() [2/2]

template<typename b , std::size_t n>
Grid< b, n >::Grid ( Grid< b, n > &&  g)
inlinenoexcept

Move initialization

Definition at line 79 of file grids.h.

Member Function Documentation

◆ operator()() [1/2]

template<typename b , std::size_t n>
template<typename... Inds>
const base & Grid< b, n >::operator() ( Inds...  inds) const
inlinenoexcept

Access operator

Definition at line 96 of file grids.h.

References Grid< b, n >::gridsize, index_from_gridsize(), and Grid< b, n >::ptr.

◆ operator()() [2/2]

template<typename b , std::size_t n>
template<typename... Inds>
base & Grid< b, n >::operator() ( Inds...  inds)
inlinenoexcept

Access operator

Definition at line 90 of file grids.h.

References Grid< b, n >::gridsize, index_from_gridsize(), and Grid< b, n >::ptr.

◆ operator=()

template<typename b , std::size_t n>
Grid & Grid< b, n >::operator= ( Grid< b, n > &&  g)
inlinenoexcept

Move and set operator

Definition at line 82 of file grids.h.

References Grid< b, n >::gridsize, and Grid< b, n >::ptr.

◆ operator[]() [1/2]

template<typename b , std::size_t n>
const base & Grid< b, n >::operator[] ( std::size_t  ind) const
inlinenoexcept

Access operator for VectorType

Definition at line 107 of file grids.h.

References Grid< b, n >::N, and Grid< b, n >::ptr.

◆ operator[]() [2/2]

template<typename b , std::size_t n>
base & Grid< b, n >::operator[] ( std::size_t  ind)
inlinenoexcept

Access operator for VectorType

Definition at line 101 of file grids.h.

References Grid< b, n >::N, and Grid< b, n >::ptr.

◆ size()

template<typename b , std::size_t n>
std::size_t Grid< b, n >::size ( ) const
inlineprivatenoexcept

Number of elements in total

Definition at line 60 of file grids.h.

References Grid< b, n >::ptr.

Friends And Related Function Documentation

◆ operator<<

template<typename b , std::size_t n>
std::ostream & operator<< ( std::ostream &  os,
const Grid< b, n > &  g 
)
friend

Friendly stream operator

Definition at line 113 of file grids.h.

Member Data Documentation

◆ gridsize

template<typename b , std::size_t n>
std::array<std::size_t, n> Grid< b, n >::gridsize
private

List of sizes of the grid so that the numbers represent the stepping

Definition at line 57 of file grids.h.

Referenced by Grid< b, n >::operator()(), and Grid< b, n >::operator=().

◆ N

template<typename b , std::size_t n>
constexpr std::size_t Grid< b, n >::N = n
staticconstexpr

Number of dimensions

Definition at line 64 of file grids.h.

Referenced by Grid< b, n >::Grid(), and Grid< b, n >::operator[]().

◆ ptr

template<typename b , std::size_t n>
std::vector<b> Grid< b, n >::ptr
private

List of values

Definition at line 54 of file grids.h.

Referenced by Grid< b, n >::operator()(), Grid< b, n >::operator=(), Grid< b, n >::operator[](), and Grid< b, n >::size().


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