Error and Warning Handling
Base Module

## Macros

#define | it_assert(t, s)
| Abort if `t` is not true. More...
#define | it_assert_debug(t, s) it_assert(t,s)
| Abort if `t` is not true and NDEBUG is not defined.
#define | it_assert0(t, s) it_assert_debug(t,s)
| Deprecated macro. Please use `it_assert_debug()` instead.
#define | it_assert1(t, s) it_assert_debug(t,s)
| Deprecated macro. Please use `it_assert_debug()` instead.
#define | it_error_if(t, s)
| Abort if `t` is true. More...
#define | it_error(s)
| Abort unconditionally. More...
#define | it_info(s)
| Print information message. More...
#define | it_info_no_endl(s)
| Print information message withot `std::endl` at the end. More...
#define | it_info_debug(s) it_info(s)
| Print information message if NDEBUG is not defined.
#define | it_info_no_endl_debug(s) it_info_no_endl(s)
| Print information message withot `std::endl` at the end if NDEBUG is not defined.
#define | it_warning(s)
| Display a warning message. More...

## Enumerations

enum | itpp::error_msg_style { Full, Minimum }
| Style of assert, error and warning messages.

## Functions

void | itpp::it_assert_f (std::string ass, std::string msg, std::string file, int line)
| Helper function for the `it_assert` and `it_assert_debug` macros.
void | itpp::it_error_f (std::string msg, std::string file, int line)
| Helper function for the `it_error` and `it_error_if` macros.
void | itpp::it_info_f (std::string msg)
| Helper function for the `it_info` and `it_info_debug` macros.
void | itpp::it_warning_f (std::string msg, std::string file, int line)
| Helper function for the `it_warning` macro.
ITPP_EXPORT void | itpp::it_enable_exceptions (bool on)
| Enable/disable using exceptions for error handling.
void | itpp::it_enable_warnings ()
| Enable warnings.
void | itpp::it_disable_warnings ()
| Disable warnings.
void | itpp::it_redirect_warnings (std::ostream *warn_stream)
| Redirect warnings to the ostream warn_stream.
void | itpp::it_error_msg_style (error_msg_style style)
| Set preferred style of assert, error and warning messages.

## Detailed Description

For the following macros, the argument `s` is a string that is displayed.

it_assert(t,s); // Abort if t is not true
it_assert_debug(t,s); // Abort if t is not true and NDEBUG is not defined
it_error_if(t,s); // Abort if t is true
it_error(s); // Abort
it_info(s); // Display a message
it_info_debug(s); // Display a message if NDEBUG is not defined
it_info_no_endl(s); // Display a message without appended "std::endl"
it_info_no_endl_debug(s); // Display a message without appended "std::endl" if NDEBUG is not defined
it_warning(s); // Display a warning

`it_assert()`, `it_error()`, `it_error_if()`, `it_info()`, `it_info_no_endl()` and `it_warning()` are always active, whereas `it_assert_debug()`, `it_info_debug()` and `it_info_no_endl_debug()` depends on the `NDEBUG` compile time definition. If `NDEBUG` is defined, then none of these macros is executed.

Note
  `it_assert0()` and `it_assert1()` macros are still defined for backward compatibility, but `it_assert_debug()` should be used instead of them.

## Macro Definition Documentation

## it_assert

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

