Hopefully fixed exception handling in TBB (again)

release/4.3a0
Richard Roberts 2013-10-11 22:17:15 +00:00
parent 35924f6055
commit ca9caf6a66
2 changed files with 18 additions and 14 deletions

View File

@ -22,6 +22,22 @@
namespace gtsam {
/* ************************************************************************* */
const char* IndeterminantLinearSystemException::what() const throw()
{
if(!description_)
description_ = String(
"\nIndeterminant linear system detected while working near variable with\n"
"index " + boost::lexical_cast<String>(j_) + " in ordering.\n"
"\n\
Thrown when a linear system is ill-posed. The most common cause for this\n\
error is having underconstrained variables. Mathematically, the system is\n\
underdetermined. See the GTSAM Doxygen documentation at\n\
http://borg.cc.gatech.edu/ on gtsam::IndeterminantLinearSystemException for\n\
more information.");
return description_->c_str();
}
/* ************************************************************************* */
const char* InvalidNoiseModel::what() const throw() {
if(description_.empty())

View File

@ -92,25 +92,13 @@ namespace gtsam {
ordered in elimination order and occupy scalars in the same way as
described for Jacobian columns in the previous bullet.
*/
class IndeterminantLinearSystemException : public ThreadsafeException<IndeterminantLinearSystemException> {
class GTSAM_EXPORT IndeterminantLinearSystemException : public ThreadsafeException<IndeterminantLinearSystemException> {
Index j_;
public:
IndeterminantLinearSystemException(Index j) throw() : j_(j) {}
virtual ~IndeterminantLinearSystemException() throw() {}
Index nearbyVariable() const { return j_; }
virtual const char* what() const throw() {
if(!description_)
description_ = String(
"\nIndeterminant linear system detected while working near variable with\n"
"index " + boost::lexical_cast<String>(j_) + " in ordering.\n"
"\n\
Thrown when a linear system is ill-posed. The most common cause for this\n\
error is having underconstrained variables. Mathematically, the system is\n\
either underdetermined, or its quadratic error function is concave in some\n\
directions. See the GTSAM Doxygen documentation at http://borg.cc.gatech.edu/ \n\
on gtsam::IndeterminantLinearSystemException for more information.");
return description_->c_str();
}
virtual const char* what() const throw();
};
/* ************************************************************************* */