|
Bertini 2 - C++ Core
Software for Numerical Algebraic Geometry
|
utilities for start system code. More...
Go to the source code of this file.
Functions | |
| template<typename T> | |
| std::vector< T > | bertini::IndexToSubscript (T index, std::vector< T > const &dimensions) |
| Convert a zero-based index to a zero-based subscript vector. | |
utilities for start system code.
| std::vector< T > bertini::IndexToSubscript | ( | T | index, |
| std::vector< T > const & | dimensions ) |
Convert a zero-based index to a zero-based subscript vector.
Throws std::out_of_range if the index is out-of-range based on the dimensions.
This goes from front to back, top to bottom. So
[0 2 4 [(0,0) (0,1) (0,2) 1 3 5] (1,0) (1,1) (1,2)]
etc for higher-dimensional arrays. The functionality here is identical to that of Matlab's analagous call.
| index | The index you want to convert. |
| dimensions | The dimensions of the object you are subscripting or indexing into. |
| std::out_of_range,if | the index is impossible to convert. |