NCOffsetsPolicy
NCOffsetsPolicy
Section titled “NCOffsetsPolicy”#include <layout.hh>struct NCOffsetsPolicyDefined in src/lib/ncarray/layout.hh:475
Inherits:
LayoutPolicy< NCOffsetsPolicy >
The NCOffsetsPolicy provides an additional offsets attribute and allows for a single pointer axis.
List of all members
Section titled “List of all members”| Name | Kind | Owner |
|---|---|---|
advance |
function |
Declared here |
advance |
function |
Declared here |
advance |
function |
Declared here |
advance |
function |
Declared here |
offsets |
function |
Declared here |
offset |
function |
Declared here |
is_pointer_impl |
function |
Declared here |
get_offset_impl |
function |
Declared here |
layout_repr |
function |
Declared here |
is_contiguous_impl |
function |
Declared here |
m_offsets |
variable |
Declared here |
is_pointer_axis |
function |
Inherited from LayoutPolicy |
is_contiguous_impl |
function |
Inherited from LayoutPolicy |
advance |
function |
Inherited from LayoutPolicy |
advance |
function |
Inherited from LayoutPolicy |
advance |
function |
Inherited from LayoutPolicy |
advance |
function |
Inherited from LayoutPolicy |
shape |
function |
Inherited from LayoutPolicy |
shape |
function |
Inherited from LayoutPolicy |
ndim |
function |
Inherited from LayoutPolicy |
size |
function |
Inherited from LayoutPolicy |
strides |
function |
Inherited from LayoutPolicy |
stride |
function |
Inherited from LayoutPolicy |
layout_repr |
function |
Inherited from LayoutPolicy |
build_new_axes |
function |
Inherited from LayoutPolicy |
get_offset |
function |
Inherited from LayoutPolicy |
layout_matches |
function |
Inherited from LayoutPolicy |
m_shape |
variable |
Inherited from LayoutPolicy |
m_strides |
variable |
Inherited from LayoutPolicy |
m_pointer_axis |
variable |
Inherited from LayoutPolicy |
Inherited from LayoutPolicy
Section titled “Inherited from LayoutPolicy”| Kind | Name | Description |
|---|---|---|
function |
is_pointer_axis const inline |
Helper function to determine whether a given axis contains pointers. If true, this axis is a “double pointer” or involves suboffsets, etc. depending on the specialization. |
function |
is_contiguous_impl const inline |
Check if any pointer axes exist. |
function |
advance const inline |
The advance function takes a pointer to the current position in the array as well as an axis and index. Using this information, and the knowledge of the array layout it will move the pointer forward one data unit, accounting for strides, offsets, pointer jumps and so on. |
function |
advance const inline |
The advance function takes a pointer to the current position in the array as well as an axis and index. Using this information, and the knowledge of the array layout it will move the pointer forward one data unit, accounting for strides, offsets, pointer jumps and so on. |
function |
advance const inline |
The advance function overload takes a pointer to the current position in the array as well as a Coords (StaticCoords) object. The coords object provides multiple indices for multiple axes to traverse at once. |
function |
advance const inline |
The advance function overload takes a pointer to the current position in the array as well as a Coords (StaticCoords) object. The coords object provides multiple indices for multiple axes to traverse at once. |
function |
shape const inline |
The pointer to the underlying shape metadata. |
function |
shape const inline |
The shape of a given axis of an array. |
function |
ndim const inline |
The total number of dimensions. |
function |
size const inline |
The total number of elements in the array. |
function |
strides const inline |
The pointer to the underlying strides metadata. |
function |
stride const inline |
The strides along a given axis of an array. |
function |
layout_repr const inline |
The repr functions return a string to identify the layout policy when writing out string representations of the array. |
function |
build_new_axes const inline |
Provided a set of indexing arguments construct the description of the new axes given the layout specification. |
function |
get_offset const inline |
The offset/suboffset along a given axis of an array. |
function |
layout_matches const inline |
Check whether another array’s layout matches my own. |
variable |
m_shape |
|
variable |
m_strides |
|
variable |
m_pointer_axis |
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
NCA_HD void * |
advance const inline |
The advance function takes a pointer to the current position in the array as well as an axis and index. Using this information, and the knowledge of the array layout it will move the pointer forward one data unit, accounting for strides, offsets, pointer jumps and so on. |
NCA_HD const void * |
advance const inline |
The advance function takes a pointer to the current position in the array as well as an axis and index. Using this information, and the knowledge of the array layout it will move the pointer forward one data unit, accounting for strides, offsets, pointer jumps and so on. |
NCA_HD void * |
advance const inline |
The advance function overload takes a pointer to the current position in the array as well as a Coords (StaticCoords) object. The coords object provides multiple indices for multiple axes to traverse at once. |
NCA_HD const void * |
advance const inline |
The advance function overload takes a pointer to the current position in the array as well as a Coords (StaticCoords) object. The coords object provides multiple indices for multiple axes to traverse at once. |
NCA_HD const ssize_t * |
offsets const inline |
The pointer to the underlying offsets metadata. |
NCA_HD ssize_t |
offset const inline |
The offset of a given axis of an array. |
NCA_HD bool |
is_pointer_impl const inline |
Returns whether a given axis is a pointer axis. |
NCA_HDMetadata::value_type |
get_offset_impl const inline |
The offset getter called by the generic version of the base class. |
NCA_HD const char * |
layout_repr const inline |
Returns the string representation of this Layout policy. |
NCA_HD bool |
is_contiguous_impl const inline |
Determines whether the layout is contiguous by checking for pointer axes. |
advance
Section titled “advance”const inline
inline NCA_HD void * advance(void * data, ssize_t axis, ssize_t index) constDefined in src/lib/ncarray/layout.hh:492
The advance function takes a pointer to the current position in the array as well as an axis and index. Using this information, and the knowledge of the array layout it will move the pointer forward one data unit, accounting for strides, offsets, pointer jumps and so on.
For NCArray* type arrays, if the current axis is a pointer axis, then traversal requires interpreting the data as a double pointer and indexing appropriately (with an offset, if slicing has selected a sub-view).
Parameters
Section titled “Parameters”-
dataThe pointer to the current position in the array. -
axisThe current axis being traversed. -
indexThe current index along the traversed axis.
Returns
Section titled “Returns”The pointer to the next item in the array.
advance
Section titled “advance”const inline
inline NCA_HD const void * advance(const void * data, ssize_t axis, ssize_t index) constDefined in src/lib/ncarray/layout.hh:517
The advance function takes a pointer to the current position in the array as well as an axis and index. Using this information, and the knowledge of the array layout it will move the pointer forward one data unit, accounting for strides, offsets, pointer jumps and so on.
For NCArray* type arrays, if the current axis is a pointer axis, then traversal requires interpreting the data as a double pointer and indexing appropriately (with an offset, if slicing has selected a sub-view).
Parameters
Section titled “Parameters”-
dataThe pointer to the current position in the array. -
axisThe current axis being traversed. -
indexThe current index along the traversed axis.
Returns
Section titled “Returns”The const pointer to the next item in the array.
advance
Section titled “advance”const inline
template<typename Coords> inline NCA_HD void * advance(void * data, const Coords & coords) constDefined in src/lib/ncarray/layout.hh:544
The advance function overload takes a pointer to the current position in the array as well as a Coords (StaticCoords) object. The coords object provides multiple indices for multiple axes to traverse at once.
For NCArray* type arrays, if the current axis is a pointer axis, then traversal requires interpreting the data as a double pointer and indexing appropriately (with an offset, if slicing has selected a sub-view).
Parameters
Section titled “Parameters”-
dataThe pointer to the current position in the array. -
coordsThe coordinates specifying the indices of all axes to traverse.
Returns
Section titled “Returns”The pointer to the specified item in the array.
advance
Section titled “advance”const inline
template<typename Coords> inline NCA_HD const void * advance(const void * data, const Coords & coords) constDefined in src/lib/ncarray/layout.hh:575
The advance function overload takes a pointer to the current position in the array as well as a Coords (StaticCoords) object. The coords object provides multiple indices for multiple axes to traverse at once.
For NCArray* type arrays, if the current axis is a pointer axis, then traversal requires interpreting the data as a double pointer and indexing appropriately (with an offset, if slicing has selected a sub-view).
Parameters
Section titled “Parameters”-
dataThe pointer to the current position in the array. -
coordsThe coordinates specifying the indices of all axes to traverse.
Returns
Section titled “Returns”The const pointer to the specified item in the array.
offsets
Section titled “offsets”const inline
inline NCA_HD const ssize_t * offsets() constDefined in src/lib/ncarray/layout.hh:599
The pointer to the underlying offsets metadata.
Returns
Section titled “Returns”The pointer to the underlying offsets metadata.
offset
Section titled “offset”const inline
inline NCA_HD ssize_t offset(ssize_t dim) constDefined in src/lib/ncarray/layout.hh:608
The offset of a given axis of an array.
Parameters
Section titled “Parameters”dimA dimension to check the shape of.
Returns
Section titled “Returns”The offset of that dimension.
is_pointer_impl
Section titled “is_pointer_impl”const inline
inline NCA_HD bool is_pointer_impl(ssize_t axis) constDefined in src/lib/ncarray/layout.hh:620
Returns whether a given axis is a pointer axis.
Parameters
Section titled “Parameters”Theaxis to check if its a pointer axis.
Returns
Section titled “Returns”Whether that axis is a pointer axis.
get_offset_impl
Section titled “get_offset_impl”const inline
inline NCA_HDMetadata::value_type get_offset_impl(ssize_t axis) constDefined in src/lib/ncarray/layout.hh:630
The offset getter called by the generic version of the base class.
Parameters
Section titled “Parameters”axisThe axis to return the offset for.
Returns
Section titled “Returns”The offset of that axis.
layout_repr
Section titled “layout_repr”const inline
inline NCA_HD const char * layout_repr() constDefined in src/lib/ncarray/layout.hh:639
Returns the string representation of this Layout policy.
Returns
Section titled “Returns”The string representation of this Layout policy.
is_contiguous_impl
Section titled “is_contiguous_impl”const inline
inline NCA_HD bool is_contiguous_impl() constDefined in src/lib/ncarray/layout.hh:650
Determines whether the layout is contiguous by checking for pointer axes.
Returns
Section titled “Returns”Whether there are no pointer axes.
Protected Attributes
Section titled “Protected Attributes”| Return | Name | Description |
|---|---|---|
Metadata |
m_offsets |
m_offsets
Section titled “m_offsets”Metadata m_offsetsDefined in src/lib/ncarray/layout.hh:660