Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::layout_right::mapping< Extents > Class Template Reference

Mapping from row-major multi-indices to linear offsets. More...

#include <ah-mdspan.H>

Public Types

using extents_type = Extents
 
using index_type = typename Extents::index_type
 
using rank_type = typename Extents::rank_type
 
using layout_type = layout_right
 

Public Member Functions

constexpr mapping () noexcept=default
 
constexpr mapping (const Extents &e) noexcept
 
constexpr const extents_type & extents () const noexcept
 
template<class... Indices>
requires (sizeof...(Indices) == Extents::rank())
constexpr index_type operator() (Indices... idxs) const noexcept
 Calculate the flat offset for a multi-dimensional index.
 
constexpr index_type required_span_size () const noexcept
 

Static Public Member Functions

static constexpr bool is_always_unique () noexcept
 
static constexpr bool is_always_exhaustive () noexcept
 
static constexpr bool is_always_strided () noexcept
 

Private Attributes

Extents exts_ {}
 

Detailed Description

template<class Extents>
class Aleph::layout_right::mapping< Extents >

Mapping from row-major multi-indices to linear offsets.

Definition at line 416 of file ah-mdspan.H.

Member Typedef Documentation

◆ extents_type

Definition at line 421 of file ah-mdspan.H.

◆ index_type

template<class Extents >
using Aleph::layout_right::mapping< Extents >::index_type = typename Extents::index_type

Definition at line 422 of file ah-mdspan.H.

◆ layout_type

Definition at line 424 of file ah-mdspan.H.

◆ rank_type

template<class Extents >
using Aleph::layout_right::mapping< Extents >::rank_type = typename Extents::rank_type

Definition at line 423 of file ah-mdspan.H.

Constructor & Destructor Documentation

◆ mapping() [1/2]

template<class Extents >
constexpr Aleph::layout_right::mapping< Extents >::mapping ( )
constexprdefaultnoexcept

◆ mapping() [2/2]

template<class Extents >
constexpr Aleph::layout_right::mapping< Extents >::mapping ( const Extents &  e)
inlineexplicitconstexprnoexcept

Definition at line 427 of file ah-mdspan.H.

Member Function Documentation

◆ extents()

template<class Extents >
constexpr const extents_type & Aleph::layout_right::mapping< Extents >::extents ( ) const
inlineconstexprnoexcept

Definition at line 429 of file ah-mdspan.H.

References Aleph::layout_right::mapping< Extents >::exts_.

◆ is_always_exhaustive()

template<class Extents >
static constexpr bool Aleph::layout_right::mapping< Extents >::is_always_exhaustive ( )
inlinestaticconstexprnoexcept

Definition at line 456 of file ah-mdspan.H.

◆ is_always_strided()

template<class Extents >
static constexpr bool Aleph::layout_right::mapping< Extents >::is_always_strided ( )
inlinestaticconstexprnoexcept

Definition at line 457 of file ah-mdspan.H.

◆ is_always_unique()

template<class Extents >
static constexpr bool Aleph::layout_right::mapping< Extents >::is_always_unique ( )
inlinestaticconstexprnoexcept

Definition at line 455 of file ah-mdspan.H.

◆ operator()()

template<class Extents >
template<class... Indices>
requires (sizeof...(Indices) == Extents::rank())
constexpr index_type Aleph::layout_right::mapping< Extents >::operator() ( Indices...  idxs) const
inlineconstexprnoexcept

Calculate the flat offset for a multi-dimensional index.

Parameters
idxsone index per axis, in rank order.
Returns
The linear memory offset computed in row-major order.
Note
Does not perform bounds checking.

Definition at line 438 of file ah-mdspan.H.

References Aleph::blossom_maximum_cardinality_matching(), Aleph::layout_right::mapping< Extents >::exts_, offset, and r.

◆ required_span_size()

template<class Extents >
constexpr index_type Aleph::layout_right::mapping< Extents >::required_span_size ( ) const
inlineconstexprnoexcept

Member Data Documentation

◆ exts_


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