← Back to team overview

yade-dev team mailing list archive

Re: WM3 -> Eigen migration

 

> I have just committed some changes. 
Looking at your code:

1. why you duplicate the vector (Vector3r::value)???? You can get all
you need just by using this pointer, or omitting the instance
altogether:

Real X(){ return x(); }
Real X(){ return this->x(); }

(don't forget derived class inherits all that from its parent class)

2. I don't think we want to initialize Vector3r to zeros in the default
ctor; it is used so frequently that it would hurt performance. (Normally
the object is constructed and assigned a value right away).

> I need to rewrite all operators for that?
You have to try if base class operators will do (they should be picked
up by the compiler); I assume their functionality is the same in most
cases (like Vector3r+Vector3r), so you have nothing to do in that case.
Some operators might need wrapping, such as quaternion*vector products,
I think.

For the I/O operators, see if eigen defines them already; then you don't
need to duplicate that.

Cheers, V







Follow ups

References