Reputation:
I find Eigen's syntax more cumbersome than the other numerical linear algebra libraries I've worked with: numpy, MATLAB and armadillo. So I'm writing a bunch of "helper" functions, extending Eigen's syntax. (See an earlier question of mine)
My question is, hasn't this already been done?
I know that libigl have added some MATLAB-esque functions, but I'm wondering if there's more?
I'm trying not to reinvent the wheel here.
To give some examples:
swap_rows(i, j)
, swap_cols(i, j)
, reshape
, coefficient-wise functions like abs
, log
, etc.
I'm trying to write more readable code.
Upvotes: 0
Views: 105
Reputation: 9789
Matlab and numpy do not have the concept of expression, their function always work on a real matrix, either a matrix created by yourself or a temp buffer. Eigen on the other hand, uses template expressions to avoid temp memory buffer. It's functions should work both on matrices and expressions, that's probably why functions like reshape
are not implemented. Eigen tends to leave the functions that require a temp buffer to users so that they can control when and where a buffer appears.
Coefficient-wise functions are already there. Please find more details in the following link.
http://eigen.tuxfamily.org/dox/group__QuickRefPage.html
Upvotes: 1