forum.alglib.net

ALGLIB forum
It is currently Thu Mar 28, 2024 12:16 pm

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  [ 1 post ] 
Author Message
 Post subject: Re: string is not a member of 'std' ... and divide by zero
PostPosted: Tue May 28, 2013 8:09 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 903
Hello!

1. situation with std::string is something specific for C++ Builder. Unfortunately, we have not tested ALGLIB with newer versions of C++ Builder. string class must be part of std, and I think that it can be fixed by including appropriate files - I just do not have a copy of C++ Builder to experiment with.

2. regarding division by zero. It occurs when all Y[] are same, and total sum-of-squares is zero. Most C++ and C# compilers are compliant with IEEE 754 standard and handle it by returning NAN as result (that's why it was not caught), but C++ Builder raises an exception (I think that it is NOT correct behavior) unless you manually mask floating-point exceptions.

As I told, IEEE 754 compliant should handle it gracefully, but I decided to regard it as a minor bug. It was added to issues tracker http://bugs.alglib.net/view.php?id=524 and will be fixed in upcoming 3.8.0

As for you, you may:
(a) manually mask FP exceptions when your program starts (recommended)
(b) replace "rep->r2 = 1.0 - rss/tss;" by "rep->r2 = tss>0 ? 1.0 - rss/tss : 1.0;"


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group