Value:
if (!(t)) { \
std::ostringstream m_sout; \
m_sout << s; \
itpp::it_assert_f(#t,m_sout.str(),__FILE__,__LINE__); \
} else \
((void) 0)
itpp::it_assert_f
void it_assert_f(std::string ass, std::string msg, std::string file, int line)
Helper function for the it_assert and it_assert_debug macros.
Definition: itassert.cpp:50

Abort if `t` is not true.

Definition at line 94 of file itassert.h.

Referenced by itpp::GF2mat::add_rows(), itpp::arma_estimator(), itpp::MOG_diag::avg_log_lhood(), itpp::MOG_generic::avg_log_lhood(), itpp::backward_substitution(), itpp::Base_Event::Base_Event(), itpp::BCH::BCH(), itpp::bidiag(), itpp::binom(), itpp::binom_i(), itpp::LDPC_Code::bp_decode(), itpp::GF2mat::bvecify(), itpp::TDL_Channel::calc_frequency_response(), itpp::TDL_Channel::calc_impulse_response(), itpp::Convolutional_Code::calc_metric(), itpp::cheb(), itpp::chebwin(), itpp::LDPC_Parity::check_connectivity(), itpp::LDPC_Parity::check_for_cycles(), itpp::Pulse_Shape< T1, double, T1 >::clear(), itpp::Circular_Buffer< T >::clear(), itpp::GF2mat::concatenate_horizontal(), itpp::GF2mat::concatenate_vertical(), itpp::BLERC::count(), itpp::cross(), itpp::cumsum(), itpp::LDPC_Parity_Unstructured::cycle_removal_MGW(), itpp::Reed_Solomon::decode(), itpp::Turbo_Codec::decode(), itpp::Punctured_Turbo_Codec::decode(), itpp::Turbo_Codec::decode_block(), itpp::Turbo_Codec::decode_n3(), itpp::Modulator_NRD::demodulate_soft_bits(), itpp::Modulator_NCD::demodulate_soft_bits(), itpp::TDL_Channel::discretize(), itpp::LDPC_Parity::display_stats(), itpp::Punctured_Turbo_Codec::encode(), itpp::LDPC_Generator_Systematic::encode(), itpp::BLDPC_Generator::encode(), itpp::LDPC_Code::encode(), itpp::Turbo_Codec::encode_block(), itpp::Parser::exist(), itpp::TTimer< itpp::TCP_Receiver >::ExpirationTime(), itpp::LDPC_Parity::export_alist(), itpp::filter(), itpp::filter_design_autocorrelation(), itpp::find(), itpp::forward_substitution(), itpp::gcd(), itpp::IFFT_Fading_Generator::generate_Jakes(), itpp::LDPC_Parity_Unstructured::generate_random_H(), itpp::Parser::get_bool(), itpp::Sparse_Mat< bin >::get_col(), itpp::Channel_Specification::get_doppler_spectrum(), itpp::Parser::get_int(), itpp::Punctured_Turbo_Codec::get_punctured_size(), itpp::Raised_Cosine< T1 >::get_roll_off(), itpp::Root_Raised_Cosine< T1 >::get_roll_off(), itpp::Newton_Search::get_solution(), itpp::Line_Search::get_solution(), itpp::MA_Filter< std::complex< double >, double, std::complex< double > >::get_state(), itpp::AR_Filter< T1, T2, T3 >::get_state(), itpp::ARMA_Filter< T1, T2, T3 >::get_state(), itpp::GF2mat::get_submatrix(), itpp::Modulator_NRD::get_symbols(), itpp::Modulator_NCD::get_symbols(), itpp::GF2mat::GF2mat(), itpp::Gold::Gold(), itpp::hadamard(), itpp::random_details::hash_time_to_seed(), itpp::MOG_generic::init(), itpp::Parser::init(), itpp::TDL_Channel::init(), itpp::LLR_calc_unit::init_llr_tables(), itpp::Modulator_NRD::init_soft_demodulator(), itpp::int2bits(), itpp::LDPC_Code::integrity_check(), itpp::interchange_permutations(), itpp::Sort< T >::intro_sort(), itpp::Sort< T >::intro_sort_index(), itpp::GF2mat::inverse(), itpp::MOG_generic::join(), itpp::levels2bits(), itpp::MOG_diag::lhood(), itpp::MOG_generic::lhood(), itpp::MOG_generic::load(), itpp::LDPC_Generator_Systematic::load(), itpp::BLDPC_Generator::load(), itpp::BLDPC_Parity::load_base_matrix(), itpp::LDPC_Code::load_code(), itpp::log_binom(), itpp::Rec_Syst_Conv_Code::log_decode(), itpp::Rec_Syst_Conv_Code::log_decode_n2(), itpp::MOG_diag::log_lhood(), itpp::MOG_generic::log_lhood(), itpp::MOG_diag::log_lhood_single_gaus(), itpp::MOG_generic::log_lhood_single_gaus(), itpp::lte_turbo_interleaver_sequence(), itpp::max(), itpp::min(), itpp::MOG_diag_EM_sup::ml(), itpp::modified_yule_walker(), itpp::Modulator_NRD::modulate_bits(), itpp::Modulator_NCD::modulate_bits(), itpp::mult_trans(), itpp::norm(), itpp::it_ifile::open(), itpp::it_file::open(), itpp::it_ifile_old::open(), itpp::operator*(), itpp::operator+(), itpp::GF::operator/=(), itpp::bofstream::operator<<(), itpp::bfstream::operator<<(), itpp::GF2mat::operator==(), itpp::operator>>(), itpp::bifstream::operator>>(), itpp::bfstream::operator>>(), itpp::it_file::pack(), itpp::permutation_matrix(), itpp::GF2mat::permute_cols(), itpp::GF2mat::permute_rows(), itpp::prod(), itpp::GF2mat_sparse_alist::read(), itpp::Reed_Solomon::Reed_Solomon(), itpp::Vec< unsigned >::repmat(), itpp::Mat< bin >::repmat(), itpp::Sparse_Vec< bin >::resize_data(), itpp::RNG_set_state(), itpp::rotation_matrix(), itpp::MOG_diag_kmeans_sup::run(), itpp::LDPC_Generator_Systematic::save(), itpp::BLDPC_Generator::save(), itpp::BLDPC_Parity::save_base_matrix(), itpp::LDPC_Code::save_code(), itpp::Newton_Search::search(), itpp::Line_Search::search(), itpp::Modulator< std::complex< double > >::set(), itpp::LDPC_Parity::set(), itpp::TCP_Segment::set_begin(), itpp::Packet::set_bit_size(), itpp::Channel_Specification::set_channel_profile(), itpp::TDL_Channel::set_channel_profile(), itpp::TDL_Channel::set_channel_profile_exponential(), itpp::TDL_Channel::set_channel_profile_uniform(), itpp::CRC_Code::set_code(), itpp::Convolutional_Code::set_code(), itpp::Spread_2d::set_code(), itpp::Multicode_Spread_2d::set_codes(), itpp::MA_Filter< std::complex< double >, double, std::complex< double > >::set_coeffs(), itpp::AR_Filter< T1, T2, T3 >::set_coeffs(), itpp::ARMA_Filter< T1, T2, T3 >::set_coeffs(), itpp::Sparse_Mat< bin >::set_col(), itpp::GF2mat::set_col(), itpp::ND_UQAM::set_constellation_points(), itpp::LDPC_Code::set_decoding_method(), itpp::MOG_generic::set_diag_covs_internal(), itpp::TDL_Channel::set_doppler_spectrum(), itpp::TCP_Segment::set_end(), itpp::Packet_Channel::set_errors(), itpp::ACK_Channel::set_errors(), itpp::LDPC_Code::set_exit_conditions(), itpp::FIR_Fading_Generator::set_filter_length(), itpp::TDL_Channel::set_filter_length(), itpp::MOG_generic::set_full_covs_internal(), itpp::CRC_Code::set_generator(), itpp::Channel_Specification::set_LOS(), itpp::TDL_Channel::set_LOS(), itpp::Correlated_Fading_Generator::set_LOS_doppler(), itpp::TDL_Channel::set_LOS_doppler(), itpp::Fading_Generator::set_LOS_power(), itpp::TDL_Channel::set_LOS_power(), itpp::QAM::set_M(), itpp::PSK::set_M(), itpp::ND_UPAM::set_M(), itpp::ND_UQAM::set_M(), itpp::ND_UPSK::set_M(), itpp::PAM_c::set_M(), itpp::PAM::set_M(), itpp::Line_Search::set_max_iterations(), itpp::Line_Search::set_max_stepsize(), itpp::MOG_generic::set_means_internal(), itpp::Rice_Fading_Generator::set_no_frequencies(), itpp::TDL_Channel::set_no_frequencies(), itpp::Correlated_Fading_Generator::set_norm_doppler(), itpp::TDL_Channel::set_norm_doppler(), itpp::OFDM::set_parameters(), itpp::Packet_Generator::set_parameters(), itpp::Packet_Channel::set_parameters(), itpp::Poisson_Packet_Generator::set_parameters(), itpp::Turbo_Codec::set_parameters(), itpp::ACK_Channel::set_parameters(), itpp::Raised_Cosine< T1 >::set_pulse_shape(), itpp::Root_Raised_Cosine< T1 >::set_pulse_shape(), itpp::GF2mat::set_row(), itpp::GF::set_size(), itpp::LFSR::set_state(), itpp::MA_Filter< std::complex< double >, double, std::complex< double > >::set_state(), itpp::AR_Filter< T1, T2, T3 >::set_state(), itpp::ARMA_Filter< T1, T2, T3 >::set_state(), itpp::TDL_Channel::set_time_offset(), itpp::MOG_generic::set_weights_internal(), itpp::STC::setup(), itpp::Bernoulli_RNG::setup(), itpp::Pulse_Shape< T1, double, T1 >::shape_samples(), itpp::Pulse_Shape< T1, double, T1 >::shape_symbols(), itpp::LFSR::shift(), itpp::Gold::shift(), itpp::TDL_Channel::shift_time_offset(), itpp::Sink::Sink(), itpp::Sort< T >::sort(), itpp::Sort< T >::sort_index(), itpp::ND_UPAM::sphere_decoding(), itpp::sub_m_v_vT(), itpp::sub_v_vT_m(), itpp::sum(), itpp::sum_sqr(), itpp::GF2mat::swap_cols(), itpp::GF2mat::swap_rows(), itpp::GF2mat::T_fact_update_addcol(), itpp::to_cvec(), itpp::tridiag(), itpp::waterfilling(), itpp::wcdma_spreading_codes(), itpp::wcdma_turbo_interleaver_sequence(), itpp::GF2mat_sparse_alist::write(), itpp::xcorr_old(), itpp::yulewalk(), itpp::zero_pad(), itpp::zigzag_space(), and itpp::Sink::~Sink().

## it_error_if

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

Value:
if((t)) { \
std::ostringstream m_sout; \
m_sout << s; \
itpp::it_error_f(m_sout.str(),__FILE__,__LINE__); \
} else \
((void) 0)
itpp::it_error_f
void it_error_f(std::string msg, std::string file, int line)
Helper function for the it_error and it_error_if macros.
Definition: itassert.cpp:68

Abort if `t` is true.

Definition at line 117 of file itassert.h.

Referenced by itpp::assert_shifts(), itpp::LDPC_Generator_Systematic::construct(), itpp::Convolutional_Code::decode_tail(), itpp::Punctured_Convolutional_Code::decode_tailbite(), itpp::Convolutional_Code::decode_tailbite(), itpp::Convolutional_Code::decode_trunc(), itpp::erfinv(), itpp::fact(), itpp::Convolutional_Code::inverse_tail(), itpp::it_file_old::open(), itpp::Exponential_RNG::operator()(), itpp::Stack< T >::peek(), itpp::polyval(), itpp::Stack< T >::pop(), itpp::Stack< T >::push(), itpp::Convolutional_Code::set_generator_polynomials(), itpp::Pulse_Shape< T1, double, T1 >::set_pulse_shape(), itpp::Raised_Cosine< T1 >::set_pulse_shape(), itpp::Root_Raised_Cosine< T1 >::set_pulse_shape(), itpp::Punctured_Convolutional_Code::set_puncture_matrix(), itpp::Punctured_Turbo_Codec::set_puncture_matrix(), itpp::Convolutional_Code::set_start_state(), itpp::Convolutional_Code::set_truncation_length(), itpp::Pulse_Shape< T1, double, T1 >::shape_samples(), itpp::Pulse_Shape< T1, double, T1 >::shape_symbols(), itpp::it_file::write_data_header(), and itpp::it_file_old::write_data_header().

## it_error

#define it_error | ( |  | s | ) |

Value:
if (true) { \
std::ostringstream m_sout; \
m_sout << s; \
itpp::it_error_f(m_sout.str(),__FILE__,__LINE__); \
} else \
((void) 0)
itpp::it_error_f
void it_error_f(std::string msg, std::string file, int line)
Helper function for the it_error and it_error_if macros.
Definition: itassert.cpp:68

Abort unconditionally.

Definition at line 126 of file itassert.h.

Referenced by itpp::Fix_Base::apply_o_mode(), itpp::assert_shifts(), itpp::LDPC_Code::bp_decode(), itpp::chol(), itpp::Circular_Buffer< T >::clear(), itpp::Hamming_Code::decode(), itpp::Extended_Golay::decode(), itpp::Reed_Solomon::decode(), itpp::BCH::decode(), itpp::Punctured_Convolutional_Code::decode(), itpp::Convolutional_Code::decode(), itpp::LDPC_Code::decode(), itpp::Turbo_Codec::decode_block(), itpp::eig(), itpp::eig_sym(), itpp::Parser::exist(), itpp::LDPC_Parity_Irregular::generate(), itpp::LDPC_Parity_Regular::generate(), itpp::Parser::get_bmat(), itpp::Parser::get_bool(), itpp::Parser::get_bvec(), itpp::Multilateration::get_crlb(), itpp::Parser::get_double(), itpp::Parser::get_imat(), itpp::Parser::get_ivec(), itpp::Parser::get_mat(), itpp::Parser::get_smat(), itpp::Parser::get_string(), itpp::Parser::get_svec(), itpp::Parser::get_vec(), itpp::Gold::Gold(), itpp::Rice_Fading_Generator::init(), itpp::TDL_Channel::init(), itpp::Fix_Base::init(), itpp::Rice_Fading_Generator::init_MEDS(), itpp::inv(), itpp::LDPC_Parity::LDPC_Parity(), itpp::Rec_Syst_Conv_Code::log_decode(), itpp::Rec_Syst_Conv_Code::log_decode_n2(), itpp::ls_solve(), itpp::ls_solve_chol(), itpp::ls_solve_od(), itpp::ls_solve_ud(), itpp::lu(), itpp::MOG_diag_EM_sup::map(), itpp::Modulator_ND::marginalize_bits(), itpp::MOG_diag_MAP(), itpp::it_ifile::open(), itpp::it_file::open(), itpp::it_ifile_old::open(), itpp::it_file_old::open(), itpp::operator<<(), itpp::operator>>(), itpp::qr(), itpp::rank(), itpp::Fix_Base::rshift_and_apply_q_mode(), itpp::BLDPC_Parity::save_base_matrix(), itpp::Fix_Base::scale_and_apply_modes(), itpp::schur(), itpp::Vec< unsigned >::set(), itpp::Turbo_Codec::set_metric(), itpp::Fix_Base::set_output_mode(), itpp::Turbo_Codec::set_parameters(), itpp::Multilateration::setup(), itpp::Sort< T >::sort(), itpp::Sort< T >::sort_index(), itpp::svd(), itpp::GF2mat::T_fact_update_bitflip(), and itpp::xcorr_old().

## it_info

#define it_info | ( |  | s | ) |

Value:
if (true) { \
std::ostringstream m_sout; \
m_sout << s << std::endl; \
itpp::it_info_f(m_sout.str()); \
} else \
((void) 0)
itpp::it_info_f
void it_info_f(std::string msg)
Helper function for the it_info and it_info_debug macros.
Definition: itassert.cpp:86

Print information message.

Definition at line 136 of file itassert.h.

Referenced by itpp::LDPC_Parity::display_stats(), and itpp::BLDPC_Parity::save_base_matrix().

## it_info_no_endl

#define it_info_no_endl | ( |  | s | ) |

Value:
if (true) { \
std::ostringstream m_sout; \
m_sout << s; \
itpp::it_info_f(m_sout.str()); \
} else \
((void) 0)
itpp::it_info_f
void it_info_f(std::string msg)
Helper function for the it_info and it_info_debug macros.
Definition: itassert.cpp:86

Print information message withot `std::endl` at the end.

Definition at line 145 of file itassert.h.

## it_warning

#define it_warning | ( |  | s | ) |

Value:
if (true) { \
std::ostringstream m_sout; \
m_sout << s; \
itpp::it_warning_f(m_sout.str(),__FILE__,__LINE__); \
} else \
((void) 0)
itpp::it_warning_f
void it_warning_f(std::string msg, std::string file, int line)
Helper function for the it_warning macro.
Definition: itassert.cpp:91

Display a warning message.

Definition at line 173 of file itassert.h.

Referenced by itpp::chol(), itpp::Punctured_Convolutional_Code::decode_tail(), itpp::Punctured_Convolutional_Code::decode_tailbite(), itpp::Punctured_Convolutional_Code::decode_trunc(), itpp::MOG_diag_kmeans_sup::dezombify_means(), itpp::TDL_Channel::discretize(), itpp::Line_Search::get_alpha(), itpp::Fading_Generator::get_doppler_spectrum(), itpp::Fading_Generator::get_filter_length(), itpp::Newton_Search::get_function_value(), itpp::Fast_ICA::get_independent_components(), itpp::Fading_Generator::get_LOS_doppler(), itpp::Fast_ICA::get_mixing_matrix(), itpp::Fading_Generator::get_no_frequencies(), itpp::Newton_Search::get_no_function_evaluations(), itpp::Line_Search::get_no_function_evaluations(), itpp::Newton_Search::get_no_iterations(), itpp::Fading_Generator::get_norm_doppler(), itpp::Fading_Generator::get_rice_method(), itpp::Fast_ICA::get_separating_matrix(), itpp::Line_Search::get_slope_ratio(), itpp::Newton_Search::get_stop_1(), itpp::Newton_Search::get_stop_2(), itpp::Fading_Generator::get_time_offset(), itpp::Newton_Search::get_trace(), itpp::Line_Search::get_trace(), itpp::BLDPC_Parity::load_base_matrix(), itpp::MOG_diag_EM_sup::ml(), itpp::Modulator< std::complex< double > >::modulate_bits(), itpp::it_file_old::pack(), itpp::details::quadlstep(), itpp::details::quadstep(), itpp::MOG_diag_kmeans_sup::run(), itpp::Fading_Generator::set_doppler_spectrum(), itpp::Fading_Generator::set_filter_length(), itpp::Fading_Generator::set_LOS_doppler(), itpp::Fading_Generator::set_no_frequencies(), itpp::Fading_Generator::set_norm_doppler(), itpp::Fading_Generator::set_rice_method(), itpp::Mat< bin >::set_submatrix(), itpp::Vec< unsigned >::set_subvector(), itpp::Fading_Generator::set_time_offset(), itpp::Fading_Generator::shift_time_offset(), itpp::xcorr(), and itpp::Multilateration::~Multilateration().

Generated on Sat Sep 30 2017 07:04:09 for IT++ by Doxygen 1.8.13