Namespaces | Functions

Debug

//! More...

Namespaces

namespace  junk

Functions

template<typename T1 >
void arma_cold arma_stop (const T1 &x)
 print a message to std::cout and/or throw a run-time error exception
void arma_cold arma_print ()
template<typename T1 >
void arma_cold arma_print (const T1 &x)
template<typename T1 , typename T2 >
void arma_cold arma_print (const T1 &x, const T2 &y)
template<typename T1 , typename T2 , typename T3 >
void arma_cold arma_print (const T1 &x, const T2 &y, const T3 &z)
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)
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_check (const bool state, const T1 &x)
 if state is true, abort program
template<typename T1 , typename T2 >
void arma_hot arma_check (const bool state, const T1 &x, const T2 &y)
std::string arma_cold 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)
 stop if given matrices have different sizes
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const Proxy< eT1 > &A, const Proxy< eT2 > &B, const char *x)
 stop if given proxies have different sizes
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const subview< eT1 > &A, const subview< eT2 > &B, const char *x)
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 Mat< eT1 > &A, const Proxy< eT2 > &B, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const Proxy< eT1 > &A, const Mat< eT2 > &B, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const Proxy< 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 Proxy< eT2 > &B, const char *x)
arma_cold std::string arma_incompat_size_string (const u32 A_n_rows, const u32 A_n_cols, const u32 A_n_slices, const u32 B_n_rows, const u32 B_n_cols, const u32 B_n_slices, const char *x)
void arma_hot arma_assert_same_size (const u32 A_n_rows, const u32 A_n_cols, const u32 A_n_slices, const u32 B_n_rows, const u32 B_n_cols, const u32 B_n_slices, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const Cube< eT1 > &A, const Cube< eT2 > &B, const char *x)
 stop if given cubes have different sizes
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const Cube< eT1 > &A, const subview_cube< eT2 > &B, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const subview_cube< eT1 > &A, const Cube< eT2 > &B, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const subview_cube< eT1 > &A, const subview_cube< eT2 > &B, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const ProxyCube< eT1 > &A, const ProxyCube< eT2 > &B, const char *x)
 stop if given cube proxies have different sizes
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const Cube< eT1 > &A, const Mat< eT2 > &B, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const Mat< eT1 > &A, const Cube< eT2 > &B, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const subview_cube< eT1 > &A, const Mat< eT2 > &B, const char *x)
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size (const Mat< eT1 > &A, const subview_cube< 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)
 stop if given matrices are incompatible for multiplication
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_mul_size (const Mat< eT1 > &A, const Mat< eT2 > &B, const bool do_trans_A, const bool do_trans_B, const char *x)
 stop if given matrices are incompatible for multiplication
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)

Detailed Description

//!


Function Documentation

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

Definition at line 61 of file debug.hpp.

  {
  std::cout << x << std::endl;
  }

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

Definition at line 72 of file debug.hpp.

  {
  std::cout << x << y << std::endl;
  }

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

Definition at line 83 of file debug.hpp.

  {
  std::cout << x << y << z << std::endl;
  }

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 101 of file debug.hpp.

  {
  std::cout << "@ " << x;
  }

void arma_bktprint (  )  [inline]

Definition at line 114 of file debug.hpp.

  {
  std::cout << std::endl;
  }

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

Definition at line 123 of file debug.hpp.

  {
  std::cout << " [" << x << ']' << std::endl;
  }

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

Definition at line 133 of file debug.hpp.

  {
  std::cout << " [" << x << y << ']' << std::endl;
  }

void arma_thisprint ( void *  this_ptr  )  [inline]

Definition at line 149 of file debug.hpp.

  {
  std::cout << " [this = " << this_ptr << ']' << std::endl;
  }

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 164 of file debug.hpp.

References arma_print().

Referenced by op_inv::apply(), det(), Mat< eT >::load(), Cube< eT >::load(), Mat< eT >::save(), and Cube< eT >::save().

  {
  if(state==true)
    {
    arma_print(x);
    }
  }

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

Definition at line 177 of file debug.hpp.

References arma_print().

  {
  if(state==true)
    {
    arma_print(x,y);
    }
  }

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 210 of file debug.hpp.

References arma_stop().

  {
  if(state==true)
    {
    arma_stop( std::string(x) + std::string(y) );
    }
  }

std::string arma_cold 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 231 of file debug.hpp.

Referenced by arma_assert_mul_size(), and arma_assert_same_size().

  {
  std::stringstream tmp;
  
  tmp << x << ": incompatible matrix dimensions: (" << A_n_rows << ',' << A_n_cols << ") and (" << B_n_rows << ',' << B_n_cols << ')';
  
  return tmp.str();
  }

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]
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size ( const Mat< eT1 > &  A,
const Mat< eT2 > &  B,
const char *  x 
) [inline]

stop if given matrices have different sizes

Definition at line 260 of file debug.hpp.

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

  {
  if( (A.n_rows != B.n_rows) || (A.n_cols != B.n_cols) )
    {
    arma_stop( arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x) );
    }
  }

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

