[mlpack-git] master: Remove backported Armadillo code that we don't need. (efca3c4)

gitdub at mlpack.org gitdub at mlpack.org
Mon Jun 20 09:03:36 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/779556fed748819a18cc898d9a6f69900740ef23...20b4b2736cedb8c44c03e2af3f67f8a5af00927c

>---------------------------------------------------------------

commit efca3c46aff33a435657e6d9a4ba68272f736e2f
Author: Ryan Curtin <ryan at ratml.org>
Date:   Mon Jun 20 09:01:38 2016 -0400

    Remove backported Armadillo code that we don't need.


>---------------------------------------------------------------

efca3c46aff33a435657e6d9a4ba68272f736e2f
 src/mlpack/core/arma_extend/promote_type.hpp | 50 ----------------------------
 src/mlpack/core/arma_extend/restrictors.hpp  | 22 ------------
 src/mlpack/core/arma_extend/traits.hpp       | 49 ---------------------------
 src/mlpack/core/arma_extend/typedef.hpp      | 30 -----------------
 4 files changed, 151 deletions(-)

diff --git a/src/mlpack/core/arma_extend/promote_type.hpp b/src/mlpack/core/arma_extend/promote_type.hpp
deleted file mode 100644
index d21515f..0000000
--- a/src/mlpack/core/arma_extend/promote_type.hpp
+++ /dev/null
@@ -1,50 +0,0 @@
-// Extra promote_type definitions until 64-bit index support is added to
-// Armadillo.  These aren't necessary on Armadillo > 3.6.1.
-#if (ARMA_VERSION_MAJOR < 3) || \
-    ((ARMA_VERSION_MAJOR == 3) && (ARMA_VERSION_MINOR < 6)) || \
-    ((ARMA_VERSION_MAJOR == 3) && (ARMA_VERSION_MINOR == 6) && \
-        (ARMA_VERSION_PATCH < 2))
-  #ifndef ARMA_64BIT_WORD
-    template<typename T> struct is_promotable<std::complex<T>, s64> : public is_promotable_ok { typedef std::complex<T> result; };
-    template<typename T> struct is_promotable<std::complex<T>, u64> : public is_promotable_ok { typedef std::complex<T> result; };
-
-    template<> struct is_promotable<double, s64> : public is_promotable_ok { typedef double result; };
-    template<> struct is_promotable<double, u64> : public is_promotable_ok { typedef double result; };
-
-    template<> struct is_promotable<float, s64> : public is_promotable_ok { typedef float result; };
-    template<> struct is_promotable<float, u64> : public is_promotable_ok { typedef float result; };
-
-    template<> struct is_promotable<s64, u64> : public is_promotable_ok { typedef s64 result; };
-    template<> struct is_promotable<s64, s32> : public is_promotable_ok { typedef s64 result; };
-    template<> struct is_promotable<s64, u32> : public is_promotable_ok { typedef s64 result; };  // float ?
-    template<> struct is_promotable<s64, s16> : public is_promotable_ok { typedef s64 result; };
-    template<> struct is_promotable<s64, u16> : public is_promotable_ok { typedef s64 result; };
-    template<> struct is_promotable<s64, s8 > : public is_promotable_ok { typedef s64 result; };
-    template<> struct is_promotable<s64, u8 > : public is_promotable_ok { typedef s64 result; };
-
-    template<> struct is_promotable<u64, u32> : public is_promotable_ok { typedef u64 result; };
-    template<> struct is_promotable<u64, u16> : public is_promotable_ok { typedef u64 result; };
-    template<> struct is_promotable<u64, u8 > : public is_promotable_ok { typedef u64 result; };
-
-    template<typename T> struct is_promotable<s64, std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
-    template<typename T> struct is_promotable<u64, std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
-
-    template<> struct is_promotable<s64, double> : public is_promotable_ok { typedef double result; };
-    template<> struct is_promotable<u64, double> : public is_promotable_ok { typedef double result; };
-
-    template<> struct is_promotable<s64, float> : public is_promotable_ok { typedef float result; };
-    template<> struct is_promotable<u64, float> : public is_promotable_ok { typedef float result; };
-
-    template<> struct is_promotable<u64, s64> : public is_promotable_ok { typedef s64 result; };  // float ?
-
-    template<> struct is_promotable<u32, s64> : public is_promotable_ok { typedef s64 result; };  // float ?
-    template<> struct is_promotable<s16, s64> : public is_promotable_ok { typedef s64 result; };
-    template<> struct is_promotable<u16, s64> : public is_promotable_ok { typedef s64 result; };
-    template<> struct is_promotable<s8 , s64> : public is_promotable_ok { typedef s64 result; };
-    template<> struct is_promotable<u8 , s64> : public is_promotable_ok { typedef s64 result; };
-
-    template<> struct is_promotable<u32, u64> : public is_promotable_ok { typedef u64 result; };
-    template<> struct is_promotable<u16, u64> : public is_promotable_ok { typedef u64 result; };
-    template<> struct is_promotable<u8 , u64> : public is_promotable_ok { typedef u64 result; };
-  #endif
-#endif
diff --git a/src/mlpack/core/arma_extend/restrictors.hpp b/src/mlpack/core/arma_extend/restrictors.hpp
deleted file mode 100644
index f389a4c..0000000
--- a/src/mlpack/core/arma_extend/restrictors.hpp
+++ /dev/null
@@ -1,22 +0,0 @@
-// Modifications to allow u64/s64 in Armadillo when ARMA_64BIT_WORD is not
-// defined.  Only required on Armadillo < 3.6.2.
-#if (ARMA_VERSION_MAJOR < 3) || \
-    ((ARMA_VERSION_MAJOR == 3) && (ARMA_VERSION_MINOR < 6)) || \
-    ((ARMA_VERSION_MAJOR == 3) && (ARMA_VERSION_MINOR == 6) && \
-        (ARMA_VERSION_PATCH < 2))
-  #ifndef ARMA_64BIT_WORD
-
-    template<> struct arma_scalar_only<u64>   { typedef u64   result; };
-    template<> struct arma_scalar_only<s64>   { typedef s64   result; };
-
-    template<> struct arma_integral_only<u64> { typedef u64   result; };
-    template<> struct arma_integral_only<s64> { typedef s64   result; };
-
-    template<> struct arma_unsigned_integral_only<u64> { typedef u64 result; };
-
-    template<> struct arma_signed_integral_only<s64> { typedef s64 result; };
-
-    template<> struct arma_signed_only<s64> { typedef s64 result; };
-
-  #endif
-#endif
diff --git a/src/mlpack/core/arma_extend/traits.hpp b/src/mlpack/core/arma_extend/traits.hpp
deleted file mode 100644
index 99903cc..0000000
--- a/src/mlpack/core/arma_extend/traits.hpp
+++ /dev/null
@@ -1,49 +0,0 @@
-// Extra traits to support u64 and s64 (or, specifically, unsigned long and
-// long) until that is applied to the Armadillo sources.
-
-// This isn't necessary if Armadillo was compiled with 64-bit support, or if
-// ARMA_USE_U64S64 is enabled, or if Armadillo >= 3.6.2 is used (by default
-// Armadillo 3.6.2 allows long types).
-#if (ARMA_VERSION_MAJOR < 3) || \
-    ((ARMA_VERSION_MAJOR == 3) && (ARMA_VERSION_MINOR < 6)) || \
-    ((ARMA_VERSION_MAJOR == 3) && (ARMA_VERSION_MINOR == 6) && \
-        (ARMA_VERSION_PATCH < 2))
-  #if !(defined(ARMA_64BIT_WORD) || defined(ARMA_USE_U64S64))
-    template<typename T1>
-    struct is_u64
-      { static const bool value = false; };
-
-    template<>
-    struct is_u64<u64>
-      { static const bool value = true; };
-
-
-    template<typename T1>
-    struct is_s64
-      { static const bool value = false; };
-
-    template<>
-    struct is_s64<s64>
-      { static const bool value = true; };
-
-    template<>
-    struct is_supported_elem_type<u64>
-      {
-      static const bool value = true;
-      };
-
-    template<>
-    struct is_supported_elem_type<s64>
-      {
-      static const bool value = true;
-      };
-
-
-    template<>
-    struct is_signed<u64>
-      {
-      static const bool value = false;
-      };
-
-  #endif
-#endif
diff --git a/src/mlpack/core/arma_extend/typedef.hpp b/src/mlpack/core/arma_extend/typedef.hpp
deleted file mode 100644
index 376ebb8..0000000
--- a/src/mlpack/core/arma_extend/typedef.hpp
+++ /dev/null
@@ -1,30 +0,0 @@
-// Extensions to typedef u64 and s64 until that support is added into
-// Armadillo.  We only need to typedef s64 on Armadillo > 1.2.0.  This is not
-// necessary for Armadillo > 3.6.1.
-#if (ARMA_VERSION_MAJOR < 3) || \
-    ((ARMA_VERSION_MAJOR == 3) && (ARMA_VERSION_MINOR < 6)) || \
-    ((ARMA_VERSION_MAJOR == 3) && (ARMA_VERSION_MINOR == 6) && \
-        (ARMA_VERSION_PATCH < 2))
-  #ifndef ARMA_64BIT_WORD
-    // We must typedef both u64 and s64.
-    #if   ULONG_MAX >= 0xffffffffffffffff
-      typedef unsigned long u64;
-      typedef          long s64;
-    #elif ULLONG_MAX >= 0xffffffffffffffff
-      typedef unsigned long long u64;
-      typedef          long long s64;
-    #else
-      #error "don't know how to typedef 'u64' on this system"
-    #endif
-
-    namespace junk
-      {
-      struct arma_64_elem_size_test
-        {
-        arma_static_check( (sizeof(u64) != 8), ERROR___TYPE_U64_HAS_UNSUPPORTED_SIZE );
-        arma_static_check( (sizeof(s64) != 8), ERROR___TYPE_S64_HAS_UNSUPPORTED_SIZE );
-        };
-      }
-
-  #endif
-#endif




More information about the mlpack-git mailing list