[mlpack-svn] r16557 - mlpack/trunk/src/mlpack
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon May 26 23:35:53 EDT 2014
Author: rcurtin
Date: Mon May 26 23:35:52 2014
New Revision: 16557
Log:
Refactor core.hpp into two files; one for non-mlpack includes, and one for everything else.
Added:
mlpack/trunk/src/mlpack/prereqs.hpp
Modified:
mlpack/trunk/src/mlpack/core.hpp
Modified: mlpack/trunk/src/mlpack/core.hpp
==============================================================================
--- mlpack/trunk/src/mlpack/core.hpp (original)
+++ mlpack/trunk/src/mlpack/core.hpp Mon May 26 23:35:52 2014
@@ -138,40 +138,10 @@
* - Andrew Wells <andrewmw94 at gmail.com>
*/
-// First, standard includes.
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <limits.h>
-#include <float.h>
-#include <stdint.h>
-#include <iostream>
-
-// Defining _USE_MATH_DEFINES should set M_PI.
-#define _USE_MATH_DEFINES
-#include <math.h>
-
-// For tgamma().
-#include <boost/math/special_functions/gamma.hpp>
-
-// But if it's not defined, we'll do it.
-#ifndef M_PI
- #define M_PI 3.141592653589793238462643383279
-#endif
-
-// Give ourselves a nice way to force functions to be inline if we need.
-#define force_inline
-#if defined(__GNUG__) && !defined(DEBUG)
- #undef force_inline
- #define force_inline __attribute__((always_inline))
-#elif defined(_MSC_VER) && !defined(DEBUG)
- #undef force_inline
- #define force_inline __forceinline
-#endif
+// First, include all of the prerequisites.
+#include <mlpack/prereqs.hpp>
-// Now MLPACK-specific includes.
-#include <mlpack/core/arma_extend/arma_extend.hpp> // Includes Armadillo.
+// Now the core mlpack classes.
#include <mlpack/core/util/arma_traits.hpp>
#include <mlpack/core/util/log.hpp>
#include <mlpack/core/util/cli.hpp>
Added: mlpack/trunk/src/mlpack/prereqs.hpp
==============================================================================
--- (empty file)
+++ mlpack/trunk/src/mlpack/prereqs.hpp Mon May 26 23:35:52 2014
@@ -0,0 +1,44 @@
+/**
+ * @file prereqs.hpp
+ *
+ * The core includes that mlpack expects; standard C++ includes and Armadillo.
+ */
+#ifndef __MLPACK_PREREQS_HPP
+#define __MLPACK_PREREQS_HPP
+
+// First, standard includes.
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <limits.h>
+#include <float.h>
+#include <stdint.h>
+#include <iostream>
+
+// Defining _USE_MATH_DEFINES should set M_PI.
+#define _USE_MATH_DEFINES
+#include <math.h>
+
+// For tgamma().
+#include <boost/math/special_functions/gamma.hpp>
+
+// But if it's not defined, we'll do it.
+#ifndef M_PI
+ #define M_PI 3.141592653589793238462643383279
+#endif
+
+// Give ourselves a nice way to force functions to be inline if we need.
+#define force_inline
+#if defined(__GNUG__) && !defined(DEBUG)
+ #undef force_inline
+ #define force_inline __attribute__((always_inline))
+#elif defined(_MSC_VER) && !defined(DEBUG)
+ #undef force_inline
+ #define force_inline __forceinline
+#endif
+
+// Now include Armadillo through the special mlpack extensions.
+#include <mlpack/core/arma_extend/arma_extend.hpp>
+
+#endif
More information about the mlpack-svn
mailing list