Debug


Namespaces

namespace  junk

Functions

void arma_print ()
template<typename T1 >
void arma_print (const T1 &x)
template<typename T1 , typename T2 >
void arma_print (const T1 &x, const T2 &y)
template<typename T1 >
void arma_print (const arma_boost::basic_format< T1 > &x)
template<typename T1 , typename T2 >
void arma_print (const arma_boost::basic_format< T1, T2 > &x)
void arma_sigprint (const char *x)
 print a message on cout, with a preceding @ character. used for printing the signature of a function (see the arma_extra_debug_sigprint macro)
void arma_bktprint ()
template<typename T1 >
void arma_bktprint (const T1 &x)
template<typename T1 , typename T2 >
void arma_bktprint (const T1 &x, const T2 &y)
template<typename T1 >
void arma_bktprint (const arma_boost::basic_format< T1 > &x)
template<typename T1 , typename T2 >
void arma_bktprint (const arma_boost::basic_format< T1, T2 > &x)
void arma_thisprint (void *this_ptr)
template<typename T1 >
void arma_hot arma_warn (const bool state, const T1 &x)
 if state is true, print a message on cout
template<typename T1 , typename T2 >
void arma_hot arma_warn (const bool state, const T1 &x, const T2 &y)
template<typename T1 >
void arma_hot arma_warn (const bool state, const arma_boost::basic_format< T1 > &x)
template<typename T1 , typename T2 >
void arma_hot arma_warn (const bool state, const arma_boost::basic_format< T1, T2 > &x)
template<typename T1 >
void arma_hot arma_check (const bool state, const T1 &x)
 if state is true, throw a run-time error exception
