@@ -58,21 +58,13 @@ struct ElementLT final {
58
58
const uint64_t rank;
59
59
};
60
60
61
- // / The type of callback functions which receive an element.
62
- template <typename V>
63
- using ElementConsumer =
64
- const std::function<void (const std::vector<uint64_t > &, V)> &;
65
-
66
61
// / A memory-resident sparse tensor in coordinate-scheme representation
67
- // / (a collection of `Element`s). This data structure is used as
68
- // / an intermediate representation; e.g., for reading sparse tensors
69
- // / from external formats into memory, or for certain conversions between
70
- // / different `SparseTensorStorage` formats.
62
+ // / (a collection of `Element`s). This data structure is used as an
63
+ // / intermediate representation, e.g., for reading sparse tensors from
64
+ // / external formats into memory.
71
65
template <typename V>
72
66
class SparseTensorCOO final {
73
67
public:
74
- using const_iterator = typename std::vector<Element<V>>::const_iterator;
75
-
76
68
// / Constructs a new coordinate-scheme sparse tensor with the given
77
69
// / sizes and an optional initial storage capacity.
78
70
explicit SparseTensorCOO (const std::vector<uint64_t > &dimSizes,
@@ -106,7 +98,7 @@ class SparseTensorCOO final {
106
98
// / Returns the `operator<` closure object for the COO's element type.
107
99
ElementLT<V> getElementLT () const { return ElementLT<V>(getRank ()); }
108
100
109
- // / Adds an element to the tensor. This method invalidates all iterators.
101
+ // / Adds an element to the tensor.
110
102
void add (const std::vector<uint64_t > &dimCoords, V val) {
111
103
const uint64_t *base = coordinates.data ();
112
104
const uint64_t size = coordinates.size ();
@@ -135,12 +127,9 @@ class SparseTensorCOO final {
135
127
elements.push_back (addedElem);
136
128
}
137
129
138
- const_iterator begin () const { return elements.cbegin (); }
139
- const_iterator end () const { return elements.cend (); }
140
-
141
130
// / Sorts elements lexicographically by coordinates. If a coordinate
142
131
// / is mapped to multiple values, then the relative order of those
143
- // / values is unspecified. This method invalidates all iterators.
132
+ // / values is unspecified.
144
133
void sort () {
145
134
if (isSorted)
146
135
return ;
0 commit comments