|
MLIR 22.0.0git
|
A memory-resident sparse tensor in coordinate-scheme representation (a collection of Elements). More...
#include "mlir/ExecutionEngine/SparseTensor/COO.h"
Public Member Functions | |
| SparseTensorCOO (const std::vector< uint64_t > &dimSizes, uint64_t capacity=0) | |
| Constructs a new coordinate-scheme sparse tensor with the given sizes and an optional initial storage capacity. | |
| SparseTensorCOO (uint64_t dimRank, const uint64_t *dimSizes, uint64_t capacity=0) | |
| Constructs a new coordinate-scheme sparse tensor with the given sizes and an optional initial storage capacity. | |
| uint64_t | getRank () const |
| Gets the dimension-rank of the tensor. | |
| const std::vector< uint64_t > & | getDimSizes () const |
| Gets the dimension-sizes array. | |
| const std::vector< Element< V > > & | getElements () const |
| Gets the elements array. | |
| ElementLT< V > | getElementLT () const |
| Returns the operator< closure object for the COO's element type. | |
| void | add (const std::vector< uint64_t > &dimCoords, V val) |
| Adds an element to the tensor. | |
| void | sort () |
| Sorts elements lexicographically by coordinates. | |
A memory-resident sparse tensor in coordinate-scheme representation (a collection of Elements).
This data structure is used as an intermediate representation, e.g., for reading sparse tensors from external formats into memory.
|
inlineexplicit |
Constructs a new coordinate-scheme sparse tensor with the given sizes and an optional initial storage capacity.
Definition at line 70 of file COO.h.
References SparseTensorCOO().
Referenced by SparseTensorCOO().
|
inlineexplicit |
|
inline |
Adds an element to the tensor.
Definition at line 102 of file COO.h.
References getElementLT(), and getRank().
|
inline |
|
inline |
|
inline |
Gets the elements array.
Definition at line 96 of file COO.h.
Referenced by mlir::sparse_tensor::SparseTensorStorage< P, C, V >::SparseTensorStorage().
|
inline |
Gets the dimension-rank of the tensor.
Definition at line 90 of file COO.h.
Referenced by add(), getElementLT(), and mlir::sparse_tensor::SparseTensorStorage< P, C, V >::SparseTensorStorage().
|
inline |
Sorts elements lexicographically by coordinates.
If a coordinate is mapped to multiple values, then the relative order of those values is unspecified.
Definition at line 133 of file COO.h.
References getElementLT().
Referenced by mlir::sparse_tensor::SparseTensorStorage< P, C, V >::SparseTensorStorage().