99 std::ostringstream message;
101 if (
typeid(*e).name() !=
typeid(*this).name()) {
102 message <<
" Original std::exception: " <<
typeid(*e).name() <<
": " << std::endl
105 message << e->what() << std::endl;
111 <<
" Exception was thrown while processing node no. " << node->
get_ID() <<
":";
112 for (
unsigned int i = 0; i < lowerVarBounds.size(); i++) {
114 <<
" x(" << i <<
"): " << std::setprecision(16) << lowerVarBounds[i] <<
":" << upperVarBounds[i];
117 _msg = message.str();
126 const char*
what() const noexcept
133 #ifdef HAVE_MAiNGO_MPI 140 class MAiNGOMpiException:
public MAiNGOException {
157 explicit MAiNGOMpiException(TYPE ierr):
158 MAiNGOMpiException(
"", nullptr, nullptr, ierr)
168 MAiNGOMpiException(
const std::string& arg, TYPE ierr):
169 MAiNGOMpiException(arg, nullptr, nullptr, ierr)
180 MAiNGOMpiException(
const std::string& arg,
const babBase::BabNode& node, TYPE ierr):
181 MAiNGOMpiException(arg, nullptr, &node, ierr)
192 MAiNGOMpiException(
const std::string& arg,
const std::exception& e, TYPE ierr):
193 MAiNGOMpiException(arg, &e, nullptr, ierr)
205 MAiNGOMpiException(
const std::string& arg,
const std::exception& e,
const babBase::BabNode& node, TYPE ierr):
206 MAiNGOMpiException(arg, &e, &node, ierr)
216 MAiNGOMpiException(MAiNGOException& e, TYPE ierr):
217 MAiNGOException(e), _ierr(ierr)
229 MAiNGOMpiException(
const std::string& arg,
const std::exception* e,
const babBase::BabNode* node, TYPE ierr):
230 MAiNGOException(arg, e, node), _ierr(ierr)
237 int ierr() {
return _ierr; }
int get_ID() const
Function for querying the node ID.
Definition: babNode.h:100
Class representing a node in the Branch-and-Bound tree.
Definition: babNode.h:35
MAiNGOException(const std::string &arg, const std::exception &e)
Constructor used for forwarding.
Definition: exceptions.h:73
MAiNGOException(const std::string &arg)
Constructor used for forwarding.
Definition: exceptions.h:51
std::string _msg
Definition: exceptions.h:42
MAiNGOException(const std::string &arg, const babBase::BabNode &node)
Constructor used for forwarding.
Definition: exceptions.h:62
std::vector< double > get_lower_bounds() const
Function for querying the lower bounds on the optimization variables within this node.
Definition: babNode.h:90
const char * what() const noexcept
Function to return the error message.
Definition: exceptions.h:126
MAiNGOException(const std::string &arg, const std::exception &e, const babBase::BabNode &node)
Constructor used for forwarding.
Definition: exceptions.h:85
namespace holding all essentials of MAiNGO
Definition: aleModel.h:31
MAiNGOException(const std::string &arg, const std::exception *e, const babBase::BabNode *node)
Constructor used printing a MAiNGO Exception.
Definition: exceptions.h:97
std::vector< double > get_upper_bounds() const
Function for querying the upper bounds on the optimization variables within this node.
Definition: babNode.h:95
This class defines the exceptions thrown by MAiNGO.
Definition: exceptions.h:39