MCPcopy Create free account
hub / github.com/apple/ml-pointersect / ind2sub_c

Function ind2sub_c

pointersect/pr/cpp/pr.cpp:64–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62
63
64inline std::vector<int64_t> ind2sub_c(
65 const int64_t & ind,
66 const int64_t & sx,
67 const int64_t & sy,
68 const int64_t & sz
69) {
70 auto yz_size = sy * sz;
71 auto x = ind / yz_size;
72 auto _ind = ind - x * yz_size;
73 auto y = _ind / sz;
74 auto z = _ind - y * sz;
75 return {x, y, z};
76}
77
78inline int64_t sub2ind_c(
79 const int64_t & x,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected