mlpack  1.0.12
prereqs.hpp
Go to the documentation of this file.
1 
13 #ifndef __MLPACK_PREREQS_HPP
14 #define __MLPACK_PREREQS_HPP
15 
16 // First, check if Armadillo was included before, warning if so.
17 #ifdef ARMA_INCLUDES
18 #pragma message "Armadillo was included before mlpack; this can sometimes cause\
19 problems. It should only be necessary to include <mlpack/core.hpp> and not\
20 <armadillo>."
21 #endif
22 
23 // Next, standard includes.
24 #include <stdlib.h>
25 #include <stdio.h>
26 #include <string.h>
27 #include <ctype.h>
28 #include <limits.h>
29 #include <float.h>
30 #include <stdint.h>
31 #include <iostream>
32 
33 // Defining _USE_MATH_DEFINES should set M_PI.
34 #define _USE_MATH_DEFINES
35 #include <math.h>
36 
37 // For tgamma().
38 #include <boost/math/special_functions/gamma.hpp>
39 
40 // But if it's not defined, we'll do it.
41 #ifndef M_PI
42  #define M_PI 3.141592653589793238462643383279
43 #endif
44 
45 // Give ourselves a nice way to force functions to be inline if we need.
46 #define force_inline
47 #if defined(__GNUG__) && !defined(DEBUG)
48  #undef force_inline
49  #define force_inline __attribute__((always_inline))
50 #elif defined(_MSC_VER) && !defined(DEBUG)
51  #undef force_inline
52  #define force_inline __forceinline
53 #endif
54 
55 // Now include Armadillo through the special mlpack extensions.
56 #include <mlpack/core/arma_extend/arma_extend.hpp>
57 
58 // On Visual Studio, disable C4519 (default arguments for function templates)
59 // since it's by default an error, which doesn't even make any sense because
60 // it's part of the C++11 standard.
61 #ifdef _MSC_VER
62  #pragma warning(disable : 4519)
63 #endif
64 
65 #endif