Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
init.h
Go to the documentation of this file.
1/* Brush
2copyright 2017 William La Cava
3license: GNU/GPL v3
4*/
5
6#ifndef INIT_H
7#define INIT_H
8
9#ifdef _OPENMP
10 #include <omp.h>
11#else
12 #define omp_get_thread_num() 0
13 #define omp_get_num_threads() 1
14 #define omp_get_max_threads() 1
15 #define omp_set_num_threads( x ) 0
16#endif
17// stuff being used
18#include "stdint.h"
19#include <Eigen/Dense>
20#include <memory>
21#include <iostream>
22#include <fstream>
23#include <numeric>
24#include <map>
25#include <set>
26#include <vector>
27#include <string>
28/* #include <fmt/core.h> */
29#define FMT_HEADER_ONLY
30#include <fmt/ostream.h>
31#include <fmt/format.h>
32#include <fmt/ranges.h>
33
34using Eigen::MatrixXf;
35using Eigen::Matrix;
36using Eigen::Array;
37using Eigen::Ref;
38using Eigen::BDCSVD;
39using Eigen::StrictlyUpper;
40using Eigen::ArrayXXf;
41using Eigen::ArrayXXi;
42using Eigen::VectorXf;
43using Eigen::VectorXi;
44using Eigen::ArrayXf;
45using Eigen::seq;
46// STD
47using std::map;
48using std::vector;
49using std::set;
50using std::string;
51using std::unique_ptr;
52using std::shared_ptr;
53using std::make_shared;
54using std::cout;
55typedef std::map<string,
56 std::pair<vector<ArrayXf>, vector<ArrayXf>>
58using Eigen::Dynamic;
59using Eigen::Map;
60// internal includes
61// #include "../thirdparty/json.hpp"
62#include "nlohmann/json.hpp"
63using nlohmann::json;
64
65static float NEAR_ZERO = 0.0000001;
66static float MAX_FLT = std::numeric_limits<float>::max();
67static float MIN_FLT = std::numeric_limits<float>::lowest();
68
69#include "types.h"
70namespace Brush{
71// helper constant for the visitor
72template<class> inline constexpr bool always_false_v = false;
73// explicit deduction guide (not needed as of C++20)
74/* template<class... Ts> struct overloaded : Ts... { using Ts::operator()...; }; */
75/* template<class... Ts> overloaded(Ts...) -> overloaded<Ts...>; */
76}
77
78#endif
static float MAX_FLT
Definition init.h:66
static float MIN_FLT
Definition init.h:67
static float NEAR_ZERO
Definition init.h:65
std::map< string, std::pair< vector< ArrayXf >, vector< ArrayXf > > > LongData
Definition init.h:57
< nsga2 selection operator for getting the front
Definition bandit.cpp:3
constexpr bool always_false_v
Definition init.h:72