3 simple questions about the usage and future of the excellent eigen library:
- Does it have a reason why the access to Matrices is not possible via
matrix[i][j]
, but only viamatrix(i,j)
? - Are there plans to implement such a syntax?
- Will there be an implementation of multidimensional arrays
matrix[n][m]...[l]
?
I really like the eigen library, it is fast and easy to use. The only thing missing for me are really multidimensional arrays.
I can't speak for the
eigen
library because I've never used it, but I can speak to the design of the code. In order to use the[][]
notation, that typically means that the matrix is built upon underlying vectors that have also overloaded the[]
operator.It's possible the author of the
eigen
library did not want to go through the trouble of defining vectors to be the basis of the matrix classes.Take the following example.
Allows us to use the
Matrix
class like this:Where as defining the peren operator is typically easier because it doesn't also rely on the implementation of a
Vector
class:Allows us to use the
Matrix
class like this: