Re: [eigen] eigen short support: discussion thread |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] eigen short support: discussion thread
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Tue, 25 Aug 2009 23:13:36 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=roUZsgbgzbcCM5oJoI0w7H4M4toh812MycWY5tH/3u0=; b=vdX8pVLViKTvlg1j2eoopghnuTPV2D3OPjGhy6Mo2bxx/33skKMV0FGehPJi20iV2J YAJbNV0fgPrAdn2cuOWs6gP6NKkioNbDOiDhBnX+rOWHcNX8WyNnE3KmjJImDeikG23X BYD6uQjD8Ch2MNVtWpy+9H5d9z65iydvUs1L0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=wz5Q4p3XARdLwaxy6V/IfFi439WuveVxV/hdDHVnDPYPkXqk0oExwmDMJJSuc/5Zab nOEpRJQI9ml2jC++7b9QWK2WH6uFdBitBeqewblYw+WkY6u26gSBeq4879SD/X3eZWqa gRj9HraOq859jutpaXowlGF5FX2S3MVF6tIqA=
On Tue, Aug 25, 2009 at 4:15 PM, Rohit Garg<rpg.314@xxxxxxxxx> wrote:
> I just built the unit-test for short and here's what I got
>
> ~/eigen2-rpg-branch/build@pixel> ./test/test_short
> Initializing random number generator with seed 1251209609
> Repeating each test 10 times
> ~/eigen2-rpg-branch/build@pixel>
>
> Does it mean that the test went correctly? :)
yes.
note that you can also use ctest to run all or some tests, with the -V
option to get details about failures, and "-R short" to run all tests
containing short in their name.
> I'll took into writing some more tests to stress the code a bit more.
>
> On Tue, Aug 25, 2009 at 7:16 PM, Rohit Garg<rpg.314@xxxxxxxxx> wrote:
>> Thanks for that. It seems to be building now. Though it takes a lot of
>> time and I am still compiling it. I'll let you know how it went. This
>> seems like a good time to ask, why do we need NumTraits.h in the first
>> place? And what does it do?
>>
>> On Tue, Aug 25, 2009 at 3:28 PM, Gael
>> Guennebaud<gael.guennebaud@xxxxxxxxx> wrote:
>>> hi,
>>>
>>> this is because in NumTraits.h, line 58 you have:
>>>
>>> typedef int Real;
>>>
>>> while, I guess, it should be:
>>>
>>> typedef short Real;
>>>
>>> cheers,
>>>
>>> gael.
>>>
>>>
>>> On Tue, Aug 25, 2009 at 10:54 AM, Rohit Garg<rpg.314@xxxxxxxxx> wrote:
>>>> Hi,
>>>>
>>>> I pushed a new change with short support to my branch here.
>>>>
>>>> http://bitbucket.org/rpg/eigen2-rpg-branch/overview/
>>>>
>>>> I did just as Benoit spelled out here,
>>>>
>>>> http://listengine.tuxfamily.org/lists.tuxfamily.org/eigen/2009/08/msg00108.html
>>>>
>>>> If you look into the NumTraits.h and MathFunctions.h files, the short
>>>> portion added by me is a virtual clone of the int portion. with int
>>>> replaced by float.
>>>>
>>>> Yet, when I try to run the unit tests, I get this,
>>>>
>>>> ~/Documents/numerical/eigen2-rpg-branch/build@rpg> make -j2
>>>> [ 2%] [ 2%] Building CXX object test/CMakeFiles/test_array..dir/array.cpp.o
>>>> Building CXX object test/CMakeFiles/test_adjoint.dir/adjoint.cpp.o
>>>> In file included from
>>>> /home/rpg/Documents/numerical/eigen2-rpg-branch/Eigen/Core:131,
>>>> from
>>>> /home/rpg/Documents/numerical/eigen2-rpg-branch/Eigen/Array:5,
>>>> from
>>>> /home/rpg/Documents/numerical/eigen2-rpg-branch/test/main.h:140,
>>>> from
>>>> /home/rpg/Documents/numerical/eigen2-rpg-branch/test/adjoint.cpp:26:
>>>> /home/rpg/Documents/numerical/eigen2-rpg-branch/Eigen/src/Core/MathFunctions.h:58:
>>>> error: template-id ‘precision<short int>’ for ‘short int
>>>> Eigen::precision()’ does not match any template declaration
>>>> /home/rpg/Documents/numerical/eigen2-rpg-branch/Eigen/src/Core/MathFunctions.h:33:
>>>> warning: inline function ‘typename Eigen::NumTraits<T>::Real
>>>> Eigen::precision() [with T = short int]’ used but never defined
>>>> make[2]: *** [test/CMakeFiles/test_adjoint.dir/adjoint.cpp.o] Error 1
>>>> make[1]: *** [test/CMakeFiles/test_adjoint.dir/all] Error 2
>>>> make[1]: *** Waiting for unfinished jobs....
>>>> In file included from
>>>> /home/rpg/Documents/numerical/eigen2-rpg-branch/Eigen/Core:131,
>>>> from
>>>> /home/rpg/Documents/numerical/eigen2-rpg-branch/Eigen/Array:5,
>>>> from
>>>> /home/rpg/Documents/numerical/eigen2-rpg-branch/test/main.h:140,
>>>> from
>>>> /home/rpg/Documents/numerical/eigen2-rpg-branch/test/array.cpp:26:
>>>> /home/rpg/Documents/numerical/eigen2-rpg-branch/Eigen/src/Core/MathFunctions.h:58:
>>>> error: template-id ‘precision<short int>’ for ‘short int
>>>> Eigen::precision()’ does not match any template declaration
>>>> /home/rpg/Documents/numerical/eigen2-rpg-branch/Eigen/src/Core/MathFunctions.h:33:
>>>> warning: inline function ‘typename Eigen::NumTraits<T>::Real
>>>> Eigen::precision() [with T = short int]’ used but never defined
>>>> make[2]: *** [test/CMakeFiles/test_array.dir/array.cpp.o] Error 1
>>>> make[1]: *** [test/CMakeFiles/test_array.dir/all] Error 2
>>>> make: *** [all] Error 2
>>>> ~/Documents/numerical/eigen2-rpg-branch/build@rpg>
>>>>
>>>>
>>>> Will somebody be please kind enough to look into what went wrong?
>>>> precision<short> is plainly there. Thanks
>>>>
>>>> --
>>>> Rohit Garg
>>>>
>>>> http://rpg-314.blogspot.com/
>>>>
>>>> Senior Undergraduate
>>>> Department of Physics
>>>> Indian Institute of Technology
>>>> Bombay
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Rohit Garg
>>
>> http://rpg-314.blogspot.com/
>>
>> Senior Undergraduate
>> Department of Physics
>> Indian Institute of Technology
>> Bombay
>>
>
>
>
> --
> Rohit Garg
>
> http://rpg-314.blogspot.com/
>
> Senior Undergraduate
> Department of Physics
> Indian Institute of Technology
> Bombay
>
>
>
--
Gaël Guennebaud
Iparla - INRIA Bordeaux
(+33)5 40 00 37 95