DDC 0.0.0

a discrete domain computation library

ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy > Class Template Reference
Inheritance diagram for ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >:
Inheritance graph

Public Types

using mdomain_type = DiscreteDomain< DDims... >
 
using allocation_mdspan_type = std::experimental::mdspan< ElementType, std::experimental::dextents< sizeof...(DDims)>, LayoutStridedPolicy >
 The dereferenceable part of the co-domain but with a different domain, starting at 0. More...
 
using const_allocation_mdspan_type = std::experimental::mdspan< const ElementType, std::experimental::dextents< sizeof...(DDims)>, LayoutStridedPolicy >
 
using discrete_element_type = typename mdomain_type::discrete_element_type
 
using extents_type = typename allocation_mdspan_type::extents_type
 
using layout_type = typename allocation_mdspan_type::layout_type
 
using accessor_type = typename allocation_mdspan_type::accessor_type
 
using mapping_type = typename allocation_mdspan_type::mapping_type
 
using element_type = typename allocation_mdspan_type::element_type
 
using value_type = typename allocation_mdspan_type::value_type
 
using size_type = typename allocation_mdspan_type::size_type
 
using difference_type = typename allocation_mdspan_type::difference_type
 
using pointer = typename allocation_mdspan_type::pointer
 
using reference = typename allocation_mdspan_type::reference
 

Public Member Functions

constexpr accessor_type accessor () const
 
constexpr DiscreteVector< DDims... > extents () const noexcept
 
template<class QueryDDim >
constexpr size_type extent () const noexcept
 
constexpr size_type size () const noexcept
 
constexpr mapping_type mapping () const noexcept
 
constexpr bool is_unique () const noexcept
 
constexpr bool is_contiguous () const noexcept
 
constexpr bool is_strided () const noexcept
 
template<class QueryDDim >
constexpr size_type stride () const
 
constexpr mdomain_type domain () const noexcept
 Provide access to the domain on which this chunk is defined. More...
 
template<class... QueryDDims>
constexpr DiscreteDomain< QueryDDims... > domain () const noexcept
 Provide access to the domain on which this chunk is defined. More...
 

Static Public Member Functions

static constexpr int rank () noexcept
 
static constexpr int rank_dynamic () noexcept
 
static constexpr size_type static_extent (std::size_t r) noexcept
 
static constexpr bool is_always_unique () noexcept
 
static constexpr bool is_always_contiguous () noexcept
 
static constexpr bool is_always_strided () noexcept
 

Protected Types

using internal_mdspan_type = std::experimental::mdspan< ElementType, std::experimental::dextents< sizeof...(DDims)>, std::experimental::layout_stride >
 the raw mdspan underlying this, with the same indexing (0 might no be dereferenceable) More...
 

Protected Member Functions

constexpr ChunkCommon ()=default
 Empty ChunkCommon. More...
 
constexpr ChunkCommon (internal_mdspan_type internal_mdspan, mdomain_type const &domain) noexcept
 Constructs a new ChunkCommon from scratch. More...
 
template<class Mapping = mapping_type, std::enable_if_t< std::is_constructible_v< Mapping, extents_type >, int > = 0>
constexpr ChunkCommon (ElementType *ptr, mdomain_type const &domain)
 Constructs a new ChunkCommon from scratch. More...
 
constexpr ChunkCommon (ChunkCommon const &other)=default
 Constructs a new ChunkCommon by copy, yields a new view to the same data. More...
 
constexpr ChunkCommon (ChunkCommon &&other)=default
 Constructs a new ChunkCommon by move. More...
 
constexpr ChunkCommonoperator= (ChunkCommon const &other)=default
 Copy-assigns a new value to this ChunkCommon, yields a new view to the same data. More...
 
constexpr ChunkCommonoperator= (ChunkCommon &&other)=default
 Move-assigns a new value to this ChunkCommon. More...
 
constexpr ElementType * data () const
 Access to the underlying allocation pointer. More...
 
