MCPcopy Create free account
hub / github.com/apache/arrow / IncrementIndex

Function IncrementIndex

cpp/src/arrow/tensor/csf_converter.cc:42–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40namespace {
41
42inline void IncrementIndex(std::vector<int64_t>& coord, const std::vector<int64_t>& shape,
43 const std::vector<int64_t>& axis_order) {
44 const int64_t ndim = shape.size();
45 const int64_t last_axis = axis_order[ndim - 1];
46 ++coord[last_axis];
47 if (coord[last_axis] == shape[last_axis]) {
48 int64_t d = ndim - 1;
49 while (d > 0 && coord[axis_order[d]] == shape[axis_order[d]]) {
50 coord[axis_order[d]] = 0;
51 ++coord[axis_order[d - 1]];
52 --d;
53 }
54 }
55}
56
57// ----------------------------------------------------------------------
58// SparseTensorConverter for SparseCSFIndex

Callers 1

ConvertMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected