#include <gslice.h>
Public Member Functions | |
gslice () | |
Construct an empty slice. | |
gslice (size_t, const valarray< size_t > &, const valarray< size_t > &) | |
Construct a slice. | |
gslice (const gslice &) | |
Copy constructor. | |
~gslice () | |
Destructor. | |
gslice & | operator= (const gslice &) |
Assignment operator. | |
size_t | start () const |
Return array offset of first slice element. | |
valarray< size_t > | size () const |
Return array of sizes of slice dimensions. | |
valarray< size_t > | stride () const |
Return array of array strides for each dimension. | |
Private Attributes | |
_Indexer * | _M_index |
Friends | |
class | valarray |
The slice class represents a multi-dimensional subset of an array, specified by three parameter sets: start offset, size array, and stride array. The start offset is the index of the first element of the array that is part of the subset. The size and stride array describe each dimension of the slice. Size is the number of elements in that dimension, and stride is the distance in the array between successive elements in that dimension. Each dimension's size and stride is taken to begin at an array element described by the previous dimension. The size array and stride array must be the same size.
For example, if you have offset==3, stride[0]==11, size[1]==3, stride[1]==3, then slice[0,0]==array[3], slice[0,1]==array[6], slice[0,2]==array[9], slice[1,0]==array[14], slice[1,1]==array[17], slice[1,2]==array[20].
Definition at line 63 of file gslice.h.
|
Construct an empty slice.
|
|
Construct a slice. Constructs a slice with as many dimensions as the length of the l and s arrays.
|
|
Copy constructor.
Definition at line 141 of file gslice.h. References std::gslice::_Indexer::_M_increment_use(). |
|
Destructor.
Definition at line 145 of file gslice.h. References std::gslice::_Indexer::_M_decrement_use(). |
|
Assignment operator.
Definition at line 149 of file gslice.h. References std::gslice::_Indexer::_M_decrement_use(), std::gslice::_Indexer::_M_increment_use(), and _M_index. |
|
Return array of sizes of slice dimensions.
Definition at line 126 of file gslice.h. References std::gslice::_Indexer::_M_size. |
|
Return array offset of first slice element.
Definition at line 122 of file gslice.h. References std::gslice::_Indexer::_M_start. |
|
Return array of array strides for each dimension.
Definition at line 130 of file gslice.h. References std::gslice::_Indexer::_M_stride. |
|
|
|
Definition at line 116 of file gslice.h. Referenced by operator=(), and std::valarray< _Tp >::operator[](). |