/** * Exception to be thrown if an IDA solver does not return IDA_SUCCESS * @ingroup KernelExceptions */ class IDASolverFailure: public KernelException { public: /** * @note model should be passed from get_name() to ensure that * names of copied models are reported correctly. * @param model name of model causing problem * @param status exit status of the IDA solver */ IDASolverFailure(const std::string& model, const int status) : KernelException("IDASolverFailure"), model_(model), status_(status) {} ~IDASolverFailure() throw() {} std::string message() { std::ostringstream msg; msg << "In model " << model_ << ", the IDA solver " << "returned with exit status " << status_ << ".\n"; return msg.str(); } private: const std::string model_; const int status_; };