forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 9:36 am

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: getting started with the test_c & test_i
PostPosted: Sun Oct 03, 2010 6:01 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
I think that I've isolated this bug. I'll make some additional tests during Monday, but I think that only ap.cpp have to be fixed. I'll e-mail you when patch will be ready. Hope it will be Monday or Tuesday.


Top
 Profile  
 
 Post subject: Re: getting started with the test_c & test_i
PostPosted: Mon Oct 04, 2010 9:34 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
I think that problem is solved now. Only ap.cpp/ap.h were changed. I've posted fixed files (see attachment), can you try compiling your project once more with -O3?


Attachments:
ap.tgz [32.25 KiB]
Downloaded 949 times
Top
 Profile  
 
 Post subject: Re: getting started with the test_c & test_i
PostPosted: Tue Oct 05, 2010 6:52 am 
Offline

Joined: Fri Oct 01, 2010 2:25 am
Posts: 7
yes. it all works now.
thanks a lot for the fix!
rhine.


Top
 Profile  
 
 Post subject: Re: getting started with the test_c & test_i
PostPosted: Tue Oct 05, 2010 6:57 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
That was very strange bug in GCC - for some reason following code for accessing first 4 bytes of double precision number worked incorrectly

Code:
double val = something;
ae_int32_t first_4_bytes = ((ae_int32_t*)(&val))[0]; // works incorrectly under -O3 and old GCC


so I was forced to replace it by

Code:
union _u_type
{
double val;
ae_int32_t p[2];
} u;
u.val = something;
ae_int32_t first_4_bytes = u.p[0] ; // works correctly under -O3


Top
 Profile  
 
 Post subject: Re: getting started with the test_c & test_i
PostPosted: Sat Nov 20, 2010 1:00 pm 
Offline

Joined: Sat Nov 20, 2010 12:55 pm
Posts: 1
Hi there,
Great toolbox!
I'm still having problem running "test_i". Could someone explain to me (or better post a piece of code) how do I define "AE_USE_ALLOC_COUNTER" so it will work?

Many thanks


Top
 Profile  
 
 Post subject: Re: getting started with the test_c & test_i
PostPosted: Sat Nov 20, 2010 1:24 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
You should define at at global level using corresponding compiler directive. Just define AE_USE_ALLOC_COUNTER, and that should be enough


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 45 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group