yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #04285
Re: Eigen news
> Rotate is added in r2200
Thanks. We should discuss what interface we will follow for Python in
more detail.
I think it should be similar to Eigen interface, which (for example)
does not have any Rotate method. The Quaternion*Vector3 multiplication
is defined, though (try Quaternion(pi,(0,0,1))*Vector3(1,0,0) ), just as
in c++.
Vectorization is not enabled now (disabled via #defines in
lib/base/Math.hpp).
Once you've tested eigen, I would like other people to use it, too. If
there are no issues, we will be able to drop Wm3 before the release.
OTOH people will have to install libeigen2-dev package (which doesn't
exist for hardy, but I think everybody will upgrade by then), as I don't
want to put its whole source in our tree.
Cheers, Vaclav.
PS.
The thing is a little problematic since e.g. Matrix3r+Matrix3r doesn't
create a new Matrix3r object, but a special matrix addition object (so
called expression templates, which can be then used to optimize complex
formulas etc); those objects can be converted to Matrix3r either by ctor
call or via .eval() method of that object.
That means that in Python we cannot expose e.g. Matrix3r*Matrix3r
multiplication just by saying .def(py::self * py::self), which reuses c
++ operators; instead, we have to create a standalone function taking 2
matrices which returns the .eval() result, then
defining .def("__add__",Matrix__add__Matrix) and so on. It is handled
with macros in py/miniWm3Wrap/manualWrap.cpp, but makes wrapping still a
bit heavy on code.
Follow ups
References