MatrixRef - Like an ArrayRef, but with an extra recorded strides so that we can easily view it as a multidimensional array. More...
#include <MatrixRef.h>
Public Types | |
typedef size_t | size_type |
Public Member Functions | |
MatrixRef () | |
Construct an empty Matrixref. | |
MatrixRef (ArrayRef< T > arr, size_type stride0) | |
Construct an MatrixRef from an ArrayRef and outer stride. | |
Simple Operations | |
bool | empty () const |
empty - Check if the matrix is empty. | |
const T * | data () const |
size_t | size (size_t dim) const |
size - Get size a dimension | |
size_t | numel () const |
bool | equals (MatrixRef RHS) const |
equals - Check for element-wise equality. | |
Operator Overloads | |
ArrayRef< T > | operator[] (size_t Index) const |
template<typename U > | |
std::enable_if< std::is_same< U, T >::value, MatrixRef< T > >::type & | operator= (U &&Temporary)=delete |
Disallow accidental assignment from a temporary. More... | |
template<typename U > | |
std::enable_if< std::is_same< U, T >::value, MatrixRef< T > >::type & | operator= (std::initializer_list< U >)=delete |
Disallow accidental assignment from a temporary. More... | |
MatrixRef - Like an ArrayRef, but with an extra recorded strides so that we can easily view it as a multidimensional array.
Like ArrayRef, this class does not own the underlying data, it is expected to be used in situations where the data resides in some other buffer.
This is intended to be trivially copyable, so it should be passed by value.
For now, 2D only (so the copies are actually cheap, without having to write a SmallVector class) and contiguous only (so we can return non-strided ArrayRef on index).
P.S. dimension 0 indexes rows, dimension 1 indexes columns
Definition at line 23 of file MatrixRef.h.
|
delete |
Disallow accidental assignment from a temporary.
The declaration here is extra complicated so that "arrayRef = {}" continues to select the move assignment operator.
|
delete |
Disallow accidental assignment from a temporary.
The declaration here is extra complicated so that "arrayRef = {}" continues to select the move assignment operator.