My Project
Macros | Typedefs | Functions
common.hpp File Reference

Common aliases and utilities shared across CPU components. More...

#include <Eigen/Eigen>
#include <functional>
#include <iostream>
Include dependency graph for common.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define check(condition, message)
 Debug assertion with message and source location. More...
 

Typedefs

template<typename T >
using GradFun = std::function< T(T)>
 Gradient function type alias (T -> T). More...
 
template<typename T , typename W >
using VecFun = std::function< W(T)>
 Objective function type alias (T -> W). More...
 
template<typename V , typename M >
using HessFun = std::function< M(V)>
 Hessian function type alias (V -> M). More...
 

Functions

void checkParallelism ()
 Print Eigen/OpenMP parallelism settings for diagnostics. More...
 

Detailed Description

Common aliases and utilities shared across CPU components.

Macro Definition Documentation

◆ check

#define check (   condition,
  message 
)
Value:
do { \
if (!condition) { \
std::cerr << "[FAILED ASSERTION]" << std::endl; \
std::cerr << " Condition: " << #condition << std::endl; \
std::cerr << " Message: " << (message) << std::endl; \
std::cerr << " File: " << __FILE__ << ", Line: " << __LINE__ << std::endl; \
std::cerr << " Aborting..." << std::endl; \
std::abort(); \
} \
} while (0)

Debug assertion with message and source location.

Typedef Documentation

◆ GradFun

template<typename T >
using GradFun = std::function<T(T)>

Gradient function type alias (T -> T).

◆ HessFun

template<typename V , typename M >
using HessFun = std::function<M(V)>

Hessian function type alias (V -> M).

◆ VecFun

template<typename T , typename W >
using VecFun = std::function<W(T)>

Objective function type alias (T -> W).

Function Documentation

◆ checkParallelism()

void checkParallelism ( )
inline

Print Eigen/OpenMP parallelism settings for diagnostics.