28 template<
typename TIndex,
typename TValue>
40 return _offsets.size()-1;
46 return *_offsets.rbegin();
52 const auto begin = _offsets[index];
53 return {&_values[begin], _offsets[index+1]-begin};
65 const gsl::span<TValue>&
values()
const 71 gsl::span<TIndex> _offsets;
72 gsl::span<TValue> _values;
SpanSpan(const gsl::span< TIndex > &offsets, const gsl::span< TValue > &values)
Definition: SpanSpan.h:33
SpanSpan()
Definition: SpanSpan.h:32
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:44
const gsl::span< TValue > operator[](size_t index) const
Returns the i-th sub-vector.
Definition: SpanSpan.h:50
size_t size() const
Return the number of sub-vectors.
Definition: SpanSpan.h:38
const gsl::span< TIndex > & offsets() const
Returns the offsets of each sub-vectors.
Definition: SpanSpan.h:59
A view on a "vector of sub-vectors of values" container.
Definition: SpanSpan.h:29
const gsl::span< TValue > & values() const
Returns the concatenated values of all the sub-vectors.
Definition: SpanSpan.h:65