constexpr internal_mdspan_type internal_mdspan () const
 Provide a modifiable view of the data. More...
 
constexpr allocation_mdspan_type allocation_mdspan () const
 Provide a modifiable view of the data. More...
 

Protected Attributes

internal_mdspan_type m_internal_mdspan
 The raw view of the data. More...
 
mdomain_type m_domain
 The mesh on which this chunk is defined. More...
 

Friends

template<class , class , class >
class ChunkCommon
 
template<class , class , class , class >
class ChunkSpan
 
template<class , class , class >
class Chunk
 

Member Typedef Documentation

◆ internal_mdspan_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::internal_mdspan_type = std::experimental::mdspan< ElementType, std::experimental::dextents<sizeof...(DDims)>, std::experimental::layout_stride>
protected

the raw mdspan underlying this, with the same indexing (0 might no be dereferenceable)

◆ mdomain_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::mdomain_type = DiscreteDomain<DDims...>

◆ allocation_mdspan_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::allocation_mdspan_type = std::experimental:: mdspan<ElementType, std::experimental::dextents<sizeof...(DDims)>, LayoutStridedPolicy>

The dereferenceable part of the co-domain but with a different domain, starting at 0.

◆ const_allocation_mdspan_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::const_allocation_mdspan_type = std::experimental::mdspan< const ElementType, std::experimental::dextents<sizeof...(DDims)>, LayoutStridedPolicy>

◆ discrete_element_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::discrete_element_type = typename mdomain_type::discrete_element_type

◆ extents_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::extents_type = typename allocation_mdspan_type::extents_type

◆ layout_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::layout_type = typename allocation_mdspan_type::layout_type

◆ accessor_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::accessor_type = typename allocation_mdspan_type::accessor_type

◆ mapping_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::mapping_type = typename allocation_mdspan_type::mapping_type

◆ element_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::element_type = typename allocation_mdspan_type::element_type

◆ value_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::value_type = typename allocation_mdspan_type::value_type

◆ size_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::size_type = typename allocation_mdspan_type::size_type

◆ difference_type

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::difference_type = typename allocation_mdspan_type::difference_type

◆ pointer

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::pointer = typename allocation_mdspan_type::pointer

◆ reference

template<class ElementType , class... DDims, class LayoutStridedPolicy >
using ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::reference = typename allocation_mdspan_type::reference

Constructor & Destructor Documentation

◆ ChunkCommon() [1/5]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::ChunkCommon ( )
constexprprotecteddefault

Empty ChunkCommon.

◆ ChunkCommon() [2/5]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::ChunkCommon ( internal_mdspan_type  internal_mdspan,
mdomain_type const &  domain 
)
inlineconstexprprotectednoexcept

Constructs a new ChunkCommon from scratch.

Parameters
internal_mdspan
domain

◆ ChunkCommon() [3/5]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
template<class Mapping = mapping_type, std::enable_if_t< std::is_constructible_v< Mapping, extents_type >, int > = 0>
constexpr ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::ChunkCommon ( ElementType *  ptr,
mdomain_type const &  domain 
)
inlineconstexprprotected

Constructs a new ChunkCommon from scratch.

Parameters
ptrthe allocation pointer to the data
domainthe domain that sustains the view

◆ ChunkCommon() [4/5]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::ChunkCommon ( ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy > const &  other)
constexprprotecteddefault

Constructs a new ChunkCommon by copy, yields a new view to the same data.

Parameters
otherthe ChunkCommon to copy

◆ ChunkCommon() [5/5]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::ChunkCommon ( ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy > &&  other)
constexprprotecteddefault

Constructs a new ChunkCommon by move.

Parameters
otherthe ChunkCommon to move

Member Function Documentation

◆ rank()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
static constexpr int ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::rank ( )
inlinestaticconstexprnoexcept

◆ rank_dynamic()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
static constexpr int ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::rank_dynamic ( )
inlinestaticconstexprnoexcept

