[OpenWalnut-Dev] Eigen3 Transition

Stefan Philips philips at informatik.uni-leipzig.de
Fri Apr 8 13:35:47 CEST 2011


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
>>

-------------- n?chster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: <http://lists.informatik.uni-leipzig.de/pipermail/openwalnut-dev/attachments/20110408/839c506d/attachment.html>


More information about the OpenWalnut-Dev mailing list