# bdmerror.h File Reference

BDM's exception-throwing macros. More...

`#include <sstream>`
`#include <string>`

Go to the source code of this file.

## Defines
#define | bdm_assert(t, s)
| Throw std::runtime_exception if `t` is not true.
#define | bdm_assert_debug(t, s) bdm_assert(t, s)
| Throw std::runtime_exception if `t` is not true and NDEBUG is not defined.
#define | bdm_error(s)
| Unconditionally throw std::runtime_error.
#define | bdm_warning(s)
| Display a warning message.
## Functions
void | bdm::bdm_assert_f (const std::string &ass, const std::string &msg, const std::string &file, int line)
| Helper function for the `bdm_assert` and `bdm_assert_debug` macros.
void | bdm::bdm_error_f (const std::string &msg, const std::string &file, int line)
| Helper function for the `bdm_error` macro.
void | bdm::bdm_warning_f (const std::string &msg, const std::string &file, int line)
| Helper function for the `bdm_warning` macro.

## Detailed Description

BDM's exception-throwing macros.

Author:
  Vaclav Barta.

----------------------------------- BDM++ - C++ library for Bayesian Decision Making under Uncertainty

Using IT++ for numerical operations -----------------------------------

## Define Documentation

#define bdm_assert | ( | t,
|  | s |  | ) |

Value:

    if (!(t)) { \
                    std::ostringstream bdm_out; \
                    bdm_out << s; \
                    bdm::bdm_assert_f(#t, bdm_out.str(), __FILE__, __LINE__); \
            } else ((void) 0)

Throw std::runtime_exception if `t` is not true.

Referenced by bdm::emix::condition(), bdm::StateCanonical::connect_mlnorm(), bdm::EpdfDS::from_setting(), bdm::rectangular_support::initialize(), bdm::DS::log_add(), bdm::memlog::logit(), bdm::emix::marginal(), bdm::RV::scalarname(), bdm::datalink_buffered::set_history(), bdm::bilinfn::set_parameters(), bdm::eEmp::set_parameters(), bdm::emix::set_parameters(), bdm::str::str(), bdm::merger_base::validate(), bdm::mlstudent::validate(), bdm::mgnorm< sq_T >::validate(), bdm::mlnorm< chmat >::validate(), bdm::euni::validate(), bdm::egamma::validate(), and bdm::enorm< fsqmat >::validate().

#define bdm_error | ( | s |  | ) |

Value:

    if (true) { \
                    std::ostringstream bdm_out; \
                    bdm_out << s; \
                    bdm::bdm_error_f(bdm_out.str(), __FILE__, __LINE__); \
            } else ((void) 0)

Unconditionally throw std::runtime_error.

Referenced by bdm::BMEF::_copy_(), bdm::Designer::apply(), bdm::MultiModel::bayes(), bdm::chmat::chmat(), bdm::sqmat::clear(), bdm::BM::condition(), bdm::mpdf_internal< enorm< chmat > >::condition(), bdm::BM::epredictor(), bdm::egiw::est_theta(), bdm::egiw::est_theta_cov(), bdm::eEmp::evallog(), bdm::epdf::evallog(), bdm::eEF::evallog_nn(), bdm::mpdf::evallogcond(), bdm::mpdf::evallogcond_m(), bdm::BMEF::flatten(), bdm::MpdfDS::from_setting(), bdm::fsqmat::fsqmat(), bdm::DS::getdata(), bdm::sqmat::invqform(), bdm::sqmat::logdet(), bdm::logger::logit(), bdm::BM::logpred(), bdm::epdf::mean(), bdm::merger_base::merge(), bdm::mratio::mratio(), bdm::sqmat::mult_sym(), bdm::sqmat::mult_sym_t(), bdm::sqmat::opupdt(), bdm::eEF::pow(), bdm::BM::predictor(), bdm::sqmat::qform(), bdm::Designer::redesign(), bdm::eEmp::resample(), bdm::eEmp::sample(), bdm::eDirich::sample(), bdm::epdf::sample(), bdm::mpdf::samplecond(), bdm::UIFile::save(), bdm::egiwmix::set_parameters(), bdm::BMEF::set_statistics(), bdm::sqmat::sqrt_mult(), bdm::memlog::step(), bdm::DS::step(), bdm::logger::step(), bdm::sqmat::to_mat(), bdm::UIFile::UIFile(), bdm::egiw::variance(), bdm::epdf::variance(), bdm::MemDS::write(), and bdm::DS::write().

#define bdm_warning | ( | s |  | ) |

Value:

    if (true) { \
                    std::ostringstream bdm_out; \
                    bdm_out << s; \
                    bdm::bdm_warning_f(bdm_out.str(), __FILE__, __LINE__); \
            } else ((void) 0)

Display a warning message.

Referenced by bdm::chmat::add(), bdm::EKFCh::bayes(), bdm::KalmanCh::bayes(), bdm::epdf::condition(), bdm::epdf::marginal(), bdm::chmat::mult_sym(), bdm::chmat::mult_sym_t(), bdm::LQG::ricatti_step(), and bdm::egiw::sample().