Compute Library  18.05
Steps Class Reference

Class to describe a number of elements in each dimension. More...

#include <Steps.h>

Collaboration diagram for Steps:
[legend]

Public Member Functions

template<typename... Ts>
 Steps (Ts...steps)
 Constructor to initialize the steps. More...
 
constexpr Steps (const Steps &)=default
 Allow instances of this class to be copy constructed. More...
 
Stepsoperator= (const Steps &)=default
 Allow instances of this class to be copied. More...
 
constexpr Steps (Steps &&)=default
 Allow instances of this class to be move constructed. More...
 
Stepsoperator= (Steps &&)=default
 Allow instances of this class to be moved. More...
 
 ~Steps ()=default
 Default destructor. More...
 
- Public Member Functions inherited from Dimensions< unsigned int >
 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, unsigned intvalue)
 Accessor to set the value of one of the dimensions. More...
 
unsigned int x () const
 Alias to access the size of the first dimension. More...
 
unsigned int y () const
 Alias to access the size of the second dimension. More...
 
unsigned int z () const
 Alias to access the size of the third dimension. More...
 
const unsigned int & operator[] (size_t dimension) const
 Generic accessor to get the size of any dimension. More...
 
unsigned int & 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...
 
std::array< unsigned int, num_max_dimensions >::iterator begin ()
 Returns a read/write iterator that points to the first element in the dimension array. More...
 
std::array< unsigned int, 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< unsigned int, 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< unsigned int, num_max_dimensions >::iterator end ()
 Returns a read/write iterator that points one past the last element in the dimension array. More...
 
std::array< unsigned int, 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< unsigned int, 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< unsigned int >
static constexpr size_t num_max_dimensions
 Number of dimensions the tensor has. More...
 

Detailed Description

Class to describe a number of elements in each dimension.

Similar to Strides but not in bytes but number of elements.

Definition at line 40 of file Steps.h.

Constructor & Destructor Documentation

Steps ( Ts...  steps)
inline

Constructor to initialize the steps.

Parameters
[in]stepsValues to initialize the steps.

Definition at line 48 of file Steps.h.

References Steps::operator=(), and Steps::~Steps().

49  : Dimensions{ steps... }
50  {
51  // Initialize empty dimensions to 1
52  std::fill(_id.begin() + _num_dimensions, _id.end(), 1);
53  }
Dimensions(Ts...dims)
Constructor to initialize the tensor shape.
Definition: Dimensions.h:52
constexpr Steps ( const Steps )
default

Allow instances of this class to be copy constructed.

constexpr Steps ( Steps &&  )
default

Allow instances of this class to be move constructed.

~Steps ( )
default

Default destructor.

Referenced by Steps::Steps().

Member Function Documentation

Steps& operator= ( const Steps )
default

Allow instances of this class to be copied.

Referenced by Steps::Steps().

Steps& operator= ( Steps &&  )
default

Allow instances of this class to be moved.


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