The saddle-points problem uses matrices, which are part of algebra. Any programmer doing algebra seriously knows that vector of vectors is the worst possible implementation of a matrix due to cache locality issues (doesn't apply to fixed array of fixed arrays).
Usage of vector of vectors (vec![vec![], vec![], vec![]];) teaches young adepts of programming bad practices. The correct ways to represent matrices are:
- Use algebraic crate that handles matrices correctly and optimally (that would give a hint how address algebraic problems in general)
- Use type holding one vector and dimensions and then implement access (that would give hint some other extensions to the type can be added, like column slice)
- Use linear vector and pass matrix dimensions' sizes as another argument (that would be the most C-like way, however still valid)
That's my second exercise on excercism.io, and I'm hugely disappointed.
I'm happy to provide a PR, but consensus is required which approach to choose.
The
saddle-pointsproblem uses matrices, which are part of algebra. Any programmer doing algebra seriously knows that vector of vectors is the worst possible implementation of a matrix due to cache locality issues (doesn't apply to fixed array of fixed arrays).Usage of vector of vectors (
vec![vec![], vec![], vec![]];) teaches young adepts of programming bad practices. The correct ways to represent matrices are:That's my second exercise on excercism.io, and I'm hugely disappointed.
I'm happy to provide a PR, but consensus is required which approach to choose.