Compute Library
 19.08
Strides Class Reference

Strides of an item in bytes. More...

#include <Strides.h>

Collaboration diagram for Strides:
[legend]

Public Member Functions

template<typename... Ts>
constexpr Strides (Ts... strides)
 Constructor to initialize the strides. More...
 
constexpr Strides (const Strides &)=default
 Allow instances of this class to be copy constructed. More...
 
Stridesoperator= (const Strides &)=default
 Allow instances of this class to be copied. More...
 
constexpr Strides (Strides &&)=default
 Allow instances of this class to be move constructed. More...
 
Stridesoperator= (Strides &&)=default
 Allow instances of this class to be moved. More...
 
 ~Strides ()=default
 Default destructor. More...
 
- Public Member Functions inherited from Dimensions< size_t >
 Dimensions (Ts... dims)
 Constructor to initialize the tensor shape. More...
 
 Dimensions (const Dimensions &)=default
 Allow instances of this class to be copy constructed. More...
 
 Dimensions (Dimensions &&)=default
 Allow instances of this class to be move constructed. More...
 
Dimensionsoperator= (const Dimensions &)=default
 Allow instances of this class to be copied. More...
 
Dimensionsoperator= (Dimensions &&)=default
 Allow instances of this class to be moved. More...
 
void set (size_t dimension, size_t value)
 Accessor to set the value of one of the dimensions. More...
 
size_t x () const
 Alias to access the size of the first dimension. More...
 
size_t y () const
 Alias to access the size of the second dimension. More...
 
size_t z () const
 Alias to access the size of the third dimension. More...
 
const size_t & operator[] (size_t dimension) const
 Generic accessor to get the size of any dimension. More...
 
size_t & operator[] (size_t dimension)
 Generic accessor to get the size of any dimension. More...
 
unsigned int num_dimensions () const
 Returns the effective dimensionality of the tensor. More...
 
void set_num_dimensions (size_t num_dimensions)
 Set number of dimensions. More...
 
void collapse (const size_t n, const size_t first=0)
 Collapse dimensions. More...
 
void collapse_from (size_t start)
 Collapse dimensions starting from a given point. More...
 
void remove (size_t idx)
 Remove dimension of a given index. More...
 
std::array< size_t, num_max_dimensions >::iterator begin ()
 Returns a read/write iterator that points to the first element in the dimension array. More...
 
std::array< size_t, num_max_dimensions >::const_iterator begin () const
 Returns a read-only (constant) iterator that points to the first element in the dimension array. More...
 
std::array< size_t, num_max_dimensions >::const_iterator cbegin () const
 Returns a read-only (constant) iterator that points to the first element in the dimension array. More...
 
std::array< size_t, num_max_dimensions >::iterator end ()
 Returns a read/write iterator that points one past the last element in the dimension array. More...
 
std::array< size_t, num_max_dimensions >::const_iterator end () const
 Returns a read-only (constant) iterator that points one past the last element in the dimension array. More...
 
std::array< size_t, num_max_dimensions >::const_iterator cend () const
 Returns a read-only (constant) iterator that points one past the last element in the dimension array. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Dimensions< size_t >
static constexpr size_t num_max_dimensions
 Number of dimensions the tensor has. More...
 

Detailed Description

Strides of an item in bytes.

Definition at line 37 of file Strides.h.

Constructor & Destructor Documentation

◆ Strides() [1/3]

constexpr Strides ( Ts...  strides)
inline

Constructor to initialize the strides.

Parameters
[in]stridesValues to initialize the strides.

Definition at line 45 of file Strides.h.

46  : Dimensions{ strides... }
47  {
48  }
Dimensions(Ts... dims)
Constructor to initialize the tensor shape.
Definition: Dimensions.h:52

◆ Strides() [2/3]

constexpr Strides ( const Strides )
default

Allow instances of this class to be copy constructed.

◆ Strides() [3/3]

constexpr Strides ( Strides &&  )
default

Allow instances of this class to be move constructed.

◆ ~Strides()

~Strides ( )
default

Default destructor.

Member Function Documentation

◆ operator=() [1/2]

Strides& operator= ( const Strides )
default

Allow instances of this class to be copied.

◆ operator=() [2/2]

Strides& operator= ( Strides &&  )
default

Allow instances of this class to be moved.


The documentation for this class was generated from the following file: