MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / calcDim

Function calcDim

src/backend/common/dim4.cpp:128–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128dim_t calcDim(const af_seq& seq, const dim_t& parentDim) {
129 dim_t outDim = 1;
130 if (isSpan(seq)) {
131 outDim = parentDim;
132 } else if (hasEnd(seq)) {
133 af_seq temp = {seq.begin, seq.end, seq.step};
134 if (seq.begin < 0) { temp.begin += parentDim; }
135 if (seq.end < 0) { temp.end += parentDim; }
136 outDim = seqElements(temp);
137 } else {
138 DIM_ASSERT(1, seq.begin >= -DBL_MIN && seq.begin < parentDim);
139 DIM_ASSERT(1, seq.end < parentDim);
140 outDim = seqElements(seq);
141 }
142
143 return outDim;
144}
145
146} // namespace af

Callers 2

toDimsFunction · 0.85
seqToDimsFunction · 0.85

Calls 3

isSpanFunction · 0.85
hasEndFunction · 0.85
seqElementsFunction · 0.85

Tested by

no test coverage detected