boost::multi::subarray
Mutable D‐dimensional view into part or all of an array
Synopsis
Declared in <boost/multi/array_ref.hpp>
template<
typename T,
multi::dimensionality_type D,
typename ElementPtr = T*,
class Layout = layout_t<D, std::pointer_traits<ElementPtr>::difference_type>>
class subarray
: public const_subarray<T, D, ElementPtr, Layout>
Description
Represents a subregion of a larger array without owning the elements. Has reference semantics: cannot be rebound, assignments are deep, and size is immutable. Invalidated if the originating array is destroyed or resized.
Base Classes
Name |
Description |
Read‐only |
Type Aliases
Name |
Description |
Indexable const‐cursor, pointer‐like objects that multidimensionally indexable (type usually returned by |
|
Random‐access const‐iterator in the leading dimension (return type of |
|
For |
|
Subarray immutable reference after binding first index, |
|
Indexable cursor, pointer‐like objects that multidimensionally indexable (type usually returned by |
|
Associated type that this reference decays to (when true copies are needed) |
|
Integer type to store dimensionality information (e.g. 1D, 2D, 3D) |
|
Element type ( |
|
Pointer to immutable element type (usually |
|
|
|
Pointer‐like type that produces an moved element (r‐value) |
|
Pointer to element type (usually |
|
Reference type to an element (usually |
|
|
(deprecated, use |
|
(deprecated) use |
A type to store the extent of an array (the range of valid indices in the leading dimension), returned from |
|
A type that stores the extents of the array or subarray (returned from |
|
Type to store an index in the leading dimension |
|
Type that represents a range of indices |
|
A tuple type that allows storing |
|
Random‐access iterator in the leading dimension (return type of |
|
type that holds the layout of the subarray or array |
|
Iterator in the leading dimension that mark elements as movable |
|
For |
|
Subarray reference after binding first index, |
|
A type to hold the size of an array or subarray (size in the leading dimension) (usually signed) |
|
Array value after evaluation through the first index, an object of lower dimension, |
Member Functions
Name |
Description |
|
Constructors |
|
Destructor |
|
Assingment operators (disabled because the const‐subarray is immutable) |
When evaluated on a tuple object this is equivalent to |
|
yields a const‐element view of the subarray, preventing modification of elements. |
|
yields the back subarray of leading dimension (or element for |
|
returns the base pointer of the array (arithmetic base of the layout, generally the first element) |
|
returns an iterator to the beginning (in the leading dimension) |
|
returns the base const‐pointer of the array (arithmetic base of the layout, generally the first element) |
|
returns an const‐iterator to the beginning |
|
returns an const‐iterator to the end |
|
produces a subarray of higher dimension by chunking in the leading dimension (if |
|
creates a view of the array with element references with const‐removed |
|
|
materializes an independent, owning |
materializes an independent, owning |
|
Subarray of lower dimension that represents the main diagonal of a square array |
|
yields a subarray of the same dimensionally in which the first |
|
An array view in which element references are r‐values |
|
a view with the elements transformed |
|
returns a random‐access range with all the elements of the array |
|
returns an iterator to the end (in the leading dimension) |
|
|
Deprecated, prefer |
Returns the index extensions (structured cartesian product of half‐open ranges) for all dimensions as an |
|
yields the front subarray of leading dimension (or element for |
|
returns the associated allocator |
|
returns a cursor pointing to the top corner element of the array |
|
|
|
|
|
returns the internal layout information of the array |
|
returns an move‐iterator (moves on dereference) to the beginning in the leading dimension |
|
yields a view of the array containing a specific member of original element type |
|
returns an move‐iterator (moves on dereference) to the ending in the leading dimension |
|
yields a subarray whose elements are marked for move |
|
Address‐of operators |
|
Subarray returning operator (takes multiple parameters, the number of parameters is equal or lower than the number of dimensions, individual arguments can be single indices or ranges) |
|
materializes an independent, owning |
|
Subscript operators |
|
|
|
yields a subarray of higher dimension by splitting the leading dimension into |
|
yields an equivalent subarray with a specific starting index |
|
yields a view of the subarray where elements are reinterpreted as a different type (elements must have compatible size) |
|
yields a view of the array with the leading dimension in the reverse order (e.g. |
|
yields a view of the array where the indices are rotated (to the left) (e.g. |
|
serializes data to generic archive (e.g. Boost or Cereal archive) |
|
|
|
returns the size of the array in the leading dimension |
|
A subarray‐view from index |
|
yields a view of the array in which the internal representation is static_cast to another type (and/or pointer) |
|
A subarray‐view of the array with skipping |
|
returns the layout internal strides of an array as a tuple |
|
swaps every corresponding element of the array references, extents must match. O(N) operation |
|
yields an array‐view of the same dimensionality taking the first count subarrays in the leading dimension |
|
A transpose view , that exchanges the first two indices |
|
yields a view in which index access is unordered (an arbitrary transposition of indices generally to optimize access) |
|
yields a view of the array where the indices are unrotated (to the right, opposite to |
|
Conversion to |
|
Equality operator |
|
Inequality operator |
|
Less‐than operator |
|
Less‐than‐or‐equal operator |
|
Greater‐than operator |
Derived Classes
Name |
Description |
A |
|
Movable D‐dimensional view into part or all of an array (elements can be moved when dereferenced and assigned) |
Template Parameters
Name |
Description |
T |
Element type |
D |
Dimensionality (non‐negative) |
ElementPtr |
Pointer‐like type to the elements (default |
Layout |
type describing strides and extensions |
Created with MrDocs