diff --git a/gtsam/linear/linearExceptions.cpp b/gtsam/linear/linearExceptions.cpp index f633df4ce..0b0152026 100644 --- a/gtsam/linear/linearExceptions.cpp +++ b/gtsam/linear/linearExceptions.cpp @@ -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(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()) diff --git a/gtsam/linear/linearExceptions.h b/gtsam/linear/linearExceptions.h index 75df81e98..62f12cc2e 100644 --- a/gtsam/linear/linearExceptions.h +++ b/gtsam/linear/linearExceptions.h @@ -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 { + class GTSAM_EXPORT IndeterminantLinearSystemException : public ThreadsafeException { 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(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(); }; /* ************************************************************************* */