libcmaes 0.10.2
A C++11 library for stochastic optimization with CMA-ES
Loading...
Searching...
No Matches
llogging.h
1
22#ifndef LLOGGING_H
23#define LLOGGING_H
24
25#include <libcmaes/libcmaes_config.h>
26
27#ifdef HAVE_GLOG // HAVE_LIB_GLOG
28#include <glog/logging.h>
29#else
30#include <iostream>
31
32namespace libcmaes
33{
34 static std::string INFO="INFO";
35 static std::string WARNING="WARNING";
36 static std::string ERROR="ERROR";
37 static std::string FATAL="FATAL";
38
39 static std::ostream nullstream(0);
40
41inline std::ostream& LOG(const std::string &severity,std::ostream &out=std::cout)
42{
43 out << severity << " - ";
44 return out;
45}
46
47inline std::ostream& LOG_IF(const std::string &severity,const bool &condition,std::ostream &out=std::cout)
48{
49 if (condition)
50 return LOG(severity,out);
51 else return nullstream;
52}
53}
54#endif
55#endif
linear scaling of the parameter space to achieve similar sensitivity across all components.
Definition acovarianceupdate.h:30