IT++ Logo
Defines | Enumerations | Functions

Error and Warning Handling

Base Module

Defines

#define it_assert(t, s)
 Abort if t is not true.
#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.
#define it_error(s)
 Abort unconditionally.
#define it_info(s)
 Print information message.
#define it_info_no_endl(s)
 Print information message withot std::endl at the end.
#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.

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.
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.

Define Documentation

#define it_assert (   t,
 
)
Value:
if (!(t)) {       \
    std::ostringstream m_sout;     \
    m_sout << s;      \
    itpp::it_assert_f(#t,m_sout.str(),__FILE__,__LINE__); \
  } else       \
    ((void) 0)

Abort if t is not true.

Definition at line 95 of file itassert.h.

Referenced by itpp::GF2mat::add_rows(), itpp::arma_estimator(), itpp::MOG_generic::avg_log_lhood(), itpp::MOG_diag::avg_log_lhood(), itpp::backward_substitution(), itpp::Base_Event::Base_Event(), itpp::bidiag(), itpp::binom(), itpp::binom_i(), itpp::LDPC_Code::bp_decode(), itpp::Selective_Repeat_ARQ_Sender::buffer_size(), itpp::GF2mat::bvecify(), itpp::TDL_Channel::calc_frequency_response(), itpp::TDL_Channel::calc_impulse_response(), itpp::LDPC_Parity::check_connectivity(), itpp::LDPC_Parity::check_for_cycles(), itpp::Pulse_Shape< T1, T2, T3 >::clear(), itpp::TCP_Segment::combine(), itpp::GF2mat::concatenate_horizontal(), itpp::GF2mat::concatenate_vertical(), itpp::BLERC::count(), itpp::cross(), itpp::cumsum(), itpp::LDPC_Parity_Unstructured::cycle_removal_MGW(), itpp::Turbo_Codec::decode(), itpp::Turbo_Codec::decode_block(), itpp::Modulator_NCD::demodulate_soft_bits(), itpp::Modulator_NRD::demodulate_soft_bits(), itpp::TDL_Channel::discretize(), itpp::LDPC_Parity::display_stats(), itpp::LDPC_Code::encode(), itpp::BLDPC_Generator::encode(), itpp::LDPC_Generator_Systematic::encode(), itpp::Turbo_Codec::encode_block(), itpp::TTimer< TCP_Sender >::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(), itpp::Parser::get_bool(), itpp::Sparse_Mat< T >::get_col(), itpp::Channel_Specification::get_doppler_spectrum(), itpp::Parser::get_int(), itpp::Root_Raised_Cosine< T1 >::get_roll_off(), itpp::Raised_Cosine< T1 >::get_roll_off(), itpp::Line_Search::get_solution(), itpp::Newton_Search::get_solution(), itpp::ARMA_Filter< T1, T2, T3 >::get_state(), itpp::AR_Filter< T1, T2, T3 >::get_state(), itpp::MA_Filter< T1, T2, T3 >::get_state(), itpp::GF2mat::get_submatrix(), itpp::GF2mat::GF2mat(), itpp::Gold::Gold(), itpp::MOG_generic::init(), itpp::TDL_Channel::init(), itpp::Parser::init(), 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_generic::lhood(), itpp::MOG_diag::lhood(), itpp::Selective_Repeat_ARQ_Sender::link_packets_buffered(), itpp::Selective_Repeat_ARQ_Sender::link_packets_max_queuing_time(), itpp::Selective_Repeat_ARQ_Sender::link_packets_queued_waiting_for_transmission(), itpp::MOG_generic::load(), itpp::BLDPC_Generator::load(), itpp::LDPC_Generator_Systematic::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_generic::log_lhood(), itpp::MOG_diag::log_lhood(), itpp::MOG_generic::log_lhood_single_gaus(), itpp::MOG_diag::log_lhood_single_gaus(), itpp::max(), itpp::min(), itpp::MOG_diag_EM_sup::ml(), itpp::modified_yule_walker(), itpp::Modulator_NCD::modulate_bits(), itpp::Modulator_NRD::modulate_bits(), itpp::mult_trans(), itpp::Selective_Repeat_ARQ_Sender::nof_ready_link_packets(), itpp::norm(), itpp::it_ifile_old::open(), itpp::it_file::open(), itpp::it_ifile::open(), itpp::operator*(), itpp::operator+(), itpp::GF::operator/=(), itpp::GF2mat::operator==(), itpp::operator>>(), itpp::it_file::pack(), itpp::permutation_matrix(), itpp::GF2mat::permute_cols(), itpp::GF2mat::permute_rows(), itpp::prod(), itpp::GF2mat_sparse_alist::read(), itpp::Mat< Num_T >::repmat(), itpp::Vec< Num_T >::repmat(), itpp::Sparse_Vec< T >::resize_data(), itpp::MOG_diag_kmeans_sup::run(), itpp::BLDPC_Generator::save(), itpp::LDPC_Generator_Systematic::save(), itpp::BLDPC_Parity::save_base_matrix(), itpp::LDPC_Code::save_code(), itpp::Line_Search::search(), itpp::Newton_Search::search(), itpp::Modulator< T >::set(), itpp::LDPC_Parity::set(), itpp::TCP_Segment::set_begin(), itpp::Packet::set_bit_size(), itpp::TDL_Channel::set_channel_profile(), itpp::Channel_Specification::set_channel_profile(), itpp::TDL_Channel::set_channel_profile_exponential(), itpp::TDL_Channel::set_channel_profile_uniform(), itpp::Spread_2d::set_code(), itpp::CRC_Code::set_code(), itpp::Convolutional_Code::set_code(), itpp::Multicode_Spread_2d::set_codes(), itpp::ARMA_Filter< T1, T2, T3 >::set_coeffs(), itpp::AR_Filter< T1, T2, T3 >::set_coeffs(), itpp::MA_Filter< T1, T2, T3 >::set_coeffs(), itpp::Sparse_Mat< T >::set_col(), itpp::GF2mat::set_col(), 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::ACK_Channel::set_errors(), itpp::Packet_Channel::set_errors(), itpp::LDPC_Code::set_exit_conditions(), itpp::TDL_Channel::set_filter_length(), itpp::FIR_Fading_Generator::set_filter_length(), itpp::MOG_generic::set_full_covs_internal(), itpp::CRC_Code::set_generator(), itpp::TDL_Channel::set_LOS(), itpp::Channel_Specification::set_LOS(), itpp::TDL_Channel::set_LOS_doppler(), itpp::Correlated_Fading_Generator::set_LOS_doppler(), itpp::TDL_Channel::set_LOS_power(), itpp::Fading_Generator::set_LOS_power(), itpp::ND_UPSK::set_M(), itpp::ND_UQAM::set_M(), itpp::ND_UPAM::set_M(), itpp::PAM::set_M(), itpp::PAM_c::set_M(), itpp::PSK::set_M(), itpp::QAM::set_M(), itpp::Line_Search::set_max_iterations(), itpp::Line_Search::set_max_stepsize(), itpp::MOG_generic::set_means_internal(), itpp::TDL_Channel::set_no_frequencies(), itpp::Rice_Fading_Generator::set_no_frequencies(), itpp::TDL_Channel::set_norm_doppler(), itpp::Correlated_Fading_Generator::set_norm_doppler(), itpp::Selective_Repeat_ARQ_Sender::set_parameters(), itpp::Poisson_Packet_Generator::set_parameters(), itpp::Packet_Generator::set_parameters(), itpp::ACK_Channel::set_parameters(), itpp::Packet_Channel::set_parameters(), itpp::Turbo_Codec::set_parameters(), itpp::OFDM::set_parameters(), itpp::Root_Raised_Cosine< T1 >::set_pulse_shape(), itpp::Raised_Cosine< T1 >::set_pulse_shape(), itpp::GF2mat::set_row(), itpp::GF::set_size(), itpp::ARMA_Filter< T1, T2, T3 >::set_state(), itpp::AR_Filter< T1, T2, T3 >::set_state(), itpp::MA_Filter< T1, T2, T3 >::set_state(), itpp::LFSR::set_state(), itpp::Random_Generator::set_state(), itpp::TDL_Channel::set_time_offset(), itpp::MOG_generic::set_weights_internal(), itpp::Bernoulli_RNG::setup(), itpp::Pulse_Shape< T1, T2, T3 >::shape_samples(), itpp::Pulse_Shape< T1, T2, T3 >::shape_symbols(), itpp::Gold::shift(), itpp::LFSR::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::TCP_Segment::TCP_Segment(), 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(), and itpp::zero_pad().

#define it_error_if (   t,
 
)
#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)

