arma_cold
arma_noinline
static
void
arma_stop(const T1& x)
{
#if defined(ARMA_PRINT_LOGIC_ERRORS)
    {
        std::ostream& out = get_stream_err1();

        out.flush();

        out << '\n';
        out << "error: " << x << '\n';
        out << '\n';
        out.flush();
    }
#else
    {
        arma_ignore(x);
    }
#endif

    throw std::logic_error("");
}
arma_cold
inline
void
arma_print()
{
    get_stream_err1() << std::endl;
}
arma_cold
arma_noinline
static
void
arma_print(const T1& x, const T2& y, const T3& z)
{
    get_stream_err1() << x << y << z << std::endl;
}
arma_cold
arma_noinline
static
void
arma_print(const T1& x)
{
    get_stream_err1() << x << std::endl;
}
arma_cold
arma_noinline
static
void
arma_stop_bad_alloc(const T1& x)
{
    std::ostream& out = get_stream_err1();

    out.flush();

    out << '\n';
    out << "error: " << x << '\n';
    out << '\n';
    out.flush();

    throw std::bad_alloc();
}
示例#6
0
文件: debug.hpp 项目: Alkonis/COSyn
 inline
 arma_first_extra_debug_message()
   {
   union
     {
     unsigned short a;
     unsigned char  b[sizeof(unsigned short)];
     } endian_test;
     
   endian_test.a = 1;
   
   const bool  little_endian = (endian_test.b[0] == 1);
   const char* nickname      = ARMA_VERSION_NAME;
   
   std::ostream& out = get_stream_err1();
   
   out << "@ ---" << '\n';
   out << "@ Armadillo "
       << arma_version::major << '.' << arma_version::minor << '.' << arma_version::patch
       << " (" << nickname << ")\n";
   
   out << "@ arma_config::use_wrapper  = " << arma_config::use_wrapper  << '\n';
   out << "@ arma_config::use_cxx11    = " << arma_config::use_cxx11    << '\n';
   out << "@ arma_config::lapack       = " << arma_config::lapack       << '\n';
   out << "@ arma_config::blas         = " << arma_config::blas         << '\n';
   out << "@ arma_config::arpack       = " << arma_config::arpack       << '\n';
   out << "@ arma_config::atlas        = " << arma_config::atlas        << '\n';
   out << "@ arma_config::hdf5         = " << arma_config::hdf5         << '\n';
   out << "@ arma_config::good_comp    = " << arma_config::good_comp    << '\n';
   out << "@ arma_config::extra_code   = " << arma_config::extra_code   << '\n';
   out << "@ arma_config::mat_prealloc = " << arma_config::mat_prealloc << '\n';
   out << "@ sizeof(void*)    = " << sizeof(void*)    << '\n';
   out << "@ sizeof(uword)    = " << sizeof(uword)    << '\n';
   out << "@ sizeof(int)      = " << sizeof(int)      << '\n';
   out << "@ sizeof(long)     = " << sizeof(long)     << '\n';
   out << "@ sizeof(blas_int) = " << sizeof(blas_int) << '\n';
   out << "@ little_endian    = " << little_endian    << '\n';
   out << "@ ---" << std::endl;
   }
inline
void
arma_thisprint(const void* this_ptr)
{
    get_stream_err1() << " [this = " << this_ptr << ']' << std::endl;
}
inline
void
arma_bktprint(const T1& x, const T2& y)
{
    get_stream_err1() << " [" << x << y << ']' << std::endl;
}
inline
void
arma_bktprint()
{
    get_stream_err1() << std::endl;
}
//! print a message the the log stream with a preceding @ character.
//! by default the log stream is cout.
//! used for printing the signature of a function
//! (see the arma_extra_debug_sigprint macro)
inline
void
arma_sigprint(const char* x)
{
    get_stream_err1() << "@ " << x;
}