◆ static_extent()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
static constexpr size_type ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::static_extent ( std::size_t  r)
inlinestaticconstexprnoexcept

◆ is_always_unique()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
static constexpr bool ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::is_always_unique ( )
inlinestaticconstexprnoexcept

◆ is_always_contiguous()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
static constexpr bool ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::is_always_contiguous ( )
inlinestaticconstexprnoexcept

◆ is_always_strided()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
static constexpr bool ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::is_always_strided ( )
inlinestaticconstexprnoexcept

◆ accessor()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr accessor_type ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::accessor ( ) const
inlineconstexpr

◆ extents()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr DiscreteVector<DDims...> ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::extents ( ) const
inlineconstexprnoexcept

◆ extent()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
template<class QueryDDim >
constexpr size_type ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::extent ( ) const
inlineconstexprnoexcept

◆ size()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr size_type ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::size ( ) const
inlineconstexprnoexcept

◆ mapping()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr mapping_type ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::mapping ( ) const
inlineconstexprnoexcept

◆ is_unique()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr bool ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::is_unique ( ) const
inlineconstexprnoexcept

◆ is_contiguous()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr bool ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::is_contiguous ( ) const
inlineconstexprnoexcept

◆ is_strided()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr bool ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::is_strided ( ) const
inlineconstexprnoexcept

◆ stride()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
template<class QueryDDim >
constexpr size_type ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::stride ( ) const
inlineconstexpr

◆ domain() [1/2]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr mdomain_type ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::domain ( ) const
inlineconstexprnoexcept

Provide access to the domain on which this chunk is defined.

Returns
the domain on which this chunk is defined

◆ domain() [2/2]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
template<class... QueryDDims>
constexpr DiscreteDomain<QueryDDims...> ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::domain ( ) const
inlineconstexprnoexcept

Provide access to the domain on which this chunk is defined.

Returns
the domain on which this chunk is defined

◆ operator=() [1/2]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr ChunkCommon& ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::operator= ( ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy > const &  other)
constexprprotecteddefault

Copy-assigns a new value to this ChunkCommon, yields a new view to the same data.

Parameters
otherthe ChunkCommon to copy
Returns
*this

◆ operator=() [2/2]

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr ChunkCommon& ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::operator= ( ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy > &&  other)
constexprprotecteddefault

Move-assigns a new value to this ChunkCommon.

Parameters
otherthe ChunkCommon to move
Returns
*this

◆ data()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr ElementType* ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::data ( ) const
inlineconstexprprotected

Access to the underlying allocation pointer.

Returns
allocation pointer

◆ internal_mdspan()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr internal_mdspan_type ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::internal_mdspan ( ) const
inlineconstexprprotected

Provide a modifiable view of the data.

Returns
a modifiable view of the data

◆ allocation_mdspan()

template<class ElementType , class... DDims, class LayoutStridedPolicy >
constexpr allocation_mdspan_type ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::allocation_mdspan ( ) const
inlineconstexprprotected

Provide a modifiable view of the data.

Returns
a modifiable view of the data

Friends And Related Function Documentation

◆ ChunkCommon

template<class ElementType , class... DDims, class LayoutStridedPolicy >
template<class , class , class >
friend class ChunkCommon
friend

◆ ChunkSpan

template<class ElementType , class... DDims, class LayoutStridedPolicy >
template<class , class , class , class >
friend class ChunkSpan
friend

◆ Chunk

template<class ElementType , class... DDims, class LayoutStridedPolicy >
template<class , class , class >
friend class Chunk
friend

Member Data Documentation

◆ m_internal_mdspan

template<class ElementType , class... DDims, class LayoutStridedPolicy >
internal_mdspan_type ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::m_internal_mdspan
protected

The raw view of the data.

◆ m_domain

template<class ElementType , class... DDims, class LayoutStridedPolicy >
mdomain_type ChunkCommon< ElementType, DiscreteDomain< DDims... >, LayoutStridedPolicy >::m_domain
protected

The mesh on which this chunk is defined.


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