MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / split

Function split

fem/tensorcoefficient.cpp:198–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196 }
197
198 Array<size_t> split(size_t full_index, const MultiIndex &multi_idx) {
199 const auto &strides = multi_idx.Strides();
200 Array<size_t> indices(multi_idx.Size());
201 for (int i: Range(multi_idx.Size())) {
202 indices[i] = full_index / strides[i];
203 full_index -= indices[i] * strides[i];
204 }
205 return indices;
206 }
207
208 // index format: 'ij,jk->ik' (result after '->' is mandatory!); return: input data, result data,
209 // full set

Callers 1

build_index_mapsMethod · 0.85

Calls 2

RangeFunction · 0.50
SizeMethod · 0.45

Tested by

no test coverage detected