[Rcpp-commits] r4226 - in pkg/RcppArmadillo: . inst inst/include inst/include/armadillo_bits

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jan 30 03:43:38 CET 2013


Author: edd
Date: 2013-01-30 03:43:36 +0100 (Wed, 30 Jan 2013)
New Revision: 4226

Modified:
   pkg/RcppArmadillo/ChangeLog
   pkg/RcppArmadillo/DESCRIPTION
   pkg/RcppArmadillo/inst/NEWS.Rd
   pkg/RcppArmadillo/inst/include/armadillo
   pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/config.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/diskio_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_det.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/hdf5_misc.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/promote_type.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/restrictors.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/traits.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/typedef.hpp
Log:
RcppArmadillo 0.3.6.2 with release 3.6.2 of Armadillo


Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2013-01-26 13:58:47 UTC (rev 4225)
+++ pkg/RcppArmadillo/ChangeLog	2013-01-30 02:43:36 UTC (rev 4226)
@@ -1,3 +1,9 @@
+2013-01-29  Dirk Eddelbuettel  <edd at debian.org>
+
+	* DESCRIPTION: Release 0.3.6.2
+
+	* inst/include/*: Upgraded to new release 3.6.2 of Armadillo
+
 2013-01-19  Dirk Eddelbuettel  <edd at debian.org>
 
 	* inst/examples/kalman/: New example used in the vignette

Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION	2013-01-26 13:58:47 UTC (rev 4225)
+++ pkg/RcppArmadillo/DESCRIPTION	2013-01-30 02:43:36 UTC (rev 4226)
@@ -1,7 +1,7 @@
 Package: RcppArmadillo
 Type: Package
 Title: Rcpp integration for Armadillo templated linear algebra library
-Version: 0.3.6.1
+Version: 0.3.6.2
 Date: $Date$
 Author: Romain Francois, Dirk Eddelbuettel and Doug Bates
 Maintainer: Dirk Eddelbuettel <edd at debian.org>

Modified: pkg/RcppArmadillo/inst/NEWS.Rd
===================================================================
--- pkg/RcppArmadillo/inst/NEWS.Rd	2013-01-26 13:58:47 UTC (rev 4225)
+++ pkg/RcppArmadillo/inst/NEWS.Rd	2013-01-30 02:43:36 UTC (rev 4226)
@@ -2,6 +2,18 @@
 \title{News for Package 'RcppArmadillo'}
 \newcommand{\cpkg}{\href{http://CRAN.R-project.org/package=#1}{\pkg{#1}}}
 
+\section{Changes in RcppArmadillo version 0.3.6.2 (2013-01-29)}{
+  \itemize{
+    \item Upgraded to Armadillo release Version 3.6.2
+    \itemize{
+      \item faster determinant for matrices marked as diagonal or triangular
+      \item more fine-grained handling of 64 bit integers
+    }
+    \item Added a new example of a Kalman filter implementation in R, and C++
+    using Armadillo via RcppArmadillo, complete with timing comparison
+  }
+}
+
 \section{Changes in RcppArmadillo version 0.3.6.1 (2012-12-17)}{
   \itemize{
     \item Upgraded to Armadillo release Version 3.6.1

Modified: pkg/RcppArmadillo/inst/include/armadillo
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo	2013-01-26 13:58:47 UTC (rev 4225)
+++ pkg/RcppArmadillo/inst/include/armadillo	2013-01-30 02:43:36 UTC (rev 4226)
@@ -37,6 +37,7 @@
 
 #if defined(ARMA_USE_CXX11)
   #include <initializer_list>
+  #include <cstdint>
 #endif
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2013-01-26 13:58:47 UTC (rev 4225)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2013-01-30 02:43:36 UTC (rev 4226)
@@ -18,7 +18,7 @@
 
 #define ARMA_VERSION_MAJOR 3
 #define ARMA_VERSION_MINOR 6
-#define ARMA_VERSION_PATCH 1
+#define ARMA_VERSION_PATCH 2
 #define ARMA_VERSION_NAME  "Piazza del Duomo"
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp	2013-01-26 13:58:47 UTC (rev 4225)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp	2013-01-30 02:43:36 UTC (rev 4226)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2012 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2012 Conrad Sanderson
+// Copyright (C) 2008-2013 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2013 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -48,6 +48,27 @@
 #define ARMA_INCFILE_WRAP(x) <x>
 
 
+#if (__cplusplus >= 201103L)
+  #if !defined(ARMA_USE_CXX11)
+    #define ARMA_USE_CXX11
+  #endif
+#endif
+
+
+#if defined(ARMA_USE_CXX11)
+  #if !defined(ARMA_USE_U64S64)
+    #define ARMA_USE_U64S64
+  #endif
+#endif
+
+
+#if defined(ARMA_64BIT_WORD)
+  #if !defined(ARMA_USE_U64S64)
+    #define ARMA_USE_U64S64
+  #endif
+#endif
+
+
 #if defined(__INTEL_COMPILER)
   
   #if (__INTEL_COMPILER < 1000)

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/config.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/config.hpp	2013-01-26 13:58:47 UTC (rev 4225)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/config.hpp	2013-01-30 02:43:36 UTC (rev 4226)
@@ -56,9 +56,11 @@
 //// uncomment the above define and specify the appropriate include directory.
 //// Make sure the directory has a trailing /
 
+#if !defined(ARMA_64BIT_WORD)
 // #define ARMA_64BIT_WORD
 //// Uncomment the above line if you require matrices/vectors capable of holding more than 4 billion elements.
 //// Your machine and compiler must have support for 64 bit integers (eg. via "long" or "long long")
+#endif
 
 #if !defined(ARMA_USE_CXX11)
 // #define ARMA_USE_CXX11
@@ -66,6 +68,13 @@
 //// This will enable additional features, such as use of initialiser lists
 #endif
 
+#if !defined(ARMA_USE_U64S64)
+// #define ARMA_USE_U64S64
+//// Uncomment the above line if you require u64 and s64 integer types.
+//// Your machine and compiler must have support for 64 bit integers (eg. via "long" or "long long").
+//// Note that ARMA_USE_U64S64 is automatically enabled when ARMA_64BIT_WORD or ARMA_USE_CXX11 are enabled
+#endif
+
 #if !defined(ARMA_USE_HDF5)
 // #define ARMA_USE_HDF5
 //// Uncomment the above line if you want the ability to save and load matrices stored in the HDF5 format;

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/diskio_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/diskio_meat.hpp	2013-01-26 13:58:47 UTC (rev 4225)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/diskio_meat.hpp	2013-01-30 02:43:36 UTC (rev 4226)
@@ -60,7 +60,7 @@
     {
     return std::string("ARMA_MAT_TXT_IS004");
     }
-#if defined(ARMA_64BIT_WORD)
+#if defined(ARMA_USE_U64S64)
   else
   if(is_u64<eT>::value == true)
     {
@@ -72,7 +72,29 @@
     return std::string("ARMA_MAT_TXT_IS008");
     }
 #endif
+#if defined(ARMA_ALLOW_LONG)
   else
+  if(is_ulng_t_32<eT>::value == true)
+    {
+    return std::string("ARMA_MAT_TXT_IU004");
+    }
+  else
+  if(is_slng_t_32<eT>::value == true)
+    {
+    return std::string("ARMA_MAT_TXT_IS004");
+    }
+  else
+  if(is_ulng_t_64<eT>::value == true)
+    {
+    return std::string("ARMA_MAT_TXT_IU008");
+    }
+  else
+  if(is_slng_t_64<eT>::value == true)
+    {
+    return std::string("ARMA_MAT_TXT_IS008");
+    }
+#endif
+  else
   if(is_float<eT>::value == true)
     {
     return std::string("ARMA_MAT_TXT_FN004");
@@ -144,7 +166,7 @@
     {
     return std::string("ARMA_MAT_BIN_IS004");
     }
-#if defined(ARMA_64BIT_WORD)
+#if defined(ARMA_USE_U64S64)
   else
   if(is_u64<eT>::value == true)
     {
@@ -156,7 +178,29 @@
     return std::string("ARMA_MAT_BIN_IS008");
     }
 #endif
+#if defined(ARMA_ALLOW_LONG)
   else
+  if(is_ulng_t_32<eT>::value == true)
+    {
+    return std::string("ARMA_MAT_BIN_IU004");
+    }
+  else
+  if(is_slng_t_32<eT>::value == true)
+    {
+    return std::string("ARMA_MAT_BIN_IS004");
+    }
+  else
+  if(is_ulng_t_64<eT>::value == true)
+    {
+    return std::string("ARMA_MAT_BIN_IU008");
+    }
+  else
+  if(is_slng_t_64<eT>::value == true)
+    {
+    return std::string("ARMA_MAT_BIN_IS008");
+    }
+#endif
+  else
   if(is_float<eT>::value == true)
     {
     return std::string("ARMA_MAT_BIN_FN004");
@@ -228,7 +272,7 @@
     {
     return std::string("ARMA_SPM_BIN_IS004");
     }
-#if defined(ARMA_64BIT_WORD)
+#if defined(ARMA_USE_U64S64)
   else
   if(is_u64<eT>::value == true)
     {
@@ -240,7 +284,29 @@
     return std::string("ARMA_SPM_BIN_IS008");
     }
 #endif
+#if defined(ARMA_ALLOW_LONG)
   else
+  if(is_ulng_t_32<eT>::value == true)
+    {
+    return std::string("ARMA_SPM_BIN_IU004");
+    }
+  else
+  if(is_slng_t_32<eT>::value == true)
+    {
+    return std::string("ARMA_SPM_BIN_IS004");
+    }
+  else
+  if(is_ulng_t_64<eT>::value == true)
+    {
+    return std::string("ARMA_SPM_BIN_IU008");
+    }
+  else
+  if(is_slng_t_64<eT>::value == true)
+    {
+    return std::string("ARMA_SPM_BIN_IS008");
+    }
+#endif
+  else
   if(is_float<eT>::value == true)
     {
     return std::string("ARMA_SPM_BIN_FN004");
@@ -311,7 +377,7 @@
     {
     return std::string("ARMA_CUB_TXT_IS004");
     }
-#if defined(ARMA_64BIT_WORD)
+#if defined(ARMA_USE_U64S64)
   else
   if(is_u64<eT>::value == true)
     {
@@ -323,7 +389,29 @@
     return std::string("ARMA_CUB_TXT_IS008");
     }
 #endif
+#if defined(ARMA_ALLOW_LONG)
   else
+  if(is_ulng_t_32<eT>::value == true)
+    {
+    return std::string("ARMA_CUB_TXT_IU004");
+    }
+  else
+  if(is_slng_t_32<eT>::value == true)
+    {
+    return std::string("ARMA_CUB_TXT_IS004");
+    }
+  else
+  if(is_ulng_t_64<eT>::value == true)
+    {
+    return std::string("ARMA_CUB_TXT_IU008");
+    }
+  else
+  if(is_slng_t_64<eT>::value == true)
+    {
+    return std::string("ARMA_CUB_TXT_IS008");
+    }
+#endif
+  else
   if(is_float<eT>::value == true)
     {
     return std::string("ARMA_CUB_TXT_FN004");
@@ -395,7 +483,7 @@
     {
     return std::string("ARMA_CUB_BIN_IS004");
     }
-#if defined(ARMA_64BIT_WORD)
+#if defined(ARMA_USE_U64S64)
   else
   if(is_u64<eT>::value == true)
     {
@@ -407,7 +495,29 @@
     return std::string("ARMA_CUB_BIN_IS008");
     }
 #endif
+#if defined(ARMA_ALLOW_LONG)
   else
+  if(is_ulng_t_32<eT>::value == true)
+    {
+    return std::string("ARMA_CUB_BIN_IU004");
+    }
+  else
+  if(is_slng_t_32<eT>::value == true)
+    {
+    return std::string("ARMA_CUB_BIN_IS004");
+    }
+  else
+  if(is_ulng_t_64<eT>::value == true)
+    {
+    return std::string("ARMA_CUB_BIN_IU008");
+    }
+  else
+  if(is_slng_t_64<eT>::value == true)
+    {
+    return std::string("ARMA_CUB_BIN_IS008");
+    }
+#endif
+  else
   if(is_float<eT>::value == true)
     {
     return std::string("ARMA_CUB_BIN_FN004");

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_det.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_det.hpp	2013-01-26 13:58:47 UTC (rev 4225)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_det.hpp	2013-01-30 02:43:36 UTC (rev 4226)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2012 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2012 Conrad Sanderson
+// Copyright (C) 2008-2013 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2013 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -54,20 +54,71 @@
   
   const diagmat_proxy<T1> A(X.m);
   
-  const uword A_n_elem = A.n_elem;
+  const uword N = A.n_elem;
   
-  eT val = eT(1);
+  eT val1 = eT(1);
+  eT val2 = eT(1);
   
-  for(uword i=0; i<A_n_elem; ++i)
+  uword i,j;
+  for(i=0, j=1; j<N; i+=2, j+=2)
     {
-    val *= A[i];
+    val1 *= A[i];
+    val2 *= A[j];
     }
   
-  return val;
+  
+  if(i < N)
+    {
+    val1 *= A[i];
+    }
+  
+  return val1 * val2;
   }
 
 
 
+//! determinant of a triangular matrix
+template<typename T1>
+inline
+arma_warn_unused
+typename T1::elem_type
+det
+  (
+  const Op<T1, op_trimat>& X,
+  const bool slow = false
+  )
+  {
+  arma_extra_debug_sigprint();
+  arma_ignore(slow);
+  
+  typedef typename T1::elem_type eT;
+  
+  const Proxy<T1> P(X.m);
+  
+  const uword N = P.get_n_rows();
+  
+  arma_debug_check( (N != P.get_n_cols()), "det(): matrix is not square" );
+  
+  eT val1 = eT(1);
+  eT val2 = eT(1);
+  
+  uword i,j;
+  for(i=0, j=1; j<N; i+=2, j+=2)
+    {
+    val1 *= P.at(i,i);
+    val2 *= P.at(j,j);
+    }
+  
+  if(i < N)
+    {
+    val1 *= P.at(i,i);
+    }
+  
+  return val1 * val2;
+  }
+
+
+
 //! determinant of inv(A), without doing the inverse operation
 template<typename T1>
 inline

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/hdf5_misc.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/hdf5_misc.hpp	2013-01-26 13:58:47 UTC (rev 4225)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/hdf5_misc.hpp	2013-01-30 02:43:36 UTC (rev 4226)
@@ -100,22 +100,22 @@
   }
 
 
-#if defined(ARMA_64BIT_WORD)
-template<>
-inline
-hid_t
-get_hdf5_type< long long >()
-  {
-  return H5Tcopy(H5T_NATIVE_LLONG);
-  }
+#if defined(ARMA_USE_U64S64) && defined(ULLONG_MAX)
+  template<>
+  inline
+  hid_t
+  get_hdf5_type< long long >()
+    {
+    return H5Tcopy(H5T_NATIVE_LLONG);
+    }
 
-template<>
-inline
-hid_t
-get_hdf5_type< unsigned long long >()
-  {
-  return H5Tcopy(H5T_NATIVE_ULLONG);
-  }
+  template<>
+  inline
+  hid_t
+  get_hdf5_type< unsigned long long >()
+    {
+    return H5Tcopy(H5T_NATIVE_ULLONG);
+    }
 #endif
 
 
@@ -210,7 +210,7 @@
   if (is_equal) { return true; }
   
   
-  // remaining supported types: u8, s8, u16, s16, u32, s32, u64, s64
+  // remaining supported types: u8, s8, u16, s16, u32, s32, u64, s64, ulng_t, slng_t
   
   search_type = get_hdf5_type<u8>();
   is_equal = ( H5Tequal(datatype, search_type) > 0 );
@@ -242,7 +242,7 @@
   H5Tclose(search_type);
   if (is_equal) { return true; }
   
-  #if defined(ARMA_64BIT_WORD)
+  #if defined(ARMA_USE_U64S64)
     {
     search_type = get_hdf5_type<u64>();
     is_equal = ( H5Tequal(datatype, search_type) > 0 );
@@ -256,6 +256,20 @@
     }
   #endif
   
+  #if defined(ARMA_ALLOW_LONG)
+    {
+    search_type = get_hdf5_type<ulng_t>();
+    is_equal = ( H5Tequal(datatype, search_type) > 0 );
+    H5Tclose(search_type);
+    if (is_equal) { return true; }
+    
+    search_type = get_hdf5_type<slng_t>();
+    is_equal = ( H5Tequal(datatype, search_type) > 0 );
+    H5Tclose(search_type);
+    if (is_equal) { return true; }
+    }
+  #endif
+  
   return false;
   }
 
@@ -557,7 +571,7 @@
     }
   
   
-  #if defined(ARMA_64BIT_WORD)
+  #if defined(ARMA_USE_U64S64)
     {
     // u64
     search_type = get_hdf5_type<u64>();
@@ -591,6 +605,40 @@
   #endif
   
   
+  #if defined(ARMA_ALLOW_LONG)
+    {
+    // ulng_t
+    search_type = get_hdf5_type<ulng_t>();
+    is_equal = (H5Tequal(datatype, search_type) > 0);
+    H5Tclose(search_type);
+    
+    if(is_equal)
+      {
+      Mat<ulng_t> m(n_rows, n_cols);
+      hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, void_ptr(m.memptr()));
+      dest = conv_to< Mat<eT> >::from(m); // Convert.
+      
+      return status;
+      }
+    
+    
+    // slng_t
+    search_type = get_hdf5_type<slng_t>();
+    is_equal = (H5Tequal(datatype, search_type) > 0);
+    H5Tclose(search_type);
+    
+    if(is_equal)
+      {
+      Mat<slng_t> m(n_rows, n_cols);
+      hid_t status = H5Dread(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, void_ptr(m.memptr()));
+      dest = conv_to< Mat<eT> >::from(m); // Convert.
+      
+      return status;
+      }
+    }
+  #endif
+  
+  
   // float
   search_type = get_hdf5_type<float>();
   is_equal = (H5Tequal(datatype, search_type) > 0);

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/promote_type.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/promote_type.hpp	2013-01-26 13:58:47 UTC (rev 4225)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/promote_type.hpp	2013-01-30 02:43:36 UTC (rev 4226)
@@ -1,5 +1,5 @@
-// Copyright (C) 2009-2011 NICTA (www.nicta.com.au)
-// Copyright (C) 2009-2011 Conrad Sanderson
+// Copyright (C) 2009-2013 NICTA (www.nicta.com.au)
+// Copyright (C) 2009-2013 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -36,48 +36,61 @@
 template<> struct is_promotable<std::complex<double>, float>                : public is_promotable_ok { typedef std::complex<double> result; };
 template<> struct is_promotable<std::complex<float>,  double>               : public is_promotable_ok { typedef std::complex<double> result; };
 
-#if defined(ARMA_64BIT_WORD)
-template<typename t> struct is_promotable<std::complex<t>, u64> : public is_promotable_ok { typedef std::complex<t> result; };
-template<typename t> struct is_promotable<std::complex<t>, s64> : public is_promotable_ok { typedef std::complex<t> result; };
+
+#if defined(ARMA_USE_U64S64)
+template<typename t> struct is_promotable<std::complex<t>, u64>    : public is_promotable_ok { typedef std::complex<t> result; };
+template<typename t> struct is_promotable<std::complex<t>, s64>    : public is_promotable_ok { typedef std::complex<t> result; };
 #endif
-template<typename T> struct is_promotable<std::complex<T>, s32> : public is_promotable_ok { typedef std::complex<T> result; };
-template<typename T> struct is_promotable<std::complex<T>, u32> : public is_promotable_ok { typedef std::complex<T> result; };
-template<typename T> struct is_promotable<std::complex<T>, s16> : public is_promotable_ok { typedef std::complex<T> result; };
-template<typename T> struct is_promotable<std::complex<T>, u16> : public is_promotable_ok { typedef std::complex<T> result; };
-template<typename T> struct is_promotable<std::complex<T>, s8>  : public is_promotable_ok { typedef std::complex<T> result; };
-template<typename T> struct is_promotable<std::complex<T>, u8>  : public is_promotable_ok { typedef std::complex<T> result; };
+#if defined(ARMA_ALLOW_LONG)
+template<typename t> struct is_promotable<std::complex<t>, ulng_t> : public is_promotable_ok { typedef std::complex<t> result; };
+template<typename t> struct is_promotable<std::complex<t>, slng_t> : public is_promotable_ok { typedef std::complex<t> result; };
+#endif
+template<typename T> struct is_promotable<std::complex<T>, s32>    : public is_promotable_ok { typedef std::complex<T> result; };
+template<typename T> struct is_promotable<std::complex<T>, u32>    : public is_promotable_ok { typedef std::complex<T> result; };
+template<typename T> struct is_promotable<std::complex<T>, s16>    : public is_promotable_ok { typedef std::complex<T> result; };
+template<typename T> struct is_promotable<std::complex<T>, u16>    : public is_promotable_ok { typedef std::complex<T> result; };
+template<typename T> struct is_promotable<std::complex<T>, s8>     : public is_promotable_ok { typedef std::complex<T> result; };
+template<typename T> struct is_promotable<std::complex<T>, u8>     : public is_promotable_ok { typedef std::complex<T> result; };
 
 
-template<> struct is_promotable<double, float> : public is_promotable_ok { typedef double result; };
-#if defined(ARMA_64BIT_WORD)
-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, float > : public is_promotable_ok { typedef double result; };
+#if defined(ARMA_USE_U64S64)
+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; };
 #endif
-template<> struct is_promotable<double, s32  > : public is_promotable_ok { typedef double result; };
-template<> struct is_promotable<double, u32  > : public is_promotable_ok { typedef double result; };
-template<> struct is_promotable<double, s16  > : public is_promotable_ok { typedef double result; };
-template<> struct is_promotable<double, u16  > : public is_promotable_ok { typedef double result; };
-template<> struct is_promotable<double, s8   > : public is_promotable_ok { typedef double result; };
-template<> struct is_promotable<double, u8   > : public is_promotable_ok { typedef double result; };
+#if defined(ARMA_ALLOW_LONG)
+template<> struct is_promotable<double, slng_t> : public is_promotable_ok { typedef double result; };
+template<> struct is_promotable<double, ulng_t> : public is_promotable_ok { typedef double result; };
+#endif
+template<> struct is_promotable<double, s32   > : public is_promotable_ok { typedef double result; };
+template<> struct is_promotable<double, u32   > : public is_promotable_ok { typedef double result; };
+template<> struct is_promotable<double, s16   > : public is_promotable_ok { typedef double result; };
+template<> struct is_promotable<double, u16   > : public is_promotable_ok { typedef double result; };
+template<> struct is_promotable<double, s8    > : public is_promotable_ok { typedef double result; };
+template<> struct is_promotable<double, u8    > : public is_promotable_ok { typedef double result; };
 
-#if defined(ARMA_64BIT_WORD)
-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; };
+#if defined(ARMA_USE_U64S64)
+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; };
 #endif
-template<> struct is_promotable<float, s32> : public is_promotable_ok { typedef float result; };
-template<> struct is_promotable<float, u32> : public is_promotable_ok { typedef float result; };
-template<> struct is_promotable<float, s16> : public is_promotable_ok { typedef float result; };
-template<> struct is_promotable<float, u16> : public is_promotable_ok { typedef float result; };
-template<> struct is_promotable<float, s8 > : public is_promotable_ok { typedef float result; };
-template<> struct is_promotable<float, u8 > : public is_promotable_ok { typedef float result; };
+#if defined(ARMA_ALLOW_LONG)
+template<> struct is_promotable<float, slng_t> : public is_promotable_ok { typedef float result; };
+template<> struct is_promotable<float, ulng_t> : public is_promotable_ok { typedef float result; };
+#endif
+template<> struct is_promotable<float, s32   > : public is_promotable_ok { typedef float result; };
+template<> struct is_promotable<float, u32   > : public is_promotable_ok { typedef float result; };
+template<> struct is_promotable<float, s16   > : public is_promotable_ok { typedef float result; };
+template<> struct is_promotable<float, u16   > : public is_promotable_ok { typedef float result; };
+template<> struct is_promotable<float, s8    > : public is_promotable_ok { typedef float result; };
+template<> struct is_promotable<float, u8    > : public is_promotable_ok { typedef float result; };
 
-#if defined(ARMA_64BIT_WORD)
+#if defined(ARMA_USE_U64S64)
 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; };
 #endif
 
-#if defined(ARMA_64BIT_WORD)
+#if defined(ARMA_USE_U64S64)
 template<> struct is_promotable<s64, u64> : public is_promotable_ok { typedef s64 result; };  // float ?  
 template<> struct is_promotable<s64, u32> : public is_promotable_ok { typedef s64 result; };
 template<> struct is_promotable<s64, s32> : public is_promotable_ok { typedef s64 result; };
@@ -119,48 +132,60 @@
 template<> struct is_promotable<float,               std::complex<double> > : public is_promotable_ok { typedef std::complex<double> result; };
 template<> struct is_promotable<double,              std::complex<float>  > : public is_promotable_ok { typedef std::complex<double> result; };
 
-#if defined(ARMA_64BIT_WORD)
-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; };
+#if defined(ARMA_USE_U64S64)
+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; };
 #endif
-template<typename T> struct is_promotable<s32, std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
-template<typename T> struct is_promotable<u32, std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
-template<typename T> struct is_promotable<s16, std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
-template<typename T> struct is_promotable<u16, std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
-template<typename T> struct is_promotable<s8,  std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
-template<typename T> struct is_promotable<u8,  std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
+#if defined(ARMA_ALLOW_LONG)
+template<typename T> struct is_promotable<slng_t, std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
+template<typename T> struct is_promotable<ulng_t, std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
+#endif
+template<typename T> struct is_promotable<s32,    std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
+template<typename T> struct is_promotable<u32,    std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
+template<typename T> struct is_promotable<s16,    std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
+template<typename T> struct is_promotable<u16,    std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
+template<typename T> struct is_promotable<s8,     std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
+template<typename T> struct is_promotable<u8,     std::complex<T> > : public is_promotable_ok { typedef std::complex<T> result; };
 
 
-template<> struct is_promotable<float, double> : public is_promotable_ok { typedef double result; };
-#if defined(ARMA_64BIT_WORD)
-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<float,  double> : public is_promotable_ok { typedef double result; };
+#if defined(ARMA_USE_U64S64)
+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; };
 #endif
-template<> struct is_promotable<s32  , double> : public is_promotable_ok { typedef double result; };
-template<> struct is_promotable<u32  , double> : public is_promotable_ok { typedef double result; };
-template<> struct is_promotable<s16  , double> : public is_promotable_ok { typedef double result; };
-template<> struct is_promotable<u16  , double> : public is_promotable_ok { typedef double result; };
-template<> struct is_promotable<s8   , double> : public is_promotable_ok { typedef double result; };
-template<> struct is_promotable<u8   , double> : public is_promotable_ok { typedef double result; };
+#if defined(ARMA_ALLOW_LONG)
+template<> struct is_promotable<slng_t, double> : public is_promotable_ok { typedef double result; };
+template<> struct is_promotable<ulng_t, double> : public is_promotable_ok { typedef double result; };
+#endif
+template<> struct is_promotable<s32,    double> : public is_promotable_ok { typedef double result; };
+template<> struct is_promotable<u32,    double> : public is_promotable_ok { typedef double result; };
+template<> struct is_promotable<s16,    double> : public is_promotable_ok { typedef double result; };
+template<> struct is_promotable<u16,    double> : public is_promotable_ok { typedef double result; };
+template<> struct is_promotable<s8,     double> : public is_promotable_ok { typedef double result; };
+template<> struct is_promotable<u8,     double> : public is_promotable_ok { typedef double result; };
 
-#if defined(ARMA_64BIT_WORD)
-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; };
+#if defined(ARMA_USE_U64S64)
+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; };
 #endif
-template<> struct is_promotable<s32, float> : public is_promotable_ok { typedef float result; };
-template<> struct is_promotable<u32, float> : public is_promotable_ok { typedef float result; };
-template<> struct is_promotable<s16, float> : public is_promotable_ok { typedef float result; };
-template<> struct is_promotable<u16, float> : public is_promotable_ok { typedef float result; };
-template<> struct is_promotable<s8 , float> : public is_promotable_ok { typedef float result; };
-template<> struct is_promotable<u8 , float> : public is_promotable_ok { typedef float result; };
+#if defined(ARMA_ALLOW_LONG)
+template<> struct is_promotable<slng_t, float> : public is_promotable_ok { typedef float result; };
+template<> struct is_promotable<ulng_t, float> : public is_promotable_ok { typedef float result; };
+#endif
+template<> struct is_promotable<s32,    float> : public is_promotable_ok { typedef float result; };
+template<> struct is_promotable<u32,    float> : public is_promotable_ok { typedef float result; };
+template<> struct is_promotable<s16,    float> : public is_promotable_ok { typedef float result; };
+template<> struct is_promotable<u16,    float> : public is_promotable_ok { typedef float result; };
+template<> struct is_promotable<s8,     float> : public is_promotable_ok { typedef float result; };
+template<> struct is_promotable<u8,     float> : public is_promotable_ok { typedef float result; };
 
-#if defined(ARMA_64BIT_WORD)
+#if defined(ARMA_USE_U64S64)
 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
 
-#if defined(ARMA_64BIT_WORD)
+#if defined(ARMA_USE_U64S64)
 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; };
 template<> struct is_promotable<s16, s64> : public is_promotable_ok { typedef s64 result; };

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/restrictors.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/restrictors.hpp	2013-01-26 13:58:47 UTC (rev 4225)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/restrictors.hpp	2013-01-30 02:43:36 UTC (rev 4226)
@@ -1,5 +1,5 @@
-// Copyright (C) 2010-2012 NICTA (www.nicta.com.au)
-// Copyright (C) 2010-2012 Conrad Sanderson
+// Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
+// Copyright (C) 2010-2013 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -29,14 +29,17 @@
 template<> struct arma_scalar_only<s16>    { typedef s16    result; };
 template<> struct arma_scalar_only<u32>    { typedef u32    result; };
 template<> struct arma_scalar_only<s32>    { typedef s32    result; };
-#if defined(ARMA_64BIT_WORD)
+#if defined(ARMA_USE_U64S64)
 template<> struct arma_scalar_only<u64>    { typedef u64    result; };
 template<> struct arma_scalar_only<s64>    { typedef s64    result; };
 #endif
 template<> struct arma_scalar_only<float>  { typedef float  result; };
 template<> struct arma_scalar_only<double> { typedef double result; };
+#if defined(ARMA_ALLOW_LONG)
+template<> struct arma_scalar_only<ulng_t> { typedef ulng_t result; };
+template<> struct arma_scalar_only<slng_t> { typedef slng_t result; };
+#endif
 
-
 template<typename T>
 struct arma_scalar_only< std::complex<T> > { typedef std::complex<T> result; };
 
@@ -50,45 +53,58 @@
 template<> struct arma_integral_only<s16> { typedef s16 result; };
 template<> struct arma_integral_only<u32> { typedef u32 result; };
 template<> struct arma_integral_only<s32> { typedef s32 result; };
-#if defined(ARMA_64BIT_WORD)
+#if defined(ARMA_USE_U64S64)
 template<> struct arma_integral_only<u64> { typedef u64 result; };
 template<> struct arma_integral_only<s64> { typedef s64 result; };
 #endif
+#if defined(ARMA_ALLOW_LONG)
+template<> struct arma_integral_only<ulng_t> { typedef ulng_t result; };
+template<> struct arma_integral_only<slng_t> { typedef slng_t result; };
+#endif
 
 
 
 template<typename T> struct arma_unsigned_integral_only { };
 
-template<> struct arma_unsigned_integral_only<u8>  { typedef u8  result; };
-template<> struct arma_unsigned_integral_only<u16> { typedef u16 result; };
-template<> struct arma_unsigned_integral_only<u32> { typedef u32 result; };
-#if defined(ARMA_64BIT_WORD)
-template<> struct arma_unsigned_integral_only<u64> { typedef u64 result; };
+template<> struct arma_unsigned_integral_only<u8>     { typedef u8     result; };
+template<> struct arma_unsigned_integral_only<u16>    { typedef u16    result; };
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/rcpp -r 4226


More information about the Rcpp-commits mailing list