Registered Member
|
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 |
Registered Member
|
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
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Moderator
|
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.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]