CArl
Code Arlequin / C++ implementation
common_header.h
Go to the documentation of this file.
1 /*
2  * common_header.h
3  *
4  * Created on: Jul 29, 2015
5  * Author: Thiago Milanetto Schlittler
6  *
7  * File containing all the external libraries includes (except the CGAL
8  * ones, included in "CGAL_typedefs")
9  *
10  */
11 
12 #ifndef COMMON_HEADER_H_
13 #define COMMON_HEADER_H_
14 
15 // --- Timing
16 #include <chrono>
17 
18 // --- Boost/random
19 #include <boost/random/uniform_real_distribution.hpp>
20 #include <boost/random/lagged_fibonacci.hpp>
21 
22 // --- Boost/variant and functional
23 //#include <boost/variant/apply_visitor.hpp>
24 //#include <functional>
25 
26 // --- Boost/hash
27 //#include <boost/functional/hash.hpp>
28 
29 // --- Boost/filesystem
30 //#include <boost/filesystem.hpp>
31 
32 // --- IO
33 #include <fstream>
34 #include <iostream>
35 
36 // --- Containers and algorithms
37 #include <unordered_set>
38 #include <unordered_map>
39 #include <deque>
40 #include <vector>
41 #include <iterator>
42 #include <algorithm>
43 #include <tuple>
44 #include <map>
45 
46 // --- C++ strings
47 #include <string>
48 #include <sstream>
49 
50 // --- Common C/C++
51 #include <math.h>
52 #include <unistd.h>
53 
54 #include <cstdio>
55 #include <iostream>
56 #include <memory>
57 #include <stdexcept>
58 #include <array>
59 
60 extern boost::random::lagged_fibonacci607 m_rng;
61 
62 // A small homemade assert
63 #define homemade_assert_msg(asserted, msg) do \
64 { \
65  if (!(asserted)) \
66  { \
67  std::cerr << "Assertion `" #asserted "` failed in " << __FILE__ << std::endl\
68  << " > line " << __LINE__ << ": " << msg << std::endl; \
69  std::exit(EXIT_FAILURE); \
70  } \
71 } while(false)
72 
73 #define homemade_error_msg(msg) do \
74 { \
75  std::cerr << "Error: " << msg << std::endl; \
76  std::exit(EXIT_FAILURE); \
77 } while(false)
78 
79 #endif /* COMMON_HEADER_H_ */
boost::random::lagged_fibonacci607 m_rng