MLIR
20.0.0git
|
A 2D array where each row may have different length. More...
#include "mlir/Dialect/Transform/Utils/RaggedArray.h"
Classes | |
class | const_iterator |
Constant iterator over the rows. More... | |
class | iterator |
Iterator over the rows. More... | |
Public Member Functions | |
size_t | size () const |
Returns the number of rows in the 2D array. More... | |
bool | empty () const |
Returns true if the are no rows in the 2D array. More... | |
ArrayRef< T > | operator[] (size_t pos) const |
Accesses pos -th row. More... | |
ArrayRef< T > | at (size_t pos) const |
MutableArrayRef< T > | operator[] (size_t pos) |
MutableArrayRef< T > | at (size_t pos) |
const_iterator | begin () const |
Iterator over rows. More... | |
const_iterator | end () const |
iterator | begin () |
iterator | end () |
void | reserve (size_t size, size_t nestedSize=0) |
Reserve space to store size rows with nestedSize elements each. More... | |
template<typename Range > | |
void | push_back (Range &&elements) |
Appends the given range of elements as a new row to the 2D array. More... | |
template<typename Range > | |
void | replace (size_t pos, Range &&elements) |
Replaces the pos -th row in the 2D array with the given range of elements. More... | |
void | appendEmptyRows (size_t num) |
Appends num empty rows to the array. More... | |
void | removeFront () |
Removes the first subarray in-place. Invalidates iterators to all rows. More... | |
A 2D array where each row may have different length.
Elements of each row are stored contiguously, but rows don't have a fixed order in the storage.
Definition at line 18 of file RaggedArray.h.
|
inline |
Appends num
empty rows to the array.
Definition at line 149 of file RaggedArray.h.
|
inline |
Definition at line 35 of file RaggedArray.h.
|
inline |
Definition at line 29 of file RaggedArray.h.
Referenced by mlir::transform::applyTransformNamedSequence(), and mlir::RaggedArray< T >::operator[]().
|
inline |
Definition at line 113 of file RaggedArray.h.
|
inline |
Iterator over rows.
Definition at line 111 of file RaggedArray.h.
|
inline |
Returns true if the are no rows in the 2D array.
Note that an array with a non-zero number of empty rows is NOT empty.
Definition at line 25 of file RaggedArray.h.
Referenced by mlir::transform::applyTransformNamedSequence().
|
inline |
Definition at line 114 of file RaggedArray.h.
|
inline |
Definition at line 112 of file RaggedArray.h.
|
inline |
Definition at line 34 of file RaggedArray.h.
References mlir::RaggedArray< T >::at().
|
inline |
Accesses pos
-th row.
Definition at line 28 of file RaggedArray.h.
References mlir::RaggedArray< T >::at().
|
inline |
Appends the given range of elements as a new row to the 2D array.
May invalidate the end iterator.
Definition at line 125 of file RaggedArray.h.
Referenced by mlir::transform::applyTransformNamedSequence().
|
inline |
Removes the first subarray in-place. Invalidates iterators to all rows.
Definition at line 154 of file RaggedArray.h.
Referenced by mlir::transform::applyTransformNamedSequence().
|
inline |
Replaces the pos
-th row in the 2D array with the given range of elements.
Invalidates iterators and references to pos
-th and all succeeding rows.
Definition at line 133 of file RaggedArray.h.
References mlir::RaggedArray< T >::size().
|
inline |
Reserve space to store size
rows with nestedSize
elements each.
Definition at line 117 of file RaggedArray.h.
References mlir::RaggedArray< T >::size().
|
inline |
Returns the number of rows in the 2D array.
Definition at line 21 of file RaggedArray.h.
Referenced by mlir::RaggedArray< T >::replace(), and mlir::RaggedArray< T >::reserve().