| 126 | } |
| 127 | |
| 128 | dim_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 |
no test coverage detected