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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Apr 3 20:07:59 CEST 2011


Author: edd
Date: 2011-04-03 20:07:58 +0200 (Sun, 03 Apr 2011)
New Revision: 2941

Modified:
   pkg/RcppArmadillo/ChangeLog
   pkg/RcppArmadillo/DESCRIPTION
   pkg/RcppArmadillo/inst/NEWS
   pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_proto.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_proto.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/glue_cor_meat.hpp
Log:
RcppArmadillo release 0.2.18 using Armadillo 1.1.92


Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2011-04-03 17:39:57 UTC (rev 2940)
+++ pkg/RcppArmadillo/ChangeLog	2011-04-03 18:07:58 UTC (rev 2941)
@@ -1,3 +1,9 @@
+2011-04-03  Dirk Eddelbuettel  <edd at debian.org>
+
+	* DESCRIPTION: Release 0.2.18
+
+	* inst/include/*: Updated to Armadillo 1.1.92 "Jurassic Barbecue"
+
 2011-03-22  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Release 0.2.17

Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION	2011-04-03 17:39:57 UTC (rev 2940)
+++ pkg/RcppArmadillo/DESCRIPTION	2011-04-03 18:07:58 UTC (rev 2941)
@@ -1,7 +1,7 @@
 Package: RcppArmadillo
 Type: Package
 Title: Rcpp integration for Armadillo templated linear algebra library
-Version: 0.2.17
+Version: 0.2.18
 Date: $Date$
 Author: Romain Francois, Dirk Eddelbuettel and Doug Bates
 Maintainer: Romain Francois, Dirk Eddelbuettel and Doug Bates <RcppArmadillo-authors at r-enthusiasts.com>
@@ -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 1.1.90). Thus users do not need to
+ Armadillo library (currently version 1.1.92). 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/inst/NEWS
===================================================================
--- pkg/RcppArmadillo/inst/NEWS	2011-04-03 17:39:57 UTC (rev 2940)
+++ pkg/RcppArmadillo/inst/NEWS	2011-04-03 18:07:58 UTC (rev 2941)
@@ -1,3 +1,10 @@
+0.2.18  2011-04-03
+
+    o   Upgraded to Armadillo Version 1.1.92  "Jurassic Barbecue"
+
+          * Bugfix in cor()
+	  * Automatic installation now requires CMake >= 2.6
+
 0.2.17  2011-03-22
 
     o   Upgraded to Armadillo Version 1.1.90  "Inside Job"

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.hpp	2011-04-03 17:39:57 UTC (rev 2940)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.hpp	2011-04-03 18:07:58 UTC (rev 2941)
@@ -2340,19 +2340,11 @@
   const u32 N   = n_elem;
         eT* ptr = memptr();
   
-  u32 i,j;
-  
-  for(i=0, j=1; j<N; i+=2, j+=2)
+  for(u32 i=0; i<N; ++i)
     {
     ptr[i] = eT(eop_aux_randn<eT>());
-    ptr[j] = eT(eop_aux_randn<eT>());
     }
   
-  if(i < N)
-    {
-    ptr[i] = eT(eop_aux_randn<eT>());
-    }
-  
   return *this;
   }
 
@@ -2412,6 +2404,7 @@
 
 template<typename eT>
 inline
+arma_warn_unused
 eT
 Cube<eT>::min() const
   {
@@ -2426,6 +2419,7 @@
 
 template<typename eT>
 inline
+arma_warn_unused
 eT
 Cube<eT>::max() const
   {

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_proto.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_proto.hpp	2011-04-03 17:39:57 UTC (rev 2940)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_proto.hpp	2011-04-03 18:07:58 UTC (rev 2941)
@@ -228,8 +228,8 @@
   template<typename T1> inline void set_imag(const BaseCube<pod_type,T1>& X);
   
   
-  inline eT min() const;
-  inline eT max() const;
+  inline arma_warn_unused eT min() const;
+  inline arma_warn_unused eT max() const;
   
   inline eT min(u32& index_of_min_val) const;
   inline eT max(u32& index_of_max_val) const;

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp	2011-04-03 17:39:57 UTC (rev 2940)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp	2011-04-03 18:07:58 UTC (rev 2941)
@@ -4146,6 +4146,7 @@
 
 template<typename eT>
 inline
+arma_warn_unused
 eT
 Mat<eT>::min() const
   {
@@ -4160,6 +4161,7 @@
 
 template<typename eT>
 inline
+arma_warn_unused
 eT
 Mat<eT>::max() const
   {

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_proto.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_proto.hpp	2011-04-03 17:39:57 UTC (rev 2940)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_proto.hpp	2011-04-03 18:07:58 UTC (rev 2941)
@@ -320,8 +320,8 @@
   template<typename T1> inline void set_imag(const Base<pod_type,T1>& X);
   
   
-  inline eT min() const;
-  inline eT max() const;
+  inline arma_warn_unused eT min() const;
+  inline arma_warn_unused eT max() const;
   
   inline eT min(u32& index_of_min_val) const;
   inline eT max(u32& index_of_max_val) const;

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2011-04-03 17:39:57 UTC (rev 2940)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2011-04-03 18:07:58 UTC (rev 2941)
@@ -18,8 +18,8 @@
 
 #define ARMA_VERSION_MAJOR 1
 #define ARMA_VERSION_MINOR 1
-#define ARMA_VERSION_PATCH 90
-#define ARMA_VERSION_NAME  "Inside Job"
+#define ARMA_VERSION_PATCH 92
+#define ARMA_VERSION_NAME  "Jurassic Barbecue"
 
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/glue_cor_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/glue_cor_meat.hpp	2011-04-03 17:39:57 UTC (rev 2940)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/glue_cor_meat.hpp	2011-04-03 18:07:58 UTC (rev 2941)
@@ -1,5 +1,5 @@
-// Copyright (C) 2009-2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2009-2010 Conrad Sanderson
+// Copyright (C) 2009-2011 NICTA (www.nicta.com.au)
+// Copyright (C) 2009-2011 Conrad Sanderson
 // Copyright (C) 2009-2010 Dimitrios Bouzas
 // 
 // This file is part of the Armadillo C++ library.
@@ -23,50 +23,50 @@
 glue_cor::direct_cor(Mat<eT>& out, const Mat<eT>& A, const Mat<eT>& B, const u32 norm_type)
   {
   arma_extra_debug_sigprint();
-
+  
   if(A.is_vec() && B.is_vec())
     {
-    arma_debug_check( (A.n_elem != B.n_elem), "cor(): the number of elements in A and B must match" );
-
+    arma_debug_check( (A.n_elem != B.n_elem), "cor(): the number of elements in the two vectors must match" );
+    
     const eT* A_ptr = A.memptr();
     const eT* B_ptr = B.memptr();
-
+    
     eT A_acc   = eT(0);
     eT B_acc   = eT(0);
     eT out_acc = eT(0);
-
+    
     const u32 N = A.n_elem;
-
+    
     for(u32 i=0; i<N; ++i)
       {
       const eT A_tmp = A_ptr[i];
       const eT B_tmp = B_ptr[i];
-
+      
       A_acc += A_tmp;
       B_acc += B_tmp;
-
+      
       out_acc += A_tmp * B_tmp;
       }
-
+    
     out_acc -= (A_acc * B_acc)/eT(N);
-
+    
     const eT norm_val = (norm_type == 0) ? ( (N > 1) ? eT(N-1) : eT(1) ) : eT(N);    
-
+    
     out.set_size(1,1);
     out[0] = out_acc/norm_val;
-
-    const Mat<eT> stddev_A = (A.n_rows == 1) ? stddev(trans(A)) : stddev(A);
-    const Mat<eT> stddev_B = (B.n_rows == 1) ? stddev(trans(B)) : stddev(B);
-
+    
+    const Mat<eT> stddev_A = (A.n_rows == 1) ? Mat<eT>(stddev(trans(A))) : Mat<eT>(stddev(A));
+    const Mat<eT> stddev_B = (B.n_rows == 1) ? Mat<eT>(stddev(trans(B))) : Mat<eT>(stddev(B));
+    
     out /= stddev_A * stddev_B;
     }
   else
     {
     arma_debug_assert_same_size(A, B, "cor()");
-
+    
     const u32 N = A.n_rows;
     const eT norm_val = (norm_type == 0) ? ( (N > 1) ? eT(N-1) : eT(1) ) : eT(N);
-
+    
     out = trans(A) * B;
     out -= (trans(sum(A)) * sum(B))/eT(N);
     out /= norm_val;
@@ -82,52 +82,52 @@
 glue_cor::direct_cor(Mat< std::complex<T> >& out, const Mat< std::complex<T> >& A, const Mat< std::complex<T> >& B, const u32 norm_type)
   {
   arma_extra_debug_sigprint();
-
+  
   typedef typename std::complex<T> eT;
-
+  
   if(A.is_vec() && B.is_vec())
-    { 
-    arma_debug_check( (A.n_elem != B.n_elem), "cor(): the number of elements in A and B must match" );
-
+    {
+    arma_debug_check( (A.n_elem != B.n_elem), "cor(): the number of elements in the two vectors must match" );
+    
     const eT* A_ptr = A.memptr();
     const eT* B_ptr = B.memptr();        
-
+    
     eT A_acc   = eT(0);
     eT B_acc   = eT(0);
     eT out_acc = eT(0);
-
+    
     const u32 N = A.n_elem;
-
+    
     for(u32 i=0; i<N; ++i)
       {
       const eT A_tmp = A_ptr[i];
       const eT B_tmp = B_ptr[i];
-
+      
       A_acc += A_tmp;
       B_acc += B_tmp;
-
+      
       out_acc += std::conj(A_tmp) * B_tmp;
       }
-
+    
     out_acc -= (std::conj(A_acc) * B_acc)/eT(N);
-
+    
     const eT norm_val = (norm_type == 0) ? ( (N > 1) ? eT(N-1) : eT(1) ) : eT(N);
-
+    
     out.set_size(1,1);
     out[0] = out_acc/norm_val;
-
-    const Mat<T> stddev_A = (A.n_rows == 1) ? stddev(trans(A)) : stddev(A);
-    const Mat<T> stddev_B = (B.n_rows == 1) ? stddev(trans(B)) : stddev(B);
-
+    
+    const Mat<T> stddev_A = (A.n_rows == 1) ? Mat<T>(stddev(trans(A))) : Mat<T>(stddev(A));
+    const Mat<T> stddev_B = (B.n_rows == 1) ? Mat<T>(stddev(trans(B))) : Mat<T>(stddev(B));
+    
     out /= conv_to< Mat<eT> >::from( stddev_A * stddev_B );
     }
   else
     {
     arma_debug_assert_same_size(A, B, "cor()");
-
+    
     const u32 N = A.n_rows;
     const eT norm_val = (norm_type == 0) ? ( (N > 1) ? eT(N-1) : eT(1) ) : eT(N);
-
+    
     out = trans(conj(A)) * B;
     out -= (trans(conj(sum(A))) * sum(B))/eT(N);
     out /= norm_val;
@@ -143,12 +143,12 @@
 glue_cor::apply(Mat<typename T1::elem_type>& out, const Glue<T1,T2,glue_cor>& X)
   {
   arma_extra_debug_sigprint();
-
+  
   typedef typename T1::elem_type eT;
-
+  
   const unwrap_check<T1> A_tmp(X.A, out);
   const unwrap_check<T2> B_tmp(X.B, out);
-
+  
   const Mat<eT>& A = A_tmp.M;
   const Mat<eT>& B = B_tmp.M;
   
@@ -162,7 +162,6 @@
     {
     op_cor::direct_cor(out, A, norm_type);
     }
-  
   }
 
 



More information about the Rcpp-commits mailing list