Skip to content

NCOffsetsPolicy

#include <layout.hh>
struct NCOffsetsPolicy

Defined in src/lib/ncarray/layout.hh:475

Inherits: LayoutPolicy< NCOffsetsPolicy >

The NCOffsetsPolicy provides an additional offsets attribute and allows for a single pointer axis.

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
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
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.

const inline

inline NCA_HD void * advance(void * data, ssize_t axis, ssize_t index) const

Defined 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).

  • data The pointer to the current position in the array.

  • axis The current axis being traversed.

  • index The current index along the traversed axis.

The pointer to the next item in the array.


const inline

inline NCA_HD const void * advance(const void * data, ssize_t axis, ssize_t index) const

Defined 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).

  • data The pointer to the current position in the array.

  • axis The current axis being traversed.

  • index The current index along the traversed axis.

The const pointer to the next item in the array.


const inline

template<typename Coords> inline NCA_HD void * advance(void * data, const Coords & coords) const

Defined 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).

  • data The pointer to the current position in the array.

  • coords The coordinates specifying the indices of all axes to traverse.

The pointer to the specified item in the array.


const inline

template<typename Coords> inline NCA_HD const void * advance(const void * data, const Coords & coords) const

Defined 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).

  • data The pointer to the current position in the array.

  • coords The coordinates specifying the indices of all axes to traverse.

The const pointer to the specified item in the array.


const inline

inline NCA_HD const ssize_t * offsets() const

Defined in src/lib/ncarray/layout.hh:599

The pointer to the underlying offsets metadata.

The pointer to the underlying offsets metadata.


const inline

inline NCA_HD ssize_t offset(ssize_t dim) const

Defined in src/lib/ncarray/layout.hh:608

The offset of a given axis of an array.

  • dim A dimension to check the shape of.

The offset of that dimension.


const inline

inline NCA_HD bool is_pointer_impl(ssize_t axis) const

Defined in src/lib/ncarray/layout.hh:620

Returns whether a given axis is a pointer axis.

  • The axis to check if its a pointer axis.

Whether that axis is a pointer axis.


const inline

inline NCA_HDMetadata::value_type get_offset_impl(ssize_t axis) const

Defined in src/lib/ncarray/layout.hh:630

The offset getter called by the generic version of the base class.

  • axis The axis to return the offset for.

The offset of that axis.


const inline

inline NCA_HD const char * layout_repr() const

Defined in src/lib/ncarray/layout.hh:639

Returns the string representation of this Layout policy.

The string representation of this Layout policy.


const inline

inline NCA_HD bool is_contiguous_impl() const

Defined in src/lib/ncarray/layout.hh:650

Determines whether the layout is contiguous by checking for pointer axes.

Whether there are no pointer axes.

Return Name Description
Metadata m_offsets

Metadata m_offsets

Defined in src/lib/ncarray/layout.hh:660