[mlpack-svn] r11924 - mlpack/trunk/src/mlpack/core/arma_extend
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Mar 20 22:33:58 EDT 2012
Author: rcurtin
Date: 2012-03-20 22:33:58 -0400 (Tue, 20 Mar 2012)
New Revision: 11924
Modified:
mlpack/trunk/src/mlpack/core/arma_extend/promote_type.hpp
Log:
Patch by andreasl: no definitions of promote_type<u64, ...> are necessary if
ARMA_64BIT_WORD is defined.
Modified: mlpack/trunk/src/mlpack/core/arma_extend/promote_type.hpp
===================================================================
--- mlpack/trunk/src/mlpack/core/arma_extend/promote_type.hpp 2012-03-21 01:23:56 UTC (rev 11923)
+++ mlpack/trunk/src/mlpack/core/arma_extend/promote_type.hpp 2012-03-21 02:33:58 UTC (rev 11924)
@@ -5,13 +5,15 @@
((ARMA_VERSION_MAJOR == 2) && (ARMA_VERSION_MINOR > 1)) || \
((ARMA_VERSION_MAJOR == 2) && (ARMA_VERSION_MINOR == 1) && \
(ARMA_VERSION_PATCH >= 91))
+
// The new syntax changed the name of 'promote_type' to 'is_promotable'. We
// have to update accordingly...
+#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<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; };
@@ -23,37 +25,51 @@
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; };
+#endif
+
template<> struct is_promotable<u64, s32> : public is_promotable_ok { typedef s64 result; }; // float ?
+template<> struct is_promotable<u64, s16> : public is_promotable_ok { typedef s64 result; }; // float ?
+template<> struct is_promotable<u64, s8 > : public is_promotable_ok { typedef s64 result; }; // float ?
+
+#ifndef ARMA_64BIT_WORD
template<> struct is_promotable<u64, u32> : public is_promotable_ok { typedef u64 result; };
-template<> struct is_promotable<u64, s16> : public is_promotable_ok { typedef s64 result; }; // float ?
template<> struct is_promotable<u64, u16> : public is_promotable_ok { typedef u64 result; };
-template<> struct is_promotable<u64, s8 > : public is_promotable_ok { typedef s64 result; }; // float ?
template<> struct is_promotable<u64, u8 > : public is_promotable_ok { typedef u64 result; };
+#endif
+
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, 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 ?
+#endif
template<> struct is_promotable<s32, s64> : public is_promotable_ok { typedef s64 result; };
+#ifndef ARMA_64BIT_WORD
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; };
-
+#endif
template<> struct is_promotable<s32, u64> : public is_promotable_ok { typedef s64 result; }; // float ?
+#ifndef ARMA_64BIT_WORD
template<> struct is_promotable<u32, u64> : public is_promotable_ok { typedef u64 result; };
+#endif
template<> struct is_promotable<s16, u64> : public is_promotable_ok { typedef s64 result; }; // float ?
+#ifndef ARMA_64BIT_WORD
template<> struct is_promotable<u16, u64> : public is_promotable_ok { typedef u64 result; };
+#endif
template<> struct is_promotable<s8 , u64> : public is_promotable_ok { typedef s64 result; }; // float ?
+#ifndef ARMA_64BIT_WORD
template<> struct is_promotable<u8 , u64> : public is_promotable_ok { typedef u64 result; };
+#endif
#else
// The old syntax used the 'promote_type' struct. We just define all of these
@@ -105,5 +121,6 @@
template<> struct promote_type<u16, u64> : public promote_type_ok { typedef u64 result; };
template<> struct promote_type<s8 , u64> : public promote_type_ok { typedef s64 result; }; // float ?
template<> struct promote_type<u8 , u64> : public promote_type_ok { typedef u64 result; };
+#endif
-#endif
+
More information about the mlpack-svn
mailing list