stop if given proxies have different sizes

Definition at line 275 of file debug.hpp.

References arma_incompat_size_string(), and arma_stop().

  {
  if( (A.n_rows != B.n_rows) || (A.n_cols != B.n_cols) )
    {
    arma_stop( arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x) );
    }
  }

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 289 of file debug.hpp.

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

  {
  if( (A.n_rows != B.n_rows) || (A.n_cols != B.n_cols) )
    {
    arma_stop( arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x) );
    }
  }

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

Definition at line 331 of file debug.hpp.

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

  {
  if( (A.n_rows != B.n_rows) || (A.n_cols != B.n_cols) )
    {
    arma_stop ( arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x) );
    }
  }

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

Definition at line 345 of file debug.hpp.

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

  {
  if( (A.n_rows != B.n_rows) || (A.n_cols != B.n_cols) )
    {
    arma_stop( arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x) );
    }
  }

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

Definition at line 359 of file debug.hpp.

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

  {
  if( (A.n_rows != B.n_rows) || (A.n_cols != B.n_cols) )
    {
    arma_stop( arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x) );
    }
  }

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

Definition at line 373 of file debug.hpp.

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

  {
  if( (A.n_rows != B.n_rows) || (A.n_cols != B.n_cols) )
    {
    arma_stop( arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x) );
    }
  }

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

Definition at line 391 of file debug.hpp.

  {
  std::stringstream tmp;
  
  tmp << x << ": incompatible cube dimensions: (" << A_n_rows << ',' << A_n_cols << ',' << A_n_slices << ") and (" << B_n_rows << ',' << B_n_cols << ',' << B_n_slices << ')';
  
  return tmp.str();
  }

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

Definition at line 405 of file debug.hpp.

References arma_incompat_size_string(), and arma_stop().

  {
  if( (A_n_rows != B_n_rows) || (A_n_cols != B_n_cols) || (A_n_slices != B_n_slices) )
    {
    arma_stop( arma_incompat_size_string(A_n_rows, A_n_cols, A_n_slices, B_n_rows, B_n_cols, B_n_slices, x) );
    }
  }

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

stop if given cubes have different sizes

Definition at line 420 of file debug.hpp.

References arma_incompat_size_string(), arma_stop(), Cube< eT >::n_cols, Cube< eT >::n_rows, and Cube< eT >::n_slices.

  {
  if( (A.n_rows != B.n_rows) || (A.n_cols != B.n_cols) || (A.n_slices != B.n_slices) )
    {
    arma_stop( arma_incompat_size_string(A.n_rows, A.n_cols, A.n_slices, B.n_rows, B.n_cols, B.n_slices, x) );
    }
  }

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

stop if given cube proxies have different sizes

Definition at line 477 of file debug.hpp.

References arma_incompat_size_string(), and arma_stop().

  {
  if( (A.n_rows != B.n_rows) || (A.n_cols != B.n_cols) || (A.n_slices != B.n_slices))
    {
    arma_stop( arma_incompat_size_string(A.n_rows, A.n_cols, A.n_slices, B.n_rows, B.n_cols, B.n_slices, x) );
    }
  }

template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size ( const Cube< eT1 > &  A,
const Mat< eT2 > &  B,
const char *  x 
) [inline]
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size ( const Mat< eT1 > &  A,
const Cube< eT2 > &  B,
const char *  x 
) [inline]
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size ( const subview_cube< eT1 > &  A,
const Mat< eT2 > &  B,
const char *  x 
) [inline]
template<typename eT1 , typename eT2 >
void arma_hot arma_assert_same_size ( const Mat< eT1 > &  A,
const subview_cube< eT2 > &  B,
const char *  x 
) [inline]
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 556 of file debug.hpp.

References arma_incompat_size_string(), and arma_stop().

  {
  if(A_n_cols != B_n_rows)
    {
    arma_stop( arma_incompat_size_string(A_n_rows, A_n_cols, B_n_rows, B_n_cols, x) );
    }
  }

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

stop if given matrices are incompatible for multiplication

Definition at line 571 of file debug.hpp.

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

  {
  if(A.n_cols != B.n_rows)
    {
    arma_stop( arma_incompat_size_string(A.n_rows, A.n_cols, B.n_rows, B.n_cols, x) );
    }
  }

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

stop if given matrices are incompatible for multiplication

Definition at line 586 of file debug.hpp.

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

  {
  const u32 final_A_n_cols = (do_trans_A == false) ? A.n_cols : A.n_rows;
  const u32 final_B_n_rows = (do_trans_B == false) ? B.n_rows : B.n_cols;
    
  if(final_A_n_cols != final_B_n_rows)
    {
    const u32 final_A_n_rows = (do_trans_A == false) ? A.n_rows : A.n_cols;
    const u32 final_B_n_cols = (do_trans_B == false) ? B.n_cols : B.n_rows;
    
    arma_stop( arma_incompat_size_string(final_A_n_rows, final_A_n_cols, final_B_n_rows, final_B_n_cols, x) );
    }
  }

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