Abort unconditionally.

Definition at line 127 of file itassert.h.

Referenced by itpp::Fix_Base::apply_o_mode(), itpp::assert_shifts(), itpp::LDPC_Code::bp_decode(), itpp::chol(), itpp::dct(), itpp::Reed_Solomon::decode(), itpp::Punctured_Convolutional_Code::decode(), itpp::LDPC_Code::decode(), itpp::Hamming_Code::decode(), itpp::Extended_Golay::decode(), itpp::Convolutional_Code::decode(), itpp::BCH::decode(), itpp::Turbo_Codec::decode_block(), itpp::Modulator_NCD::demodulate_soft_bits(), itpp::Modulator_NRD::demodulate_soft_bits(), itpp::eig(), itpp::eig_sym(), itpp::fft(), itpp::fft_real(), itpp::LDPC_Parity_Irregular::generate(), itpp::LDPC_Parity_Regular::generate(), itpp::Parser::get(), itpp::Parser::get_bmat(), itpp::Parser::get_bool(), itpp::Parser::get_bvec(), 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::idct(), itpp::ifft(), itpp::ifft_real(), itpp::Fix_Base::init(), itpp::TDL_Channel::init(), itpp::Rice_Fading_Generator::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::MOG_diag_MAP(), itpp::it_file_old::open(), itpp::it_ifile_old::open(), itpp::it_file::open(), itpp::it_ifile::open(), itpp::Vec< Num_T >::operator!=(), itpp::Vec< Num_T >::operator<(), itpp::operator<<(), itpp::Vec< Num_T >::operator<=(), itpp::Vec< Num_T >::operator=(), itpp::Vec< Num_T >::operator==(), itpp::Vec< Num_T >::operator>(), itpp::Vec< Num_T >::operator>=(), itpp::operator>>(), itpp::qr(), itpp::Fix_Base::rshift_and_apply_q_mode(), itpp::Fix_Base::scale_and_apply_modes(), itpp::schur(), itpp::Vec< Num_T >::set(), itpp::Turbo_Codec::set_metric(), itpp::Fix_Base::set_output_mode(), itpp::Turbo_Codec::set_parameters(), itpp::Sort< T >::sort(), itpp::Sort< T >::sort_index(), itpp::svd(), itpp::GF2mat::T_fact_update_bitflip(), and itpp::xcorr_old().

#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)

Print information message.

Definition at line 137 of file itassert.h.

Referenced by itpp::LDPC_Parity::display_stats().

#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)

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

Definition at line 146 of file itassert.h.

#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)

Display a warning message.

Definition at line 174 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::Modulator< T >::demodulate_soft_bits_approx(), 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::Line_Search::get_no_function_evaluations(), itpp::Newton_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::Line_Search::get_trace(), itpp::Newton_Search::get_trace(), itpp::BLDPC_Parity::load_base_matrix(), itpp::MOG_diag_EM_sup::ml(), itpp::Modulator< T >::modulate_bits(), itpp::needed_bits(), itpp::operator*(), itpp::it_file_old::pack(), itpp::pgm_read(), itpp::ppm_write(), itpp::quadlstep(), itpp::quadstep(), itpp::SND_In_File::read(), itpp::SND_Format::read_header(), 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::Fading_Generator::set_time_offset(), itpp::Fading_Generator::shift_time_offset(), itpp::SND_Out_File::write(), and itpp::xcorr().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
SourceForge Logo

Generated on Wed Mar 2 2011 22:05:31 for IT++ by Doxygen 1.7.3