MLPACK  1.0.7
core.hpp
Go to the documentation of this file.
1 /***
2  * @file core.hpp
3  *
4  * Include all of the base components required to write MLPACK methods, and the
5  * main MLPACK Doxygen documentation.
6  *
7  * This file is part of MLPACK 1.0.7.
8  *
9  * MLPACK is free software: you can redistribute it and/or modify it under the
10  * terms of the GNU Lesser General Public License as published by the Free
11  * Software Foundation, either version 3 of the License, or (at your option) any
12  * later version.
13  *
14  * MLPACK is distributed in the hope that it will be useful, but WITHOUT ANY
15  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16  * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17  * details (LICENSE.txt).
18  *
19  * You should have received a copy of the GNU General Public License along with
20  * MLPACK. If not, see <http://www.gnu.org/licenses/>.
21  */
22 #ifndef __MLPACK_CORE_HPP
23 #define __MLPACK_CORE_HPP
24 
150 // First, standard includes.
151 #include <stdlib.h>
152 #include <stdio.h>
153 #include <string.h>
154 #include <ctype.h>
155 #include <limits.h>
156 #include <float.h>
157 #include <stdint.h>
158 #include <iostream>
159 
160 // Defining _USE_MATH_DEFINES should set M_PI.
161 #define _USE_MATH_DEFINES
162 #include <math.h>
163 
164 // For tgamma().
165 #include <boost/math/special_functions/gamma.hpp>
166 
167 // But if it's not defined, we'll do it.
168 #ifndef M_PI
169  #define M_PI 3.141592653589793238462643383279
170 #endif
171 
172 // Give ourselves a nice way to force functions to be inline if we need.
173 #define force_inline
174 #if defined(__GNUG__) && !defined(DEBUG)
175  #undef force_inline
176  #define force_inline __attribute__((always_inline))
177 #elif defined(_MSC_VER) && !defined(DEBUG)
178  #undef force_inline
179  #define force_inline __forceinline
180 #endif
181 
182 // Now MLPACK-specific includes.
183 #include <mlpack/core/arma_extend/arma_extend.hpp> // Includes Armadillo.
184 #include <mlpack/core/util/log.hpp>
185 #include <mlpack/core/util/cli.hpp>
186 #include <mlpack/core/data/load.hpp>
187 #include <mlpack/core/data/save.hpp>
197 
198 // Include kernel traits.
210 
211 #endif
212 
213 // Clean up unfortunate Windows preprocessor definitions, even if this file was
214 // already included. Use std::min and std::max!
215 #ifdef _WIN32
216  #ifdef min
217  #undef min
218  #endif
219 
220  #ifdef max
221  #undef max
222  #endif
223 #endif
Miscellaneous math clamping routines.
Miscellaneous math random-related routines.
Definition of the Range class, which represents a simple range with a lower and upper bound...