This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Eigen error handling

Tags: None
(comma "," separated)
artsgo
Registered Member
Posts
1
Karma
0

Eigen error handling

Mon May 18, 2009 10:42 pm
Hi,
does anyone know of documentation on how Eigen handles errors, how they could be trapped programmatically (eg should surrounding code catch exceptions eigen throws or examine global error variables etc.) Does a listing exist of error codes and descriptions?

thanks
User avatar
bjacob
Registered Member
Posts
658
Karma
3

RE: Eigen error handling

Mon May 18, 2009 11:03 pm
As is standard in C++, if exceptions are enabled, then a std::bad_alloc exception will be thrown in case of a bad allocation.

Aside from honoring that, Eigen doesn't throw any exception by itself.

All the error-guarding is under the form of assertions. There are static assertions that give compilation errors, and there are normal (runtime) assertions that make your program crash, unless exceptions are disabled (#define NDEBUG or EIGEN_NO_DEBUG or "release mode").

So: no custom exception, no global error variable, nothing :)

artsgo wrote:Hi,
does anyone know of documentation on how Eigen handles errors, how they could be trapped programmatically (eg should surrounding code catch exceptions eigen throws or examine global error variables etc.) Does a listing exist of error codes and descriptions?

thanks


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

RE: Eigen error handling

Tue May 19, 2009 6:32 am
I just wanted to add that a very few functions return true/false according to their success/failing status. This is the case of the solve() functions because it is legal to call them with non "solvable" data. On the other hand, as Benoit said, all programing errors are reported using static or runtime assertions.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]