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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 5 05:44:47 CET 2011


Author: edd
Date: 2011-12-05 05:44:41 +0100 (Mon, 05 Dec 2011)
New Revision: 3405

Modified:
   pkg/RcppArmadillo/ChangeLog
   pkg/RcppArmadillo/DESCRIPTION
   pkg/RcppArmadillo/inst/NEWS
   pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/diagview_meat.hpp
Log:
RcppArmadillo 0.2.32 with Armadillo 2.4.0


Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2011-12-02 19:52:36 UTC (rev 3404)
+++ pkg/RcppArmadillo/ChangeLog	2011-12-05 04:44:41 UTC (rev 3405)
@@ -1,3 +1,9 @@
+2011-12-04  Dirk Eddelbuettel  <edd at debian.org>
+
+	* DESCRIPTION: Release 0.2.32
+
+	* inst/include/*: Upgraded to new test release 2.4.0 of Armadillo
+
 2011-11-28  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Release 0.2.31

Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION	2011-12-02 19:52:36 UTC (rev 3404)
+++ pkg/RcppArmadillo/DESCRIPTION	2011-12-05 04:44:41 UTC (rev 3405)
@@ -1,7 +1,7 @@
 Package: RcppArmadillo
 Type: Package
 Title: Rcpp integration for Armadillo templated linear algebra library
-Version: 0.2.31
+Version: 0.2.32
 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 2.3.92). Thus users do not need to
+ Armadillo library (currently version 2.4.0). 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-12-02 19:52:36 UTC (rev 3404)
+++ pkg/RcppArmadillo/inst/NEWS	2011-12-05 04:44:41 UTC (rev 3405)
@@ -1,3 +1,25 @@
+0.2.32  2011-12-04
+
+    o   Upgraded to Armadillo test release 2.4.0 "Loco Lounge Lizard"
+
+    o   Minimal changes relative to 0.2.31 based on 2.3.92, next section is
+        relative to the previous stable release series 2.2.* of Armadillo
+
+          * added shorter forms of transposes: .t() and .st()
+          * added optional use of 64 bit indices, allowing matrices to have
+            more than 4 billion elements 
+          * added experimental support for C++11 initialiser lists
+          * faster pinv()
+          * faster inplace transpose
+          * faster handling of expressions with diagonal views
+          * fixes for handling expressions with aliasing and submatrices
+          * fixes for linking on Ubuntu and Debian systems
+          * fixes for inconsistencies in interactions between matrices and
+            cubes 
+          * refactored code to eliminate warnings when using the Clang C++
+            compiler 
+          * .print_trans() and .raw_print_trans() are deprecated
+
 0.2.31  2011-11-28
 
     o   Upgraded to Armadillo test release 2.3.92 "Loco Lounge Lizard (Beta 2)"

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2011-12-02 19:52:36 UTC (rev 3404)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2011-12-05 04:44:41 UTC (rev 3405)
@@ -17,9 +17,9 @@
 
 
 #define ARMA_VERSION_MAJOR 2
-#define ARMA_VERSION_MINOR 3
-#define ARMA_VERSION_PATCH 92
-#define ARMA_VERSION_NAME  "Loco Lounge Lizard (Beta 2)"
+#define ARMA_VERSION_MINOR 4
+#define ARMA_VERSION_PATCH 0
+#define ARMA_VERSION_NAME  "Loco Lounge Lizard"
 
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/diagview_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/diagview_meat.hpp	2011-12-02 19:52:36 UTC (rev 3404)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/diagview_meat.hpp	2011-12-05 04:44:41 UTC (rev 3405)
@@ -68,17 +68,36 @@
         Mat<eT>& t_m = *(t.m_ptr);
   const Mat<eT>& x_m = x.m;
   
-  const uword t_n_elem     = t.n_elem;
-  const uword t_row_offset = t.row_offset;
-  const uword t_col_offset = t.col_offset;
-  
-  const uword x_row_offset = x.row_offset;
-  const uword x_col_offset = x.col_offset;
-  
-  for(uword i=0; i<t_n_elem; ++i)
+  if(&t_m != &x_m)
     {
-    t_m.at(i + t_row_offset, i + t_col_offset) = x_m.at(i + x_row_offset, i + x_col_offset);
+    const uword t_n_elem     = t.n_elem;
+    const uword t_row_offset = t.row_offset;
+    const uword t_col_offset = t.col_offset;
+    
+    const uword x_row_offset = x.row_offset;
+    const uword x_col_offset = x.col_offset;
+    
+    uword i,j;
+    for(i=0, j=1; j < t_n_elem; i+=2, j+=2)
+      {
+      const eT tmp_i = x_m.at(i + x_row_offset, i + x_col_offset);
+      const eT tmp_j = x_m.at(j + x_row_offset, j + x_col_offset);
+      
+      t_m.at(i + t_row_offset, i + t_col_offset) = tmp_i;
+      t_m.at(j + t_row_offset, j + t_col_offset) = tmp_j;
+      }
+    
+    if(i < t_n_elem)
+      {
+      t_m.at(i + t_row_offset, i + t_col_offset) = x_m.at(i + x_row_offset, i + x_col_offset);
+      }
     }
+  else
+    {
+    const Mat<eT> tmp = x;
+    
+    (*this).operator=(tmp);
+    }
   }
 
 
@@ -195,8 +214,18 @@
   
   const eT* x_mem = x.memptr();
   
-  for(uword i=0; i<t_n_elem; ++i)
+  uword i,j;
+  for(i=0, j=1; j < t_n_elem; i+=2, j+=2)
     {
+    const eT tmp_i = x_mem[i];
+    const eT tmp_j = x_mem[j];
+    
+    t_m.at( i + t_row_offset,  i + t_col_offset) = tmp_i;
+    t_m.at( j + t_row_offset,  j + t_col_offset) = tmp_j;
+    }
+  
+  if(i < t_n_elem)
+    {
     t_m.at( i + t_row_offset,  i + t_col_offset) = x_mem[i];
     }
   }
@@ -230,8 +259,18 @@
   
   const eT* x_mem = x.memptr();
   
-  for(uword i=0; i<t_n_elem; ++i)
+  uword i,j;
+  for(i=0, j=1; j < t_n_elem; i+=2, j+=2)
     {
+    const eT tmp_i = x_mem[i];
+    const eT tmp_j = x_mem[j];
+    
+    t_m.at( i + t_row_offset,  i + t_col_offset) += tmp_i;
+    t_m.at( j + t_row_offset,  j + t_col_offset) += tmp_j;
+    }
+  
+  if(i < t_n_elem)
+    {
     t_m.at( i + t_row_offset,  i + t_col_offset) += x_mem[i];
     }
   }
@@ -265,8 +304,18 @@
   
   const eT* x_mem = x.memptr();
   
-  for(uword i=0; i<t_n_elem; ++i)
+  uword i,j;
+  for(i=0, j=1; j < t_n_elem; i+=2, j+=2)
     {
+    const eT tmp_i = x_mem[i];
+    const eT tmp_j = x_mem[j];
+    
+    t_m.at( i + t_row_offset,  i + t_col_offset) -= tmp_i;
+    t_m.at( j + t_row_offset,  j + t_col_offset) -= tmp_j;
+    }
+  
+  if(i < t_n_elem)
+    {
     t_m.at( i + t_row_offset,  i + t_col_offset) -= x_mem[i];
     }
   }
@@ -300,8 +349,18 @@
   
   const eT* x_mem = x.memptr();
   
-  for(uword i=0; i<t_n_elem; ++i)
+  uword i,j;
+  for(i=0, j=1; j < t_n_elem; i+=2, j+=2)
     {
+    const eT tmp_i = x_mem[i];
+    const eT tmp_j = x_mem[j];
+    
+    t_m.at( i + t_row_offset,  i + t_col_offset) *= tmp_i;
+    t_m.at( j + t_row_offset,  j + t_col_offset) *= tmp_j;
+    }
+  
+  if(i < t_n_elem)
+    {
     t_m.at( i + t_row_offset,  i + t_col_offset) *= x_mem[i];
     }
   }
@@ -335,8 +394,18 @@
   
   const eT* x_mem = x.memptr();
   
-  for(uword i=0; i<t_n_elem; ++i)
+  uword i,j;
+  for(i=0, j=1; j < t_n_elem; i+=2, j+=2)
     {
+    const eT tmp_i = x_mem[i];
+    const eT tmp_j = x_mem[j];
+    
+    t_m.at( i + t_row_offset,  i + t_col_offset) /= tmp_i;
+    t_m.at( j + t_row_offset,  j + t_col_offset) /= tmp_j;
+    }
+  
+  if(i < t_n_elem)
+    {
     t_m.at( i + t_row_offset,  i + t_col_offset) /= x_mem[i];
     }
   }
@@ -362,15 +431,25 @@
   
   eT* out_mem = out.memptr();
   
-  for(uword i=0; i<in_n_elem; ++i)
+  uword i,j;
+  for(i=0, j=1; j < in_n_elem; i+=2, j+=2)
     {
-    out_mem[i] = in_m.at(i+in_row_offset, i+in_col_offset);
+    const eT tmp_i = in_m.at( i + in_row_offset, i + in_col_offset );
+    const eT tmp_j = in_m.at( j + in_row_offset, j + in_col_offset );
+    
+    out_mem[i] = tmp_i;
+    out_mem[j] = tmp_j;
     }
+  
+  if(i < in_n_elem)
+    {
+    out_mem[i] = in_m.at( i + in_row_offset, i + in_col_offset );
+    }
   }
 
 
 
-//! X += Y.diagview(...)
+//! X += Y.diag()
 template<typename eT>
 inline
 void
@@ -388,15 +467,25 @@
   
   eT* out_mem = out.memptr();
   
-  for(uword i=0; i<in_n_elem; ++i)
+  uword i,j;
+  for(i=0, j=1; j < in_n_elem; i+=2, j+=2)
     {
-    out_mem[i] += in_m.at(i+in_row_offset, i+in_col_offset);
+    const eT tmp_i = in_m.at( i + in_row_offset, i + in_col_offset );
+    const eT tmp_j = in_m.at( j + in_row_offset, j + in_col_offset );
+    
+    out_mem[i] += tmp_i;
+    out_mem[j] += tmp_j;
     }
+  
+  if(i < in_n_elem)
+    {
+    out_mem[i] += in_m.at( i + in_row_offset, i + in_col_offset );
+    }
   }
 
 
 
-//! X -= Y.diagview(...)
+//! X -= Y.diag()
 template<typename eT>
 inline
 void
@@ -414,15 +503,25 @@
   
   eT* out_mem = out.memptr();
   
-  for(uword i=0; i<in_n_elem; ++i)
+  uword i,j;
+  for(i=0, j=1; j < in_n_elem; i+=2, j+=2)
     {
-    out_mem[i] -= in_m.at(i+in_row_offset, i+in_col_offset);
+    const eT tmp_i = in_m.at( i + in_row_offset, i + in_col_offset );
+    const eT tmp_j = in_m.at( j + in_row_offset, j + in_col_offset );
+    
+    out_mem[i] -= tmp_i;
+    out_mem[j] -= tmp_j;
     }
+  
+  if(i < in_n_elem)
+    {
+    out_mem[i] -= in_m.at( i + in_row_offset, i + in_col_offset );
+    }
   }
 
 
 
-//! X %= Y.submat(...)
+//! X %= Y.diag()
 template<typename eT>
 inline
 void
@@ -440,15 +539,25 @@
   
   eT* out_mem = out.memptr();
   
-  for(uword i=0; i<in_n_elem; ++i)
+  uword i,j;
+  for(i=0, j=1; j < in_n_elem; i+=2, j+=2)
     {
-    out_mem[i] *= in_m.at(i+in_row_offset, i+in_col_offset);
+    const eT tmp_i = in_m.at( i + in_row_offset, i + in_col_offset );
+    const eT tmp_j = in_m.at( j + in_row_offset, j + in_col_offset );
+    
+    out_mem[i] *= tmp_i;
+    out_mem[j] *= tmp_j;
     }
+  
+  if(i < in_n_elem)
+    {
+    out_mem[i] *= in_m.at( i + in_row_offset, i + in_col_offset );
+    }
   }
 
 
 
-//! X /= Y.diagview(...)
+//! X /= Y.diag()
 template<typename eT>
 inline
 void
@@ -466,10 +575,20 @@
   
   eT* out_mem = out.memptr();
   
-  for(uword i=0; i<in_n_elem; ++i)
+  uword i,j;
+  for(i=0, j=1; j < in_n_elem; i+=2, j+=2)
     {
-    out_mem[i] /= in_m.at(i+in_row_offset, i+in_col_offset);
+    const eT tmp_i = in_m.at( i + in_row_offset, i + in_col_offset );
+    const eT tmp_j = in_m.at( j + in_row_offset, j + in_col_offset );
+    
+    out_mem[i] /= tmp_i;
+    out_mem[j] /= tmp_j;
     }
+  
+  if(i < in_n_elem)
+    {
+    out_mem[i] /= in_m.at( i + in_row_offset, i + in_col_offset );
+    }
   }
 
 



More information about the Rcpp-commits mailing list