14 #define check(condition, message) \
17 std::cerr << "[FAILED ASSERTION]" << std::endl; \
18 std::cerr << " Condition: " << #condition << std::endl; \
19 std::cerr << " Message: " << (message) << std::endl; \
20 std::cerr << " File: " << __FILE__ << ", Line: " << __LINE__ << std::endl; \
21 std::cerr << " Aborting..." << std::endl; \
28 #define check(condition, message) ((void)0)
32 template <
typename T>
using GradFun = std::function<T(T)>;
35 template <
typename T,
typename W>
using VecFun = std::function<W(T)>;
38 template <
typename V,
typename M>
using HessFun = std::function<M(V)>;
46 std::cout <<
"=== CHECK EIGEN PARALLELISM ===" << std::endl;
48 #ifdef EIGEN_USE_OPENMP
49 std::cout <<
"[COMPILE] EIGEN_USE_OPENMP macro: ACTIVE (OK)" << std::endl;
51 std::cout <<
"[COMPILE] EIGEN_USE_OPENMP macro: INACTIVE (Warning!)" << std::endl;
55 std::cout <<
"[OPENMP] OpenMP detected." << std::endl;
56 std::cout <<
"[OPENMP] Max available threads: " << omp_get_max_threads() << std::endl;
58 std::cout <<
"[OPENMP] OpenMP NOT detected by compiler." << std::endl;
61 std::cout <<
"[EIGEN] Eigen will use: " << Eigen::nbThreads() <<
" threads." << std::endl;
63 std::cout <<
"================================" << std::endl << std::endl;
std::function< T(T)> GradFun
Gradient function type alias (T -> T).
Definition: common.hpp:32
std::function< W(T)> VecFun
Objective function type alias (T -> W).
Definition: common.hpp:35
void checkParallelism()
Print Eigen/OpenMP parallelism settings for diagnostics.
Definition: common.hpp:45
std::function< M(V)> HessFun
Hessian function type alias (V -> M).
Definition: common.hpp:38