SpECTRE  v2022.12.02
Index< Dim > Class Template Reference

An integer multi-index. More...

#include <Index.hpp>

Public Member Functions

 Index (const size_t i0=std::numeric_limits< size_t >::max())
 Construct with each element set to the same value.
 
template<typename... I, Requires<(sizeof...(I) > 1)> = nullptr>
 Index (I... i)
 Construct specifying value in each dimension.
 
 Index (std::array< size_t, Dim > i)
 
size_t operator[] (const size_t d) const
 
size_t & operator[] (const size_t d)
 
std::array< size_t, Dim >::iterator begin ()
 
std::array< size_t, Dim >::const_iterator begin () const
 
std::array< size_t, Dim >::iterator end ()
 
std::array< size_t, Dim >::const_iterator end () const
 
size_t size () const
 
template<int N = Dim, Requires<(N > 0)> = nullptr>
constexpr size_t product () const
 The product of the indices. If Dim = 0, the product is defined as 1.
 
template<size_t N = Dim, Requires<(N > 0)> = nullptr>
Index< Dim - 1 > slice_away (const size_t d) const
 Return a smaller Index with the d-th element removed. More...
 
const size_t * data () const
 
size_t * data ()
 
const std::array< size_t, Dim > & indices () const
 

Friends

template<size_t N>
std::ostreamoperator<< (std::ostream &os, const Index< N > &i)
 

Detailed Description

template<size_t Dim>
class Index< Dim >

An integer multi-index.

Template Parameters
Dimthe number of integers in the Index.

Member Function Documentation

◆ slice_away()

template<size_t Dim>
template<size_t N = Dim, Requires<(N > 0)> = nullptr>
Index< Dim - 1 > Index< Dim >::slice_away ( const size_t  d) const
inline

Return a smaller Index with the d-th element removed.

Parameters
dthe element to remove.

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