boost::multi::restriction

An array interface for a function of D integer arguments restricted to an certain Cartesian grid (extents), elements are generated lazily

Synopsis

template<
    dimensionality_type D,
    class Proj>
class restriction;

Types

Name

Description

iterator

Random‐access iterator in the leading dimension, in general they dereference to a restriction array of lower dimension or, for D == 1, to an element value (T) lazily generated.

Type Aliases

Name

Description

difference_type

Signed integer type for index arithmetic

element

Element type of the restriction array

element_type [deprecated]

Element type of the restriction array

index

Integer type to store an index in the leading dimension

indices

Tuple to store a set of D integer indices to obtain an element

indices_type [deprecated]

Tuple to store a set of D integer indices to obtain an element

reference

Type generated by binding the first index in the array (leading dimension), for D == 1 this is an element type

size_type

Integer type to store the size in the leading dimension

value_type

Type generated by binding the first index in the array (leading dimension), for D == 1 this is an element type

Member Functions

Name

Description

restriction [constructor]

constructs a D‐dimensional restriction array from an extensions argument and a function of D arguments

back

Back subarray restriction in the leading dimensions or, in D == 1, the back element

begin

returns an iterator to the beginning in the leading dimension

diagonal

yields an array restriction of lower dimensionality that holds the diagonal (in the first two dimensions), array must be square (first two sizes equal). (Only for D >= 2).

element_transformed

An array interface with of the same dimensionality to which each element is applied a projection function (unary function) (i.e. each element is obtained by the composition of the restricted function and the projection)

elements

yields a random‐access output range with all the elements of the array

end

returns an iterator to the end in the leading dimension

extension [deprecated]

extent

returns the extent of valid indices in the leading dimension.

extents

returns the index extents (structured cartesian product of index ranges) for all dimensions as an extents_type (extents_t<D>), a tuple of D index_extension values each encoding the extent in each dimension. The result can be passed directly to array constructors or compared for shape equality.

front

Front subarray restriction in the leading dimensions or, in D == 1, the front element

home

returns a cursor pointing to the top corner element of the array (a cursors is a lightweight representation of the array that drops the extents with pointer semantics) unlike begin()/`end(), the cursor owns a copy of the projection so it stays valid even if the restriction it was taken from does not (e.g. when captured into a closure by `elementwise::invoke)

num_elements

returns the total number of elements in the array

operator+

returns a materialized owning array of the restriction (allocates, O(N) operation)

operator[]

Subscript operators

operator~

Bitwise negation operators

partitioned

yields a restriction of higher dimension by splitting the leading dimension into equal‐sized partitions of size count (count must divide size())

repeated

yields a new restriction of higher dimension by repeating count times the restriction as a new leading dimension

rotated

yields a restruction that has its indices rotated (to the left)

size

returns the size of the restriction array in the leading dimension.

sizes

returns a tuple decribing sizes across all the dimensions of the restriction array.

transformed

yields a restriction transformed in the leading dimension

transposed

yields a transposed view of the restriction array (first two indices exchanged). (Only for D >= 2)

unrotated

yields a restruction that has its indices unrotated (rotated to the right)

Static Data Members

Name

Description

dimensionality

Integer constant describing the dimensionality of the restriction array

rank_v

Integer constant describing the dimensionality of the restriction array

Deduction Guides

Name

Description

restriction<D, Fun>

deduces the dimensionality of the restriction from the extents and the restricted function

Non-Member Functions

Name

Description

operatorˆ

creates a restriction of D dimensions of a function that takes D arguments given an extents of Cartesian indices.

restricted

creates a restriction of D dimensions of a function that takes D arguments given an extents of Cartesian indices.

Created with MrDocs