template<typename T1 , typename T2 >
void arma_hot arma_check (const bool state, const T1 &x, const T2 &y)
template<typename T1 >
void arma_hot arma_check (const bool state, const arma_boost::basic_format< T1 > &x)
template<typename T1 , typename T2 >
void arma_hot arma_check (const bool state, const arma_boost::basic_format< T1, T2 > &x)
std::string arma_incompat_size_string (const u32 A_n_rows, const u32 A_n_cols, const u32 B_n_rows, const u32 B_n_cols, const char *x)
void arma_hot arma_assert_same_size (const u32 A_n_rows, const u32 A_n_cols, const u32 B_n_rows, const u32 B_n_cols, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const Mat< eT1 > &A, const Mat< eT2 > &B, const char *x)
 if given matrices have different sizes, throw a run-time error exception
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const Mat< eT1 > &A, const subview< eT2 > &B, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const subview< eT1 > &A, const Mat< eT2 > &B, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const subview< eT1 > &A, const subview< eT2 > &B, const char *x)
void arma_hot arma_assert_mul_size (const u32 A_n_rows, const u32 A_n_cols, const u32 B_n_rows, const u32 B_n_cols, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_mul_size (const Mat< eT1 > &A, const Mat< eT2 > &B, const char *x)
 if given matrices are incompatible for multiplication, throw a run-time error exception
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_mul_size (const Mat< eT1 > &A, const subview< eT2 > &B, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_mul_size (const subview< eT1 > &A, const Mat< eT2 > &B, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_mul_size (const subview< eT1 > &A, const subview< eT2 > &B, const char *x)
template<typename T1 >
void arma_stop (const T1 &x)
 throw a run-time error exception

Function Documentation

void arma_print (  )  [inline]

template<typename T1 >
void arma_print ( const T1 &  x  )  [inline]

Definition at line 35 of file debug.hpp.

00036   {
00037   std::cout << x << std::endl;
00038   }

template<typename T1 , typename T2 >
void arma_print ( const T1 &  x,
const T2 &  y 
) [inline]

Definition at line 45 of file debug.hpp.

00046   {
00047   std::cout << x << y << std::endl;
00048   }

template<typename T1 >
void arma_print ( const arma_boost::basic_format< T1 > &  x  )  [inline]

Definition at line 56 of file debug.hpp.

00057     {
00058     std::cout << x << std::endl;
00059     }

template<typename T1 , typename T2 >
void arma_print ( const arma_boost::basic_format< T1, T2 > &  x  )  [inline]

Definition at line 64 of file debug.hpp.

00065     {
00066     std::cout << x << std::endl;
00067     }

void arma_sigprint ( const char *  x  )  [inline]

print a message on cout, with a preceding @ character. used for printing the signature of a function (see the arma_extra_debug_sigprint macro)

Definition at line 80 of file debug.hpp.

00081   {
00082   std::cout << "@ " << x;
00083   }

void arma_bktprint (  )  [inline]

Definition at line 93 of file debug.hpp.

00094   {
00095   std::cout << std::endl;
00096   }

template<typename T1 >
void arma_bktprint ( const T1 &  x  )  [inline]

Definition at line 102 of file debug.hpp.

00103   {
00104   std::cout << " [" << x << "]" << std::endl;
00105   }

template<typename T1 , typename T2 >
void arma_bktprint ( const T1 &  x,
const T2 &  y 
) [inline]

Definition at line 112 of file debug.hpp.

00113   {
00114   std::cout << " [" << x << y << "]" << std::endl;
00115   }

template<typename T1 >
void arma_bktprint ( const arma_boost::basic_format< T1 > &  x  )  [inline]

Definition at line 123 of file debug.hpp.

00124     {
00125     std::cout << " [" << x << "]" << std::endl;
00126     }

template<typename T1 , typename T2 >
void arma_bktprint ( const arma_boost::basic_format< T1, T2 > &  x  )  [inline]

Definition at line 131 of file debug.hpp.

00132     {
00133     std::cout << " [" << x << "]" << std::endl;
00134     }

void arma_thisprint ( void *  this_ptr  )  [inline]

Definition at line 145 of file debug.hpp.

00146   {
00147   std::cout << " [this = " << this_ptr << "]" << std::endl;
00148   }

template<typename T1 >
void arma_hot arma_warn ( const bool  state,
const T1 &  x 
) [inline]

if state is true, print a message on cout

Definition at line 160 of file debug.hpp.

References arma_print().

Referenced by diskio::safe_rename(), diskio::save_arma_ascii(), diskio::save_arma_binary(), diskio::save_field_arma_binary(), diskio::save_field_ppm_binary(), diskio::save_field_std_string(), diskio::save_pgm_binary(), and diskio::save_raw_ascii().

00161   {
00162   if(state==true)
00163     {
00164     arma_print(x);
00165     }
00166   }

template<typename T1 , typename T2 >
void arma_hot arma_warn ( const bool  state,
const T1 &  x,
const T2 &  y 
) [inline]

Definition at line 173 of file debug.hpp.

References arma_print().

00174   {
00175   if(state==true)
00176     {
00177     arma_print(x,y);
00178     }
00179   }

template<typename T1 >
void arma_hot arma_warn ( const bool  state,
const arma_boost::basic_format< T1 > &  x 
) [inline]

Definition at line 187 of file debug.hpp.

References arma_print().

00188     {
00189     if(state==true)
00190       arma_print(x);
00191     }

template<typename T1 , typename T2 >
void arma_hot arma_warn ( const bool  state,
const arma_boost::basic_format< T1, T2 > &  x 
) [inline]

Definition at line 197 of file debug.hpp.

References arma_print().

00198     {
00199     if(state==true)
00200       arma_print(x);
00201     }

template<typename T1 >
void arma_hot arma_check ( const bool  state,
const T1 &  x 
) [inline]

template<typename T1 , typename T2 >
void arma_hot arma_check ( const bool  state,
const T1 &  x,
const T2 &  y 
) [inline]

Definition at line 227 of file debug.hpp.

00228   {
00229   if(state==true)
00230     {
00231     throw std::runtime_error( std::string(x) + std::string(y) );
00232     }
00233   }

template<typename T1 >
void arma_hot arma_check ( const bool  state,
const arma_boost::basic_format< T1 > &  x 
) [inline]

Definition at line 241 of file debug.hpp.

References arma_boost::str().

00242     {
00243     if(state==true)
00244       {
00245       throw std::runtime_error(str(x));
00246       }
00247     }

template<typename T1 , typename T2 >
void arma_hot arma_check ( const bool  state,
const arma_boost::basic_format< T1, T2 > &  x 
) [inline]

Definition at line 253 of file debug.hpp.

References arma_boost::str().

00254     {
00255     if(state==true)
00256       {
00257       throw std::runtime_error(str(x));
00258       }
00259     }

std::string arma_incompat_size_string ( const u32  A_n_rows,
const u32  A_n_cols,
const u32  B_n_rows,
const u32  B_n_cols,
const char *  x 
) [inline]

Definition at line 266 of file debug.hpp.

Referenced by arma_assert_mul_size(), and arma_assert_same_size().

00267   {
00268   std::stringstream tmp;
00269   
00270   tmp << x << ": incompatible matrix dimensions: (" << A_n_rows << "," << A_n_cols << ") and (" << B_n_rows << "," << B_n_cols << ")";
00271   
00272   return tmp.str();
00273   }

void arma_hot arma_assert_same_size ( const u32  A_n_rows,
const u32  A_n_cols,
const u32  B_n_rows,
const u32  B_n_cols,
const char *  x 
) [inline]

Definition at line 280 of file debug.hpp.

References arma_incompat_size_string().

Referenced by Mat< eT >::Mat().

00281   {
00282   if( (A_n_rows != B_n_rows) || (A_n_cols != B_n_cols) )
00283     {
00284     throw std::runtime_error
00285       (
00286       arma_incompat_size_string(A_n_rows, A_n_cols, B_n_rows, B_n_cols, x)
00287       );
00288     }
00289   }

template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size ( const Mat< eT1 > &  A,
const Mat< eT2 > &  B,
const char *  x 
) [inline]

if given matrices have different sizes, throw a run-time error exception

Definition at line 298 of file debug.hpp.

References arma_incompat_size_string(), Mat< eT >::n_cols, and Mat< eT >::n_rows.

00299   {
00300   if( (A.n_rows != B.n_rows) || (A.n_cols != B.n_cols) )
00301     {
00302     throw std::runtime_error
00303       (
00304       arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x)
00305       );
00306     }
00307   }

template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size ( const Mat< eT1 > &  A,
const subview< eT2 > &  B,
const char *  x 
) [inline]

Definition at line 315 of file debug.hpp.

References arma_incompat_size_string(), subview< eT >::n_cols, Mat< eT >::n_cols, subview< eT >::n_rows, and Mat< eT >::n_rows.

00316   {
00317   if( (A.n_rows != B.n_rows) || (A.n_cols != B.n_cols) )
00318     {
00319     throw std::runtime_error
00320       (
00321       arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x)
00322       );
00323     }
00324   }

template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size ( const subview< eT1 > &  A,
const Mat< eT2 > &  B,
const char *  x 
) [inline]

Definition at line 332 of file debug.hpp.

References arma_incompat_size_string(), Mat< eT >::n_cols, subview< eT >::n_cols, Mat< eT >::n_rows, and subview< eT >::n_rows.

00333   {
00334   if( (A.n_rows != B.n_rows) || (A.n_cols != B.n_cols) )
00335     {
00336     throw std::runtime_error
00337       (
00338       arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x)
00339       );
00340     }
00341   }

