30 template<
typename TIndex,
typename TValue>
42 return _offsets.size()-1;
48 return *_offsets.rbegin();
54 const auto begin = _offsets[index];
55 return {_values.data()+begin, _offsets[index+1]-begin};
67 const gsl::span<TValue>&
values()
const 73 gsl::span<TIndex> _offsets;
74 gsl::span<TValue> _values;
SpanSpan(const gsl::span< TIndex > &offsets, const gsl::span< TValue > &values)
Definition: SpanSpan.h:35
SpanSpan()
Definition: SpanSpan.h:34
This version of the SDK is unstable, i-e, it may change with no warning.
Definition: AddCurveAction.h:20
size_t length() const
Return the total number of values.
Definition: SpanSpan.h:46
const gsl::span< TValue > operator[](size_t index) const
Returns the i-th sub-vector.
Definition: SpanSpan.h:52
size_t size() const
Return the number of sub-vectors.
Definition: SpanSpan.h:40
const gsl::span< TIndex > & offsets() const
Returns the offsets of each sub-vectors.
Definition: SpanSpan.h:61
A view on a "vector of sub-vectors of values" container.
Definition: SpanSpan.h:31
const gsl::span< TValue > & values() const
Returns the concatenated values of all the sub-vectors.
Definition: SpanSpan.h:67