debug.hpp (armadillo-10.8.2.tar.xz) | : | debug.hpp (armadillo-11.0.0.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 117 | skipping to change at line 117 | |||
} | } | |||
//! print a message to get_cerr_stream() and throw logic_error exception | //! print a message to get_cerr_stream() and throw logic_error exception | |||
template<typename T1> | template<typename T1> | |||
arma_cold | arma_cold | |||
arma_noinline | arma_noinline | |||
static | static | |||
void | void | |||
arma_stop_logic_error(const T1& x) | arma_stop_logic_error(const T1& x) | |||
{ | { | |||
#if (defined(ARMA_PRINT_EXCEPTIONS) && defined(ARMA_PRINT_ERRORS)) | #if defined(ARMA_PRINT_EXCEPTIONS) | |||
{ | { | |||
get_cerr_stream() << "\nerror: " << x << std::endl; | get_cerr_stream() << "\nerror: " << x << std::endl; | |||
} | } | |||
#endif | #endif | |||
throw std::logic_error( std::string(x) ); | throw std::logic_error( std::string(x) ); | |||
} | } | |||
arma_cold | arma_cold | |||
arma_noinline | arma_noinline | |||
skipping to change at line 143 | skipping to change at line 143 | |||
} | } | |||
//! print a message to get_cerr_stream() and throw logic_error exception | //! print a message to get_cerr_stream() and throw logic_error exception | |||
template<typename T1> | template<typename T1> | |||
arma_cold | arma_cold | |||
arma_noinline | arma_noinline | |||
static | static | |||
void | void | |||
arma_stop_bounds_error(const T1& x) | arma_stop_bounds_error(const T1& x) | |||
{ | { | |||
#if (defined(ARMA_PRINT_EXCEPTIONS) && defined(ARMA_PRINT_ERRORS)) | #if defined(ARMA_PRINT_EXCEPTIONS) | |||
{ | { | |||
get_cerr_stream() << "\nerror: " << x << std::endl; | get_cerr_stream() << "\nerror: " << x << std::endl; | |||
} | } | |||
#endif | #endif | |||
throw std::out_of_range( std::string(x) ); | throw std::out_of_range( std::string(x) ); | |||
} | } | |||
//! print a message to get_cerr_stream() and throw bad_alloc exception | //! print a message to get_cerr_stream() and throw bad_alloc exception | |||
template<typename T1> | template<typename T1> | |||
arma_cold | arma_cold | |||
arma_noinline | arma_noinline | |||
static | static | |||
void | void | |||
arma_stop_bad_alloc(const T1& x) | arma_stop_bad_alloc(const T1& x) | |||
{ | { | |||
#if (defined(ARMA_PRINT_EXCEPTIONS) && defined(ARMA_PRINT_ERRORS)) | #if defined(ARMA_PRINT_EXCEPTIONS) | |||
{ | { | |||
get_cerr_stream() << "\nerror: " << x << std::endl; | get_cerr_stream() << "\nerror: " << x << std::endl; | |||
} | } | |||
#else | #else | |||
{ | { | |||
arma_ignore(x); | arma_ignore(x); | |||
} | } | |||
#endif | #endif | |||
throw std::bad_alloc(); | throw std::bad_alloc(); | |||
} | } | |||
//! print a message to get_cerr_stream() and throw runtime_error exception | //! print a message to get_cerr_stream() and throw runtime_error exception | |||
template<typename T1> | template<typename T1> | |||
arma_cold | arma_cold | |||
arma_noinline | arma_noinline | |||
static | static | |||
void | void | |||
arma_stop_runtime_error(const T1& x) | arma_stop_runtime_error(const T1& x) | |||
{ | { | |||
#if (defined(ARMA_PRINT_EXCEPTIONS) && defined(ARMA_PRINT_ERRORS)) | #if defined(ARMA_PRINT_EXCEPTIONS) | |||
{ | { | |||
get_cerr_stream() << "\nerror: " << x << std::endl; | get_cerr_stream() << "\nerror: " << x << std::endl; | |||
} | } | |||
#endif | #endif | |||
throw std::runtime_error( std::string(x) ); | throw std::runtime_error( std::string(x) ); | |||
} | } | |||
// | // | |||
// arma_print | // arma_print | |||
skipping to change at line 292 | skipping to change at line 292 | |||
// arma_warn | // arma_warn | |||
//! print a message to the warn stream | //! print a message to the warn stream | |||
template<typename T1> | template<typename T1> | |||
arma_cold | arma_cold | |||
arma_noinline | arma_noinline | |||
static | static | |||
void | void | |||
arma_warn(const T1& arg1) | arma_warn(const T1& arg1) | |||
{ | { | |||
#if defined(ARMA_PRINT_ERRORS) | get_cerr_stream() << "\nwarning: " << arg1 << '\n'; | |||
{ | ||||
get_cerr_stream() << "\nwarning: " << arg1 << '\n'; | ||||
} | ||||
#else | ||||
{ | ||||
arma_ignore(arg1); | ||||
} | ||||
#endif | ||||
} | } | |||
template<typename T1, typename T2> | template<typename T1, typename T2> | |||
arma_cold | arma_cold | |||
arma_noinline | arma_noinline | |||
static | static | |||
void | void | |||
arma_warn(const T1& arg1, const T2& arg2) | arma_warn(const T1& arg1, const T2& arg2) | |||
{ | { | |||
#if defined(ARMA_PRINT_ERRORS) | get_cerr_stream() << "\nwarning: " << arg1 << arg2 << '\n'; | |||
{ | ||||
get_cerr_stream() << "\nwarning: " << arg1 << arg2 << '\n'; | ||||
} | ||||
#else | ||||
{ | ||||
arma_ignore(arg1); | ||||
arma_ignore(arg2); | ||||
} | ||||
#endif | ||||
} | } | |||
template<typename T1, typename T2, typename T3> | template<typename T1, typename T2, typename T3> | |||
arma_cold | arma_cold | |||
arma_noinline | arma_noinline | |||
static | static | |||
void | void | |||
arma_warn(const T1& arg1, const T2& arg2, const T3& arg3) | arma_warn(const T1& arg1, const T2& arg2, const T3& arg3) | |||
{ | { | |||
#if defined(ARMA_PRINT_ERRORS) | get_cerr_stream() << "\nwarning: " << arg1 << arg2 << arg3 << '\n'; | |||
{ | ||||
get_cerr_stream() << "\nwarning: " << arg1 << arg2 << arg3 << '\n'; | ||||
} | ||||
#else | ||||
{ | ||||
arma_ignore(arg1); | ||||
arma_ignore(arg2); | ||||
arma_ignore(arg3); | ||||
} | ||||
#endif | ||||
} | } | |||
template<typename T1, typename T2, typename T3, typename T4> | template<typename T1, typename T2, typename T3, typename T4> | |||
arma_cold | arma_cold | |||
arma_noinline | arma_noinline | |||
static | static | |||
void | void | |||
arma_warn(const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4) | arma_warn(const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4) | |||
{ | { | |||
#if defined(ARMA_PRINT_ERRORS) | get_cerr_stream() << "\nwarning: " << arg1 << arg2 << arg3 << arg4 << '\n'; | |||
{ | ||||
get_cerr_stream() << "\nwarning: " << arg1 << arg2 << arg3 << arg4 << '\n'; | ||||
} | ||||
#else | ||||
{ | ||||
arma_ignore(arg1); | ||||
arma_ignore(arg2); | ||||
arma_ignore(arg3); | ||||
arma_ignore(arg4); | ||||
} | ||||
#endif | ||||
} | } | |||
// | // | |||
// arma_warn_level | // arma_warn_level | |||
template<typename T1> | template<typename T1> | |||
inline | inline | |||
void | void | |||
arma_warn_level(const uword level, const T1& arg1) | arma_warn_level(const uword level, const T1& arg1) | |||
{ | { | |||
skipping to change at line 1157 | skipping to change at line 1119 | |||
overflow = (B.n_rows > ARMA_MAX_BLAS_INT) || overflow; | overflow = (B.n_rows > ARMA_MAX_BLAS_INT) || overflow; | |||
overflow = (B.n_cols > ARMA_MAX_BLAS_INT) || overflow; | overflow = (B.n_cols > ARMA_MAX_BLAS_INT) || overflow; | |||
if(overflow) | if(overflow) | |||
{ | { | |||
arma_stop_runtime_error("integer overflow: matrix dimensions are too large for integer type used by BLAS and LAPACK"); | arma_stop_runtime_error("integer overflow: matrix dimensions are too large for integer type used by BLAS and LAPACK"); | |||
} | } | |||
} | } | |||
} | } | |||
// TODO: remove support for ATLAS in next major version | ||||
template<typename T1> | template<typename T1> | |||
arma_hot | arma_hot | |||
inline | inline | |||
void | void | |||
arma_assert_atlas_size(const T1& A) | arma_assert_atlas_size(const T1& A) | |||
{ | { | |||
if(sizeof(uword) >= sizeof(int)) | if(sizeof(uword) >= sizeof(int)) | |||
{ | { | |||
bool overflow; | bool overflow; | |||
overflow = (A.n_rows > INT_MAX); | overflow = (A.n_rows > INT_MAX); | |||
overflow = (A.n_cols > INT_MAX) || overflow; | overflow = (A.n_cols > INT_MAX) || overflow; | |||
if(overflow) | if(overflow) | |||
{ | { | |||
arma_stop_runtime_error("integer overflow: matrix dimensions are too large for integer type used by ATLAS"); | arma_stop_runtime_error("integer overflow: matrix dimensions are too large for integer type used by ATLAS"); | |||
} | } | |||
} | } | |||
} | } | |||
// TODO: remove support for ATLAS in next major version | ||||
template<typename T1, typename T2> | template<typename T1, typename T2> | |||
arma_hot | arma_hot | |||
inline | inline | |||
void | void | |||
arma_assert_atlas_size(const T1& A, const T2& B) | arma_assert_atlas_size(const T1& A, const T2& B) | |||
{ | { | |||
if(sizeof(uword) >= sizeof(int)) | if(sizeof(uword) >= sizeof(int)) | |||
{ | { | |||
bool overflow; | bool overflow; | |||
skipping to change at line 1284 | skipping to change at line 1248 | |||
const bool little_endian = (endian_test.b[0] == 1); | const bool little_endian = (endian_test.b[0] == 1); | |||
const char* nickname = ARMA_VERSION_NAME; | const char* nickname = ARMA_VERSION_NAME; | |||
std::ostream& out = get_cerr_stream(); | std::ostream& out = get_cerr_stream(); | |||
out << "@ ---" << '\n'; | out << "@ ---" << '\n'; | |||
out << "@ Armadillo " | out << "@ Armadillo " | |||
<< arma_version::major << '.' << arma_version::minor << '.' << arma_ version::patch | << arma_version::major << '.' << arma_version::minor << '.' << arma_ version::patch | |||
<< " (" << nickname << ")\n"; | << " (" << nickname << ")\n"; | |||
out << "@ arma_config::wrapper = " << arma_config::wrapper << | out << "@ arma_config::wrapper = " << arma_config::wrapper | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::cxx14 = " << arma_config::cxx14 << | out << "@ arma_config::cxx14 = " << arma_config::cxx14 | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::cxx17 = " << arma_config::cxx17 << | out << "@ arma_config::cxx17 = " << arma_config::cxx17 | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::std_mutex = " << arma_config::std_mutex << | out << "@ arma_config::std_mutex = " << arma_config::std_mutex | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::posix = " << arma_config::posix << | out << "@ arma_config::posix = " << arma_config::posix | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::openmp = " << arma_config::openmp << | out << "@ arma_config::openmp = " << arma_config::openmp | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::lapack = " << arma_config::lapack << | out << "@ arma_config::lapack = " << arma_config::lapack | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::blas = " << arma_config::blas << | out << "@ arma_config::blas = " << arma_config::blas | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::newarp = " << arma_config::newarp << | out << "@ arma_config::newarp = " << arma_config::newarp | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::arpack = " << arma_config::arpack << | out << "@ arma_config::arpack = " << arma_config::arpack | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::superlu = " << arma_config::superlu << | out << "@ arma_config::superlu = " << arma_config::superlu | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::atlas = " << arma_config::atlas << | out << "@ arma_config::atlas = " << arma_config::atlas | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::hdf5 = " << arma_config::hdf5 << | out << "@ arma_config::hdf5 = " << arma_config::hdf5 | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::good_comp = " << arma_config::good_comp << | out << "@ arma_config::good_comp = " << arma_config::good_comp | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::extra_code = " << arma_config::extra_code << | out << "@ arma_config::extra_code = " << arma_config::extra_code | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::hidden_args = " << arma_config::hidden_args << | out << "@ arma_config::hidden_args = " << arma_config::hidden_args | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::mat_prealloc = " << arma_config::mat_prealloc << | out << "@ arma_config::mat_prealloc = " << arma_config::mat_prealloc | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::mp_threshold = " << arma_config::mp_threshold << | out << "@ arma_config::mp_threshold = " << arma_config::mp_threshold | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::mp_threads = " << arma_config::mp_threads << | out << "@ arma_config::mp_threads = " << arma_config::mp_threads | |||
'\n'; | << '\n'; | |||
out << "@ arma_config::optimise_band = " << arma_config::optimise_ban | ||||
d << '\n'; | ||||
out << "@ arma_config::optimise_sympd = " << arma_config::optimise_sym | ||||
pd << '\n'; | ||||
out << "@ arma_config::optimise_invexpr = " << arma_config::optimise_inv | ||||
expr << '\n'; | ||||
out << "@ arma_config::check_nonfinite = " << arma_config::check_nonfin | ||||
ite << '\n'; | ||||
out << "@ sizeof(void*) = " << sizeof(void*) << '\n'; | out << "@ sizeof(void*) = " << sizeof(void*) << '\n'; | |||
out << "@ sizeof(int) = " << sizeof(int) << '\n'; | out << "@ sizeof(int) = " << sizeof(int) << '\n'; | |||
out << "@ sizeof(long) = " << sizeof(long) << '\n'; | out << "@ sizeof(long) = " << sizeof(long) << '\n'; | |||
out << "@ sizeof(uword) = " << sizeof(uword) << '\n'; | out << "@ sizeof(uword) = " << sizeof(uword) << '\n'; | |||
out << "@ sizeof(blas_int) = " << sizeof(blas_int) << '\n'; | out << "@ sizeof(blas_int) = " << sizeof(blas_int) << '\n'; | |||
out << "@ little_endian = " << little_endian << '\n'; | out << "@ little_endian = " << little_endian << '\n'; | |||
out << "@ ---" << std::endl; | out << "@ ---" << std::endl; | |||
} | } | |||
}; | }; | |||
End of changes. 11 change blocks. | ||||
84 lines changed or deleted | 56 lines changed or added |