template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size ( const subview< eT1 > &  A,
const subview< eT2 > &  B,
const char *  x 
) [inline]

Definition at line 349 of file debug.hpp.

References arma_incompat_size_string(), subview< eT >::n_cols, and subview< eT >::n_rows.

00350   {
00351   if( (A.n_rows != B.n_rows) || (A.n_cols != B.n_cols) )
00352     {
00353     throw std::runtime_error
00354       (
00355       arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x)
00356       );
00357     }
00358   }

void arma_hot arma_assert_mul_size ( const u32  A_n_rows,
const u32  A_n_cols,
const u32  B_n_rows,
const u32  B_n_cols,
const char *  x 
) [inline]

Definition at line 365 of file debug.hpp.

References arma_incompat_size_string().

00366   {
00367   if(A_n_cols != B_n_rows)
00368     {
00369     throw std::runtime_error
00370       (
00371       arma_incompat_size_string(A_n_rows, A_n_cols, B_n_rows, B_n_cols, x)
00372       );
00373     }
00374   }

template<typename eT1 , typename eT2 >
void arma_hot arma_assert_mul_size ( const Mat< eT1 > &  A,
const Mat< eT2 > &  B,
const char *  x 
) [inline]

if given matrices are incompatible for multiplication, throw a run-time error exception

Definition at line 383 of file debug.hpp.

References arma_incompat_size_string(), Mat< eT >::n_cols, and Mat< eT >::n_rows.

00384   {
00385   if(A.n_cols != B.n_rows)
00386     {
00387     throw std::runtime_error
00388       (
00389       arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x)
00390       );
00391     }
00392   }

template<typename eT1 , typename eT2 >
void arma_hot arma_assert_mul_size ( const Mat< eT1 > &  A,
const subview< eT2 > &  B,
const char *  x 
) [inline]

Definition at line 400 of file debug.hpp.

References arma_incompat_size_string(), subview< eT >::n_cols, Mat< eT >::n_cols, Mat< eT >::n_rows, and subview< eT >::n_rows.

00401   {
00402   if(A.n_cols != B.n_rows)
00403     {
00404     throw std::runtime_error
00405       (
00406       arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x)
00407       );
00408     }
00409   }

template<typename eT1 , typename eT2 >
void arma_hot arma_assert_mul_size ( const subview< eT1 > &  A,
const Mat< eT2 > &  B,
const char *  x 
) [inline]

Definition at line 417 of file debug.hpp.

References arma_incompat_size_string(), Mat< eT >::n_cols, subview< eT >::n_cols, subview< eT >::n_rows, and Mat< eT >::n_rows.

00418   {
00419   if(A.n_cols != B.n_rows)
00420     {
00421     throw std::runtime_error
00422       (
00423       arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x)
00424       );
00425     }
00426   }

template<typename eT1 , typename eT2 >
void arma_hot arma_assert_mul_size ( const subview< eT1 > &  A,
const subview< eT2 > &  B,
const char *  x 
) [inline]

Definition at line 434 of file debug.hpp.

References arma_incompat_size_string(), subview< eT >::n_cols, and subview< eT >::n_rows.

00435   {
00436   if(A.n_cols != B.n_rows)
00437     {
00438     throw std::runtime_error
00439       (
00440       arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x)
00441       );
00442     }
00443   }

template<typename T1 >
void arma_stop ( const T1 &  x  )  [inline]