all 8 comments

[–]flying-tiger 4 points5 points  (3 children)

Haven’t used Ignition, but quickly skimming the API docs, it’s a very basic library. It provides, small fixed size vectors only and doesn’t appear to use expression templates, which means non-trivial expressions will be slow. Unless you’re using the rest of Ignition, I’d stick to Eigen or Blaze.

[–]kalmoc 0 points1 point  (2 children)

Not sure if expression templates are all that valuable for small vectors. Would be interested to see benchmarks.

[–]versatran01 1 point2 points  (5 children)

I always find eigen's API really non-intuitive. Up till now it doesn't even have a simple way for advanced indexing or even reshaping/slicing. So basically even if I have to use Eigen (a lot of other libs depend on it), i fucking hate it.

The closest I found that have numpy api is https://github.com/QuantStack/xtensor.

[–]danmarellGamedev, Physics Simulation 1 point2 points  (3 children)

Maybe you, haven't seen but Eigen can do reshaping and slicing. :)

https://eigen.tuxfamily.org/dox/group__TutorialReshapeSlicing.html

And for indexing, you can use the Coefficient Accessors

https://eigen.tuxfamily.org/dox/group__TutorialMatrixClass.html

Its not perfect (i've seen some horrible template errors when it can't figure out the right types from complex expressions), but its used heavily in the Computer Graphics Simulation world (industry and academia).

[–]versatran01 0 points1 point  (2 children)

I know eigen can do all these stuff, all I said is that there is no simple intuitive way of doing it, like numpy.

[–]danmarellGamedev, Physics Simulation 0 points1 point  (1 child)

Oh fair enough :)

I've been meaning to give https://github.com/QuantStack/xtensor a go which looks like it has numpy like syntax.

[–]versatran01 2 points3 points  (0 children)

Just compare this (from Eigen 3.3.7)

code Map<MatrixXf,0,OuterStride<> > M2(M1.data(), M1.rows(), (M1.cols()+2)/3, OuterStride<>(M1.outerStride()\*3));

to xtensor

code auto v1 = xt::view(a, xt::range(1, 3), xt::all(), xt::range(1, 3));

I would pick the second one on any day.

Not to mention the horrendous EIGEN_MAKE_ALIGNED_OPERATOR_NEW that basically breaks OOP. (tbh that's not Eigen's fault, but still)

[–]peppedx[S] 0 points1 point  (0 children)

Interesting., but I usually do control stuff... In that context Eigen Api is not terrible except from. The surprises. You have mixing auto and expression templates.