[OpenWalnut-Dev] Eigen3 Transition

Sebastian Eichelbaum eichelbaum at informatik.uni-leipzig.de
Thu Apr 21 17:13:31 CEST 2011


Hi

I have added our new WMatrix. It is a fixed size matrix implementation covering our needs. It is able to be casted into eigen types easily and uses several eigen algorithms internally. 

The only warnings that exist are now related to WVector3D. I removed all ocurances of our old WMatrix4x4. If you want to port some of your code, just include "comman/math/linearAlgebra/WMatrix.h" -> this header contains everything you need to work with vectors and matrices. So if you port your code from WVector3D to our new WVector3d_2, use this new header. Many functions the OSG vector has as member functions are implemented as non-friend-non-meber functions in our implementation. This should be the only "problem" during porting.

If you encounter problems, mail me. I will port most of the graphicsEnine code from the old Vector to our new one in the first week of may.

Bye

On Fri, 08 Apr 2011, Stefan Philips wrote:

> And yet another mail. While I changed code to use the Eigen vectors
> and matrices, I determined two things to look out for.
> 
> 1. In contrast to the old vector and matrix types, the Eigen types
> are not initialized. So if you need them to be initialized, you have
> to call setZero()
> 
> 2. The resize of a Eigen vector seems to destroy any values stored in it.
> 
> from the Eigen documentation: "If the current number of coefficients
> of |*this| exactly matches the product /rows/ * /cols/, then no
> memory allocation is performed and the current values are left
> unchanged. In all other cases, including shrinking, the data is
> reallocated and all previous values are lost."
> 
> Am 07.04.2011 12:18, schrieb Sebastian Eichelbaum:
> >And another mail:
> >
> >- Eigen Matrices are Column Major by default. The old WMatrix was Row-Major. This means, if you use the operator( size_t, size_t ), the first argument is still the row. But if you use operator[], you need to transpose your indexing. Btw. do not use operator[]! This makes your code hard to understand.
> >
> >- Self-assignment;
> >   * m = m*m  works
> >   * v = m*v works
> >   * v = v.dot() does not!
> >     ->  use v.dotInPlace() instead
> >   * generally: if you do not use standard operators but special member functions, use the InPlace version instead of self-assignment.
> >
> >Bye
> >
> >
> >On Thu, 07 Apr 2011, Sebastian Eichelbaum wrote:
> >
> >>Hi
> >>
> >>Most of the module have an "owner". Those who don't will be fixed by me or someone else. One of these candidates might be Marching Cubes. Another "problem" is the nav slices module. I'll write a completely new one. This is especially important for the color-mapping.
> >>
> >>One hint for all:
> >>  * the WVector3D_2 can't be casted to an osg::Vec3!
> >>  * use toOsgVec3f in WVector.h
> >>    * We did NOT (and you should'nt either) provide a copy constructor to WVector3D which allows this since an automatic replace of WVector3D with WVector3d_2 would break this.
> >>
> >>Another thing:
> >>  * If you need to change an API in common for example which uses WVector3D
> >>    ->  will break other modules and API
> >>    ->  possible work-around: use the conversion methods in WVector3D to provide the same method with the other, new WVector3D_2 and mark the old function deprecated.
> >>
> >>ALL methods/classes marked deprecated will be removed by me afterwards. So please use it extensively!
> >>
> >>Bye
> >>Sebastian
> >>
> >>
> >>On Thu, 07 Apr 2011, Alexander Wiebel wrote:
> >>
> >>>Hi Sebastian,
> >>>>* Check your modules
> >>>What do you mean by "your modules". I had worked on/with many
> >>>modules but I would regard only a few to be "my own". What happens
> >>>with modules noone thinks they are "there own"? Will they be broken,
> >>>deactivated or is there any other idea how to handle them? This
> >>>question also applies to the color mapping change.
> >>>
> >>>Cheers,
> >>>Alex
> >>>_______________________________________________
> >>>OpenWalnut-Dev mailing list
> >>>OpenWalnut-Dev at lists.informatik.uni-leipzig.de
> >>>http://lists.informatik.uni-leipzig.de/mailman/listinfo/openwalnut-dev
> >>
> >>-- 
> >>Dipl.-Inf. Sebastian Eichelbaum
> >>Universität Leipzig
> >>Institut für Informatik
> >>Abteilung Bild- und Signalverarbeitung
> >>PF 100920
> >>D-04009 Leipzig
> >>_______________________________________________
> >>OpenWalnut-Dev mailing list
> >>OpenWalnut-Dev at lists.informatik.uni-leipzig.de
> >>http://lists.informatik.uni-leipzig.de/mailman/listinfo/openwalnut-dev
> >>
> 

> _______________________________________________
> OpenWalnut-Dev mailing list
> OpenWalnut-Dev at lists.informatik.uni-leipzig.de
> http://lists.informatik.uni-leipzig.de/mailman/listinfo/openwalnut-dev


-- 
Dipl.-Inf. Sebastian Eichelbaum
Universität Leipzig
Institut für Informatik
Abteilung Bild- und Signalverarbeitung
PF 100920
D-04009 Leipzig


More information about the OpenWalnut-Dev mailing list