00001 /*** 00002 * @file core.hpp 00003 * 00004 * Include all of the base components required to write MLPACK methods, and the 00005 * main MLPACK Doxygen documentation. 00006 * 00007 * This file is part of MLPACK 1.0.8. 00008 * 00009 * MLPACK is free software: you can redistribute it and/or modify it under the 00010 * terms of the GNU Lesser General Public License as published by the Free 00011 * Software Foundation, either version 3 of the License, or (at your option) any 00012 * later version. 00013 * 00014 * MLPACK is distributed in the hope that it will be useful, but WITHOUT ANY 00015 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00016 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00017 * details (LICENSE.txt). 00018 * 00019 * You should have received a copy of the GNU General Public License along with 00020 * MLPACK. If not, see <http://www.gnu.org/licenses/>. 00021 */ 00022 #ifndef __MLPACK_CORE_HPP 00023 #define __MLPACK_CORE_HPP 00024 00152 // First, standard includes. 00153 #include <stdlib.h> 00154 #include <stdio.h> 00155 #include <string.h> 00156 #include <ctype.h> 00157 #include <limits.h> 00158 #include <float.h> 00159 #include <stdint.h> 00160 #include <iostream> 00161 00162 // Defining _USE_MATH_DEFINES should set M_PI. 00163 #define _USE_MATH_DEFINES 00164 #include <math.h> 00165 00166 // For tgamma(). 00167 #include <boost/math/special_functions/gamma.hpp> 00168 00169 // But if it's not defined, we'll do it. 00170 #ifndef M_PI 00171 #define M_PI 3.141592653589793238462643383279 00172 #endif 00173 00174 // Give ourselves a nice way to force functions to be inline if we need. 00175 #define force_inline 00176 #if defined(__GNUG__) && !defined(DEBUG) 00177 #undef force_inline 00178 #define force_inline __attribute__((always_inline)) 00179 #elif defined(_MSC_VER) && !defined(DEBUG) 00180 #undef force_inline 00181 #define force_inline __forceinline 00182 #endif 00183 00184 // Now MLPACK-specific includes. 00185 #include <mlpack/core/arma_extend/arma_extend.hpp> // Includes Armadillo. 00186 #include <mlpack/core/util/log.hpp> 00187 #include <mlpack/core/util/cli.hpp> 00188 #include <mlpack/core/data/load.hpp> 00189 #include <mlpack/core/data/save.hpp> 00190 #include <mlpack/core/data/normalize_labels.hpp> 00191 #include <mlpack/core/math/clamp.hpp> 00192 #include <mlpack/core/math/random.hpp> 00193 #include <mlpack/core/math/lin_alg.hpp> 00194 #include <mlpack/core/math/range.hpp> 00195 #include <mlpack/core/math/round.hpp> 00196 #include <mlpack/core/util/save_restore_utility.hpp> 00197 #include <mlpack/core/dists/discrete_distribution.hpp> 00198 #include <mlpack/core/dists/gaussian_distribution.hpp> 00199 00200 // Include kernel traits. 00201 #include <mlpack/core/kernels/kernel_traits.hpp> 00202 #include <mlpack/core/kernels/linear_kernel.hpp> 00203 #include <mlpack/core/kernels/polynomial_kernel.hpp> 00204 #include <mlpack/core/kernels/cosine_distance.hpp> 00205 #include <mlpack/core/kernels/gaussian_kernel.hpp> 00206 #include <mlpack/core/kernels/epanechnikov_kernel.hpp> 00207 #include <mlpack/core/kernels/hyperbolic_tangent_kernel.hpp> 00208 #include <mlpack/core/kernels/laplacian_kernel.hpp> 00209 #include <mlpack/core/kernels/pspectrum_string_kernel.hpp> 00210 #include <mlpack/core/kernels/spherical_kernel.hpp> 00211 #include <mlpack/core/kernels/triangular_kernel.hpp> 00212 00213 #endif 00214 00215 // Clean up unfortunate Windows preprocessor definitions, even if this file was 00216 // already included. Use std::min and std::max! 00217 #ifdef _WIN32 00218 #ifdef min 00219 #undef min 00220 #endif 00221 00222 #ifdef max 00223 #undef max 00224 #endif 00225 #endif