Stride Tools#

template<typename T>
struct formatter<librapid::Stride<T>> : public fmt::formatter<librapid::Shape>
#include <strideTools.hpp>

Public Functions

template<typename FormatContext>
inline auto format(const librapid::Stride<T> &stride, FormatContext &ctx)
namespace librapid
template<typename ShapeType_>
class Stride
#include <strideTools.hpp>

A Stride is a vector of integers that describes the distance between elements in each dimension of an ArrayContainer object. This can be used to access elements in a non-trivial order, or to access a sub-array of an ArrayContainer object. The Stride class inherits from the Shape class.

See also

Shape

Template Parameters
  • T – The type of the Stride. Must be an integer type.

  • N – The number of dimensions in the Stride.

Public Types

using ShapeType = ShapeType_
using IndexType = typename std::decay_t<decltype(std::declval<ShapeType>()[0])>

Public Functions

Stride() = default
Stride(const ShapeType &shape)
Stride(const Stride &other) = default
Stride(Stride &&other) noexcept = default
Stride &operator=(const Stride &other) = default
Stride &operator=(Stride &&other) noexcept = default
auto operator[](size_t index) const -> IndexType
auto operator[](size_t index) -> IndexType&
inline auto ndim() const
auto substride(size_t start, size_t end) const -> Stride<Shape>
auto data() const -> const ShapeType&
auto data() -> ShapeType&
template<typename T_, typename Char, typename Ctx>
void str(const fmt::formatter<T_, Char> &format, Ctx &ctx) const

Public Static Attributes

static constexpr size_t MaxDimensions = ShapeType::MaxDimensions

Protected Attributes

ShapeType m_data
namespace typetraits

Functions

LIBRAPID_DEFINE_AS_TYPE(typename ShapeType, Stride<ShapeType>)#