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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Aug 1 00:00:27 CEST 2013


Author: edd
Date: 2013-08-01 00:00:27 +0200 (Thu, 01 Aug 2013)
New Revision: 4409

Added:
   pkg/RcppArmadillo/.Rbuildignore
   pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup_post.hpp
Modified:
   pkg/RcppArmadillo/ChangeLog
   pkg/RcppArmadillo/DESCRIPTION
   pkg/RcppArmadillo/debian/changelog
   pkg/RcppArmadillo/inst/NEWS.Rd
   pkg/RcppArmadillo/inst/include/armadillo
   pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/GenCube_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/Gen_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/Proxy.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/ProxyCube.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/SpMat_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/eGlueCube_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/eGlue_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/eglue_core_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/eop_aux.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/eop_core_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/field_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/field_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_as_scalar.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/glue_cross_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/glue_mixed_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/memory.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/op_median_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/op_reshape_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/xvec_htrans_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/xvec_htrans_meat.hpp
Log:
RcppArmadillo 0.3.900.7 with Armadillo 3.900.7
Added .Rbuildignore to exclude debian/ directory from CRAN tarballs


Added: pkg/RcppArmadillo/.Rbuildignore
===================================================================
--- pkg/RcppArmadillo/.Rbuildignore	                        (rev 0)
+++ pkg/RcppArmadillo/.Rbuildignore	2013-07-31 22:00:27 UTC (rev 4409)
@@ -0,0 +1 @@
+debian

Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/ChangeLog	2013-07-31 22:00:27 UTC (rev 4409)
@@ -1,3 +1,10 @@
+2013-07-31  Dirk Eddelbuettel  <edd at debian.org>
+
+	* DESCRIPTION: Release 0.3.900.7
+	* inst/NEWS: Release 0.3.900.7
+	* inst/include/*: Upgraded to new release 3.900.7 of Armadillo
+        * debian/*: Similarly updated for new release to Debian
+
 2013-07-12  Dirk Eddelbuettel  <edd at debian.org>
 
 	* inst/unitTests/runTests.R: No longer need to test minimal versions

Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/DESCRIPTION	2013-07-31 22:00:27 UTC (rev 4409)
@@ -1,7 +1,7 @@
 Package: RcppArmadillo
 Type: Package
 Title: Rcpp integration for Armadillo templated linear algebra library
-Version: 0.3.900.0
+Version: 0.3.900.7
 Date: $Date$
 Author: Romain Francois, Dirk Eddelbuettel and Doug Bates
 Maintainer: Dirk Eddelbuettel <edd at debian.org>
@@ -21,7 +21,7 @@
  (due to speed and/or integration capabilities), rather than another language.
  .
  The RcppArmadillo package includes the header files from the templated
- Armadillo library (currently version 3.900.0). Thus users do not need to
+ Armadillo library (currently version 3.900.7). Thus users do not need to
  install Armadillo itself in order to use RcppArmadillo.
  .
  This Armadillo integration provides a nice illustration of the 

Modified: pkg/RcppArmadillo/debian/changelog
===================================================================
--- pkg/RcppArmadillo/debian/changelog	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/debian/changelog	2013-07-31 22:00:27 UTC (rev 4409)
@@ -1,3 +1,9 @@
+r-cran-rcpparmadillo (0.3.900.7-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Dirk Eddelbuettel <edd at debian.org>  Wed, 31 Jul 2013 16:40:01 -0500
+
 r-cran-rcpparmadillo (0.3.900.0-1) unstable; urgency=low
 
   * New upstream release

Modified: pkg/RcppArmadillo/inst/NEWS.Rd
===================================================================
--- pkg/RcppArmadillo/inst/NEWS.Rd	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/NEWS.Rd	2013-07-31 22:00:27 UTC (rev 4409)
@@ -2,10 +2,17 @@
 \title{News for Package 'RcppArmadillo'}
 \newcommand{\cpkg}{\href{http://CRAN.R-project.org/package=#1}{\pkg{#1}}}
 
-\section{Changes in RcppArmadillo version 0.3.abc (2013-xx-yy)}{
+\section{Changes in RcppArmadillo version 0.3.900.7 (2013-07-31)}{
   \itemize{
+    \item Upgraded to Armadillo release Version 3.900.7 (Bavarian
+    Sunflower)
+    \itemize{
+      \item minor fix for inplace \code{reshape()}
+      \item minor corrections for compilation issues under GCC 4.8+ and MSVC
+    }
     \item The \pkg{inline} package is no longer used in the examples and
-    unit tests which have all been converted to Rcpp attributes use
+    unit tests which have all been converted to using Rcpp attributes 
+  }
 }
 
 \section{Changes in RcppArmadillo version 0.3.900 (2013-06-04)}{

Modified: pkg/RcppArmadillo/inst/include/armadillo
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo	2013-07-31 22:00:27 UTC (rev 4409)
@@ -534,6 +534,9 @@
   #include "armadillo_bits/spglue_minus_meat.hpp"
   #include "armadillo_bits/spglue_times_meat.hpp"
   }
-  
+
+
+
+#include "armadillo_bits/compiler_setup_post.hpp"
+
 #endif
-

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_bones.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_bones.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -46,7 +46,7 @@
   arma_aligned const eT*       const mem;      //!< pointer to the memory used by the cube (memory is read-only)
   
   protected:
-  arma_aligned   Mat<eT>* mat_ptrs_local[ Cube_prealloc::mat_ptrs_size ];
+  arma_align_mem Mat<eT>* mat_ptrs_local[ Cube_prealloc::mat_ptrs_size ];
   arma_align_mem eT            mem_local[ Cube_prealloc::mem_n_elem    ];
   
   

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/GenCube_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/GenCube_bones.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/GenCube_bones.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -20,6 +20,7 @@
   typedef typename get_pod_type<elem_type>::result pod_type;
   
   static const bool prefer_at_accessor = false;
+  static const bool is_simple          = (is_same_type<gen_type, gen_ones_full>::value) || (is_same_type<gen_type, gen_zeros>::value); 
   
   arma_aligned const uword n_rows;
   arma_aligned const uword n_cols;

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Gen_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Gen_bones.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Gen_bones.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -20,6 +20,7 @@
   typedef typename get_pod_type<elem_type>::result pod_type;
   
   static const bool prefer_at_accessor = (is_same_type<gen_type, gen_ones_diag>::value) ? true : false;
+  static const bool is_simple          = (is_same_type<gen_type, gen_ones_full>::value) || (is_same_type<gen_type, gen_zeros>::value); 
   
   static const bool is_row = T1::is_row;
   static const bool is_col = T1::is_col;

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_bones.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_bones.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -22,10 +22,6 @@
   typedef eT                                elem_type;  //!< the type of elements stored in the matrix
   typedef typename get_pod_type<eT>::result pod_type;   //!< if eT is non-complex, pod_type is same as eT. otherwise, pod_type is the underlying type used by std::complex
   
-  static const bool is_col = false;
-  static const bool is_row = false;
-  
-  
   const uword  n_rows;    //!< number of rows in the matrix (read-only)
   const uword  n_cols;    //!< number of columns in the matrix (read-only)
   const uword  n_elem;    //!< number of elements in the matrix (read-only)
@@ -45,6 +41,9 @@
   
   public:
   
+  static const bool is_col = false;
+  static const bool is_row = false;
+  
   inline ~Mat();
   inline  Mat();
   

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Proxy.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Proxy.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Proxy.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -279,7 +279,7 @@
   template<typename eT2>
   arma_inline bool is_alias(const Mat<eT2>&) const { return false; }
   
-  arma_inline bool is_aligned() const { return false; }
+  arma_inline bool is_aligned() const { return Gen<T1, gen_type>::is_simple; }
   };
 
 
@@ -1459,6 +1459,52 @@
 
 
 
+template<typename eT>
+class Proxy< xvec_htrans<eT> >
+  {
+  public:
+  
+  typedef eT                                       elem_type;
+  typedef typename get_pod_type<elem_type>::result pod_type;
+  typedef Mat<eT>                                  stored_type;
+  typedef const eT*                                ea_type;
+  typedef const Mat<eT>&                           aligned_ea_type;
+  
+  static const bool prefer_at_accessor = false;
+  static const bool has_subview        = false;
+  static const bool is_fixed           = false;
+  static const bool fake_mat           = false;
+  
+  static const bool is_row = false;
+  static const bool is_col = false;
+  
+  arma_aligned const Mat<eT> Q;
+  
+  inline explicit Proxy(const xvec_htrans<eT>& A)
+    : Q(A)
+    {
+    arma_extra_debug_sigprint();
+    }
+  
+  arma_inline uword get_n_rows() const { return Q.n_rows; }
+  arma_inline uword get_n_cols() const { return Q.n_cols; }
+  arma_inline uword get_n_elem() const { return Q.n_elem; }
+  
+  arma_inline elem_type operator[] (const uword i)                    const { return Q[i];          }
+  arma_inline elem_type at         (const uword row, const uword col) const { return Q.at(row,col); }
+  arma_inline elem_type at_alt     (const uword i)                    const { return Q.at_alt(i);   }
+  
+  arma_inline         ea_type         get_ea() const { return Q.memptr(); }
+  arma_inline aligned_ea_type get_aligned_ea() const { return Q;          }
+  
+  template<typename eT2>
+  arma_inline bool is_alias(const Mat<eT2>& X) const { return false; }
+  
+  arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr()); }
+  };
+
+
+
 template<typename eT, typename T1>
 class Proxy< subview_elem1<eT,T1> >
   {

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/ProxyCube.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/ProxyCube.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/ProxyCube.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -99,7 +99,7 @@
   
   arma_inline elem_type operator[] (const uword i)                                       const { return Q[i];                  }
   arma_inline elem_type at         (const uword row, const uword col, const uword slice) const { return Q.at(row, col, slice); }
-  arma_inline elem_type at_alt     (const uword i)                                       const { return Q.at_alt(i);           }
+  arma_inline elem_type at_alt     (const uword i)                                       const { return Q[i];                  }
   
   arma_inline         ea_type         get_ea() const { return Q; }
   arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
@@ -107,7 +107,7 @@
   template<typename eT2>
   arma_inline bool is_alias(const Cube<eT2>&) const { return false; }
   
-  arma_inline bool is_aligned() const { return false; }
+  arma_inline bool is_aligned() const { return GenCube<eT, gen_type>::is_simple; }
   };
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/SpMat_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/SpMat_meat.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/SpMat_meat.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -3199,7 +3199,7 @@
   
   eop_aux_randu<eT>::fill( access::rwp(values), n_nonzero );
   
-  uvec indices = linspace<uvec>( 0, in_rows*in_cols-1, n_nonzero );
+  uvec indices = linspace<uvec>( 0u, in_rows*in_cols-1, n_nonzero );
   
   // perturb the indices
   for(uword i=1; i < n_nonzero-1; ++i)
@@ -3276,7 +3276,7 @@
   
   eop_aux_randn<eT>::fill( access::rwp(values), n_nonzero );
   
-  uvec indices = linspace<uvec>( 0, in_rows*in_cols-1, n_nonzero );
+  uvec indices = linspace<uvec>( 0u, in_rows*in_cols-1, n_nonzero );
   
   // perturb the indices
   for(uword i=1; i < n_nonzero-1; ++i)

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_bones.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_bones.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -45,8 +45,8 @@
   
   arma_inline SpValProxy& operator++();
   arma_inline SpValProxy& operator--();
-  arma_inline eT operator++(const int unused);
-  arma_inline eT operator--(const int unused);
+  arma_inline eT operator++(const int);
+  arma_inline eT operator--(const int);
   
   //! This will work for any other operations that do not modify a value.
   arma_inline operator eT() const;

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_meat.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/SpValProxy_meat.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -258,7 +258,7 @@
 template<typename T1>
 arma_inline
 typename T1::elem_type
-SpValProxy<T1>::operator++(const int unused)
+SpValProxy<T1>::operator++(const int)
   {
   if (val_ptr)
     {
@@ -286,7 +286,7 @@
 template<typename T1>
 arma_inline
 typename T1::elem_type
-SpValProxy<T1>::operator--(const int unused)
+SpValProxy<T1>::operator--(const int)
   {
   if (val_ptr)
     {

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -13,7 +13,7 @@
 
 #define ARMA_VERSION_MAJOR 3
 #define ARMA_VERSION_MINOR 900
-#define ARMA_VERSION_PATCH 0
+#define ARMA_VERSION_PATCH 7
 #define ARMA_VERSION_NAME  "Bavarian Sunflower"
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_bones.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_bones.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -20,8 +20,8 @@
   
   
   template<typename eT>
-  static inline void
-  copy_big(eT* dest, const eT* src, const uword n_elem);
+  arma_hot inline static void
+  copy_small(eT* dest, const eT* src, const uword n_elem);
   
   
   template<typename eT>

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_meat.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_meat.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -17,106 +17,43 @@
 void
 arrayops::copy(eT* dest, const eT* src, const uword n_elem)
   {
-  switch(n_elem)
+  if(n_elem <= 16)
     {
-    default:
-      arrayops::copy_big(dest, src, n_elem);
-      break;
-    case 8:
-      dest[7] = src[7];
-    case 7:
-      dest[6] = src[6];
-    case 6:
-      dest[5] = src[5];
-    case 5:
-      dest[4] = src[4];
-    case 4:
-      dest[3] = src[3];
-    case 3:
-      dest[2] = src[2];
-    case 2:
-      dest[1] = src[1];
-    case 1:
-      dest[0] = src[0];
+    arrayops::copy_small(dest, src, n_elem);
     }
+  else
+    {
+    std::memcpy(dest, src, n_elem*sizeof(eT));
+    }
   }
 
 
 
 template<typename eT>
+arma_hot
 inline
 void
-arrayops::copy_big(eT* dest, const eT* src, const uword n_elem)
+arrayops::copy_small(eT* dest, const eT* src, const uword n_elem)
   {
   switch(n_elem)
     {
-    default:
-      std::memcpy(dest, src, n_elem*sizeof(eT));
-      break;
-    case 32:
-      dest[31] = src[31];
-    case 31:
-      dest[30] = src[30];
-    case 30:
-      dest[29] = src[29];
-    case 29:
-      dest[28] = src[28];
-    case 28:
-      dest[27] = src[27];
-    case 27:
-      dest[26] = src[26];
-    case 26:
-      dest[25] = src[25];
-    case 25:
-      dest[24] = src[24];
-    case 24:
-      dest[23] = src[23];
-    case 23:
-      dest[22] = src[22];
-    case 22:
-      dest[21] = src[21];
-    case 21:
-      dest[20] = src[20];
-    case 20:
-      dest[19] = src[19];
-    case 19:
-      dest[18] = src[18];
-    case 18:
-      dest[17] = src[17];
-    case 17:
-      dest[16] = src[16];
-    case 16:
-      dest[15] = src[15];
-    case 15:
-      dest[14] = src[14];
-    case 14:
-      dest[13] = src[13];
-    case 13:
-      dest[12] = src[12];
-    case 12:
-      dest[11] = src[11];
-    case 11:
-      dest[10] = src[10];
-    case 10:
-      dest[9] = src[9];
-    case 9:
-      dest[8] = src[8];
-    case 8:
-      dest[7] = src[7];
-    case 7:
-      dest[6] = src[6];
-    case 6:
-      dest[5] = src[5];
-    case 5:
-      dest[4] = src[4];
-    case 4:
-      dest[3] = src[3];
-    case 3:
-      dest[2] = src[2];
-    case 2:
-      dest[1] = src[1];
-    case 1:
-      dest[0] = src[0];
+    case 16:  dest[15] = src[15];
+    case 15:  dest[14] = src[14];
+    case 14:  dest[13] = src[13];
+    case 13:  dest[12] = src[12];
+    case 12:  dest[11] = src[11];
+    case 11:  dest[10] = src[10];
+    case 10:  dest[ 9] = src[ 9];
+    case  9:  dest[ 8] = src[ 8];
+    case  8:  dest[ 7] = src[ 7];
+    case  7:  dest[ 6] = src[ 6];
+    case  6:  dest[ 5] = src[ 5];
+    case  5:  dest[ 4] = src[ 4];
+    case  4:  dest[ 3] = src[ 3];
+    case  3:  dest[ 2] = src[ 2];
+    case  2:  dest[ 1] = src[ 1];
+    case  1:  dest[ 0] = src[ 0];
+    default:  ;
     }
   }
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -49,6 +49,11 @@
 #endif
 
 
+#if defined(__APPLE__)
+  #define ARMA_BLAS_SDOT_BUG
+#endif
+
+
 #if (__cplusplus >= 201103L)
   #if !defined(ARMA_USE_CXX11)
     #define ARMA_USE_CXX11
@@ -76,22 +81,48 @@
     #error "*** Need a newer compiler ***"
   #endif
   
-  #define ARMA_GOOD_COMPILER
-  #undef  ARMA_HAVE_STD_TR1
-  
   #if (__INTEL_COMPILER <= 1110)
     #undef ARMA_HAVE_STD_ISFINITE
   #endif
   
-  #undef  arma_aligned
-  #undef  arma_align_mem
+  #undef  ARMA_HAVE_STD_TR1
   
-  #define arma_aligned   __attribute__((aligned(16)));
-  #define arma_align_mem __attribute__((aligned(16)));
-  
-  #define ARMA_HAVE_ALIGNED_ATTRIBUTE
+  #define ARMA_GOOD_COMPILER
   #define ARMA_HAVE_ICC_ASSUME_ALIGNED
   
+  #if defined(__GNUG__)
+    
+    // #undef  arma_aligned
+    // #define arma_aligned __attribute__((aligned))
+    
+    #undef  arma_align_mem
+    #define arma_align_mem __attribute__((aligned(16)))
+    
+    #define ARMA_HAVE_ALIGNED_ATTRIBUTE
+    
+  #elif defined(_MSC_VER)
+    
+    // #if (_MANAGED == 1) || (_M_CEE == 1)
+    //   
+    //   // don't do any alignment when compiling in "managed code" mode 
+    //   
+    //   #undef  arma_aligned
+    //   #define arma_aligned
+    //   
+    //   #undef  arma_align_mem
+    //   #define arma_align_mem
+    //   
+    // #elif (_MSC_VER >= 1700)
+    //   
+    //   #undef  arma_align_mem
+    //   #define arma_align_mem __declspec(align(16))
+    //   
+    //   #define ARMA_HAVE_ALIGNED_ATTRIBUTE
+    //   
+    // #endif
+    
+  #endif
+  
 #elif defined(__GNUG__)
   
   #if (__GNUC__ < 4)
@@ -167,11 +198,6 @@
 #endif
 
 
-#if defined(__APPLE__)
-  #define ARMA_BLAS_SDOT_BUG
-#endif
-
-
 #if defined(_MSC_VER)
   
   #if (_MSC_VER < 1500)
@@ -186,16 +212,47 @@
   #undef ARMA_HAVE_STD_ISNAN
   #undef ARMA_HAVE_STD_TR1
   
-  #undef  arma_inline
-  #define arma_inline inline __forceinline
+  // #undef  arma_inline
+  // #define arma_inline inline __forceinline
   
-  #undef  arma_aligned
-  #undef  arma_align_mem
+  #pragma warning(push)
   
-  #define arma_aligned   __declspec(align(16))
-  #define arma_align_mem __declspec(align(16))
+  #pragma warning(disable: 4127)  // conditional expression is constant
+  #pragma warning(disable: 4510)  // default constructor could not be generated
+  #pragma warning(disable: 4511)  // copy constructor can't be generated
+  #pragma warning(disable: 4512)  // assignment operator can't be generated
+  #pragma warning(disable: 4513)  // destructor can't be generated
+  #pragma warning(disable: 4514)  // unreferenced inline function has been removed
+  #pragma warning(disable: 4522)  // multiple assignment operators specified
+  #pragma warning(disable: 4623)  // default constructor can't be generated
+  #pragma warning(disable: 4624)  // destructor can't be generated
+  #pragma warning(disable: 4625)  // copy constructor can't be generated
+  #pragma warning(disable: 4626)  // assignment operator can't be generated
+  #pragma warning(disable: 4710)  // function not inlined
+  #pragma warning(disable: 4711)  // call was inlined
+  #pragma warning(disable: 4714)  // __forceinline can't be inlined
   
-  #define ARMA_HAVE_ALIGNED_ATTRIBUTE
+  // #if (_MANAGED == 1) || (_M_CEE == 1)
+  //   
+  //   // don't do any alignment when compiling in "managed code" mode 
+  //   
+  //   #undef  arma_aligned
+  //   #define arma_aligned
+  //   
+  //   #undef  arma_align_mem
+  //   #define arma_align_mem
+  //  
+  // #elif (_MSC_VER >= 1700)
+  //   
+  //   #undef  arma_align_mem
+  //   #define arma_align_mem __declspec(align(16))
+  //   
+  //   #define ARMA_HAVE_ALIGNED_ATTRIBUTE
+  //   
+  //   // disable warnings: "structure was padded due to __declspec(align(16))"
+  //   #pragma warning(disable: 4324)
+  //   
+  // #endif
   
 #endif
 

Added: pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup_post.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup_post.hpp	                        (rev 0)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup_post.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -0,0 +1,14 @@
+// Copyright (C) 2013 NICTA (www.nicta.com.au)
+// Copyright (C) 2013 Conrad Sanderson
+// 
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+
+#if defined(_MSC_VER)
+  
+  #pragma warning(pop)
+  
+#endif

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/eGlueCube_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/eGlueCube_meat.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/eGlueCube_meat.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -95,10 +95,13 @@
   {
   // the optimiser will keep only one return statement
   
+  typedef typename T1::elem_type eT;
+  
        if(is_same_type<eglue_type, eglue_plus >::value == true) { return P1[i] + P2[i]; }
   else if(is_same_type<eglue_type, eglue_minus>::value == true) { return P1[i] - P2[i]; }
   else if(is_same_type<eglue_type, eglue_div  >::value == true) { return P1[i] / P2[i]; }
   else if(is_same_type<eglue_type, eglue_schur>::value == true) { return P1[i] * P2[i]; }
+  else return eT(0);
   }
 
 
@@ -109,10 +112,13 @@
   {
   // the optimiser will keep only one return statement
   
+  typedef typename T1::elem_type eT;
+  
        if(is_same_type<eglue_type, eglue_plus >::value == true) { return P1.at(row,col,slice) + P2.at(row,col,slice); }
   else if(is_same_type<eglue_type, eglue_minus>::value == true) { return P1.at(row,col,slice) - P2.at(row,col,slice); }
   else if(is_same_type<eglue_type, eglue_div  >::value == true) { return P1.at(row,col,slice) / P2.at(row,col,slice); }
   else if(is_same_type<eglue_type, eglue_schur>::value == true) { return P1.at(row,col,slice) * P2.at(row,col,slice); }
+  else return eT(0);
   }
 
 
@@ -124,10 +130,13 @@
   {
   // the optimiser will keep only one return statement
   
+  typedef typename T1::elem_type eT;
+  
        if(is_same_type<eglue_type, eglue_plus >::value == true) { return P1.at_alt(i) + P2.at_alt(i); }
   else if(is_same_type<eglue_type, eglue_minus>::value == true) { return P1.at_alt(i) - P2.at_alt(i); }
   else if(is_same_type<eglue_type, eglue_div  >::value == true) { return P1.at_alt(i) / P2.at_alt(i); }
   else if(is_same_type<eglue_type, eglue_schur>::value == true) { return P1.at_alt(i) * P2.at_alt(i); }
+  else return eT(0);
   }
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/eGlue_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/eGlue_meat.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/eGlue_meat.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -76,13 +76,17 @@
   {
   // the optimiser will keep only one return statement
   
+  typedef typename T1::elem_type eT;
+  
        if(is_same_type<eglue_type, eglue_plus >::value == true) { return P1[ii] + P2[ii]; }
   else if(is_same_type<eglue_type, eglue_minus>::value == true) { return P1[ii] - P2[ii]; }
   else if(is_same_type<eglue_type, eglue_div  >::value == true) { return P1[ii] / P2[ii]; }
   else if(is_same_type<eglue_type, eglue_schur>::value == true) { return P1[ii] * P2[ii]; }
+  else return eT(0);
   }
 
 
+
 template<typename T1, typename T2, typename eglue_type>
 arma_inline
 typename T1::elem_type
@@ -90,10 +94,13 @@
   {
   // the optimiser will keep only one return statement
   
+  typedef typename T1::elem_type eT;
+  
        if(is_same_type<eglue_type, eglue_plus >::value == true) { return P1.at(row,col) + P2.at(row,col); }
   else if(is_same_type<eglue_type, eglue_minus>::value == true) { return P1.at(row,col) - P2.at(row,col); }
   else if(is_same_type<eglue_type, eglue_div  >::value == true) { return P1.at(row,col) / P2.at(row,col); }
   else if(is_same_type<eglue_type, eglue_schur>::value == true) { return P1.at(row,col) * P2.at(row,col); }
+  else return eT(0);
   }
 
 
@@ -105,10 +112,13 @@
   {
   // the optimiser will keep only one return statement
   
+  typedef typename T1::elem_type eT;
+  
        if(is_same_type<eglue_type, eglue_plus >::value == true) { return P1.at_alt(ii) + P2.at_alt(ii); }
   else if(is_same_type<eglue_type, eglue_minus>::value == true) { return P1.at_alt(ii) - P2.at_alt(ii); }
   else if(is_same_type<eglue_type, eglue_div  >::value == true) { return P1.at_alt(ii) / P2.at_alt(ii); }
   else if(is_same_type<eglue_type, eglue_schur>::value == true) { return P1.at_alt(ii) * P2.at_alt(ii); }
+  else return eT(0);
   }
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/eglue_core_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/eglue_core_meat.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/eglue_core_meat.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -174,7 +174,8 @@
     {
     const uword n_elem = (Proxy<T1>::is_fixed || Proxy<T2>::is_fixed) ? x.get_n_elem() : out.n_elem;
     
-    if(memory::is_aligned(out_mem))
+    //if( memory::is_aligned(out_mem) )
+    if( memory::is_aligned(out_mem) && ((Proxy<T1>::is_fixed && Proxy<T2>::is_fixed) ? (x.get_n_elem() >= 32) : true) )
       {
       memory::mark_as_aligned(out_mem);
       
@@ -192,7 +193,7 @@
         {
         typename Proxy<T1>::ea_type P1 = x.P1.get_ea();
         typename Proxy<T2>::ea_type P2 = x.P2.get_ea();
-    
+        
              if(is_same_type<eglue_type, eglue_plus >::value == true) { arma_applier_1u(=, +); }
         else if(is_same_type<eglue_type, eglue_minus>::value == true) { arma_applier_1u(=, -); }
         else if(is_same_type<eglue_type, eglue_div  >::value == true) { arma_applier_1u(=, /); }

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/eop_aux.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/eop_aux.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/eop_aux.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -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 Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -17,7 +17,10 @@
   arma_inline
   operator eT ()
     {
-    return eT(std::rand()) * ( eT(1) / eT(RAND_MAX) );
+    // make sure we are internally using at least floats
+    typedef typename promote_type<eT,float>::result eTp;
+    
+    return eT( eTp(std::rand()) * ( eTp(1) / eTp(RAND_MAX) ) );
     }
   
   
@@ -138,8 +141,8 @@
     
     const eTp k = std::sqrt( (eTp(-2) * std::log(w)) / w);
     
-    out1 = tmp1*k;
-    out2 = tmp2*k;
+    out1 = eT(tmp1*k);
+    out2 = eT(tmp2*k);
     }
   
   

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/eop_core_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/eop_core_meat.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/eop_core_meat.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -155,7 +155,8 @@
     {
     const uword n_elem = (Proxy<T1>::is_fixed) ? x.get_n_elem() : out.n_elem;
     
-    if(memory::is_aligned(out_mem))
+    //if(memory::is_aligned(out_mem))
+    if( memory::is_aligned(out_mem) && ((Proxy<T1>::is_fixed) ? (x.get_n_elem() >= 32) : true) )
       {
       memory::mark_as_aligned(out_mem);
       

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/field_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/field_bones.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/field_bones.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -19,7 +19,7 @@
 
 
 
-//! A lightweight 2D container for abitrary objects
+//! A lightweight 2D container for arbitrary objects
 //! (the objects must have a copy constructor)
 
 template<typename oT>

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/field_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/field_meat.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/field_meat.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -27,9 +27,6 @@
   if(arma_config::debug == true)
     {
     // try to expose buggy user code that accesses deleted objects
-    access::rw(n_rows) = 0;
-    access::rw(n_cols) = 0;
-    access::rw(n_elem) = 0;
     mem = 0;
     }
   }

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_as_scalar.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_as_scalar.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_as_scalar.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -45,7 +45,7 @@
   {
   arma_extra_debug_sigprint();
   
-  typedef typename T1::elem_type eT;
+  // typedef typename T1::elem_type eT;
   
   const Proxy<T1> P(X);
   
@@ -316,7 +316,7 @@
   {
   arma_extra_debug_sigprint();
   
-  typedef typename T1::elem_type eT;
+  // typedef typename T1::elem_type eT;
   
   const Proxy<T1> P(X.get_ref());
   
@@ -380,7 +380,7 @@
   {
   arma_extra_debug_sigprint();
   
-  typedef typename T1::elem_type eT;
+  // typedef typename T1::elem_type eT;
   
   const ProxyCube<T1> P(X.get_ref());
   

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/glue_cross_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/glue_cross_meat.hpp	2013-07-27 11:59:22 UTC (rev 4408)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/glue_cross_meat.hpp	2013-07-31 22:00:27 UTC (rev 4409)
@@ -1,5 +1,5 @@
-// Copyright (C) 2010-2011 NICTA (www.nicta.com.au)
-// Copyright (C) 2010-2011 Conrad Sanderson
+// Copyright (C) 2010-2013 NICTA (www.nicta.com.au)
+// Copyright (C) 2010-2013 Conrad Sanderson
 // 
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -19,32 +19,54 @@
   {
   arma_extra_debug_sigprint();
   
-  typedef typename T1::elem_type      eT;
-  typedef typename Proxy<T1>::ea_type ea_type1;
-  typedef typename Proxy<T2>::ea_type ea_type2;
+  typedef typename T1::elem_type eT;
   
-  const Proxy<T1> A(X.A);
-  const Proxy<T2> B(X.B);
+  const Proxy<T1> PA(X.A);
+  const Proxy<T2> PB(X.B);
   
-  arma_debug_check( ((A.get_n_elem() != 3) || (B.get_n_elem() != 3)), "cross(): input vectors must have 3 elements" );
+  arma_debug_check( ((PA.get_n_elem() != 3) || (PB.get_n_elem() != 3)), "cross(): input vectors must have 3 elements" );
   
-  out.set_size(A.get_n_rows(), A.get_n_cols());
+  const uword PA_n_rows = Proxy<T1>::is_row ? 1 : PA.get_n_rows();
+  const uword PA_n_cols = Proxy<T1>::is_col ? 1 : PA.get_n_cols();
   
-  eT*      out_mem = out.memptr();
-  ea_type1 PA      = A.get_ea();
-  ea_type2 PB      = B.get_ea();
+  out.set_size(PA_n_rows, PA_n_cols);
   
-  const eT ax = PA[0];
-  const eT ay = PA[1];
-  const eT az = PA[2];
+  eT* out_mem = out.memptr();
   
[TRUNCATED]

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


More information about the Rcpp-commits mailing list