| 602 | |
| 603 | template<typename T> |
| 604 | int Array<T>::getIndex(const std::vector<int>& indexes) const |
| 605 | { |
| 606 | try |
| 607 | { |
| 608 | auto index = 0; |
| 609 | auto accumulated = 1; |
| 610 | for (auto i = (int)indexes.size() - 1 ; i >= 0 ; i--) |
| 611 | { |
| 612 | index += accumulated * indexes[i]; |
| 613 | accumulated *= mSize[i]; |
| 614 | } |
| 615 | return index; |
| 616 | } |
| 617 | catch (const std::exception& e) |
| 618 | { |
| 619 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); |
| 620 | return 0; |
| 621 | } |
| 622 | } |
| 623 | |
| 624 | template<typename T> |
| 625 | int Array<T>::getIndexAndCheck(const std::vector<int>& indexes) const |