[Rcpp-commits] r2901 - 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 Feb 16 03:34:11 CET 2011


Author: edd
Date: 2011-02-16 03:34:10 +0100 (Wed, 16 Feb 2011)
New Revision: 2901

Added:
   pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_meat.hpp
Removed:
   pkg/RcppArmadillo/inst/include/armadillo_bits/syslib_proto.hpp
Modified:
   pkg/RcppArmadillo/ChangeLog
   pkg/RcppArmadillo/DESCRIPTION
   pkg/RcppArmadillo/inst/NEWS
   pkg/RcppArmadillo/inst/include/README
   pkg/RcppArmadillo/inst/include/armadillo
   pkg/RcppArmadillo/inst/include/armadillo_bits/Base.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/Col_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/Col_proto.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.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/Row_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/Row_proto.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/arma_config.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_proto.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/auxlib_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/auxlib_proto.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/compiler_setup.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/config.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/debug.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_conv_to.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_prod.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/glue_solve_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/glue_solve_proto.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/injector_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/op_dot_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/op_prod_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/op_reshape_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/op_trans_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/op_trimat_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/podarray_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/subview_cube_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/subview_meat.hpp
Log:
RcppArmadillo 0.2.12 with Armadillo 1.1.2


Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/ChangeLog	2011-02-16 02:34:10 UTC (rev 2901)
@@ -1,3 +1,9 @@
+2011-02-15  Dirk Eddelbuettel  <edd at debian.org>
+
+	* DESCRIPTION: Release 0.2.12
+
+	* inst/include/*: Updated to Armadillo 1.1.2 "Flood Kayak"
+
 2011-01-06  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Release 0.2.11

Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/DESCRIPTION	2011-02-16 02:34:10 UTC (rev 2901)
@@ -1,7 +1,7 @@
 Package: RcppArmadillo
 Type: Package
 Title: Rcpp integration for Armadillo templated linear algebra library
-Version: 0.2.11
+Version: 0.2.12
 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.0). Thus users do not need to
+ Armadillo library (currently version 1.1.20). Thus users do not need to
  install Armadillo itself in order to use RcppArmadillo.
  .
  This Armadillo integration provides a nice illustration of the 
@@ -32,7 +32,7 @@
  GPL version 2 or later, as is the rest of Rcpp.
 License: GPL (>= 2)
 LazyLoad: yes
-Depends: R (>= 2.12.0), Rcpp (>= 0.8.9.4)
+Depends: R (>= 2.12.0), Rcpp (>= 0.9.0)
 LinkingTo: Rcpp
 Suggests: inline, RUnit
 URL: http://arma.sourceforge.net/, http://dirk.eddelbuettel.com/code/rcpp.armadillo.html, http://romainfrancois.blog.free.fr/index.php?category/R-package/RcppArmadillo

Modified: pkg/RcppArmadillo/inst/NEWS
===================================================================
--- pkg/RcppArmadillo/inst/NEWS	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/inst/NEWS	2011-02-16 02:34:10 UTC (rev 2901)
@@ -1,3 +1,12 @@
+0.2.12  2011-02-15
+
+    o   Upgraded to Armadillo Version 1.1.2   “Flood Kayak”
+
+         * Faster prod()
+	 * Faster solve() for compound expressions
+	 * Fix for compilation using GCC's C++0x mode
+	 * Fix for matrix handling by subcubes
+
 0.2.11  2011-01-06
 
     o   Upgraded to Armadillo Version 1.1.0   “Climate Vandal”

Modified: pkg/RcppArmadillo/inst/include/README
===================================================================
--- pkg/RcppArmadillo/inst/include/README	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/inst/include/README	2011-02-16 02:34:10 UTC (rev 2901)
@@ -2,4 +2,5 @@
 
 - copy the armadillo file here
 - replace the armadillo_bits directory by the one from the armadillo source
+- ignore (or remove) armadillo_bits/config.hpp.cmake as we do not configuration
 

Modified: pkg/RcppArmadillo/inst/include/armadillo
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/inst/include/armadillo	2011-02-16 02:34:10 UTC (rev 2901)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2010 Conrad Sanderson
+// Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2011 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -126,16 +126,14 @@
   #include "armadillo_bits/Base.hpp"
   #include "armadillo_bits/BaseCube.hpp"
   
-  #include "armadillo_bits/syslib_proto.hpp"
-  #include "armadillo_bits/arrayops_proto.hpp"
-  #include "armadillo_bits/podarray_proto.hpp"
-  
   #include "armadillo_bits/blas_proto.hpp"
   #include "armadillo_bits/lapack_proto.hpp"
   #include "armadillo_bits/atlas_proto.hpp"
+  
+  #include "armadillo_bits/arrayops_proto.hpp"
+  #include "armadillo_bits/podarray_proto.hpp"
   #include "armadillo_bits/auxlib_proto.hpp"
   
-  
   #include "armadillo_bits/injector_proto.hpp"
   
   #include "armadillo_bits/Mat_proto.hpp"
@@ -367,6 +365,7 @@
   #include "armadillo_bits/eop_core_meat.hpp"
   #include "armadillo_bits/eglue_core_meat.hpp"
   
+  #include "armadillo_bits/arrayops_meat.hpp"
   #include "armadillo_bits/podarray_meat.hpp"
   #include "armadillo_bits/auxlib_meat.hpp"
   

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Base.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Base.hpp	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Base.hpp	2011-02-16 02:34:10 UTC (rev 2901)
@@ -36,19 +36,4 @@
 
 
 
-template<typename elem_type, typename derived>
-struct BaseVec
-  {
-  
-  arma_inline
-  const derived&
-  get_ref() const
-    {
-    return static_cast<const derived&>(*this);
-    }
-
-  };
-
-
-
 //! @}

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Col_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Col_meat.hpp	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Col_meat.hpp	2011-02-16 02:34:10 UTC (rev 2901)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2010 Conrad Sanderson
+// Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2011 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -372,12 +372,12 @@
   
   if(n_keep_front > 0)
     {
-    syslib::copy_elem( X_mem, t_mem, n_keep_front );
+    arrayops::copy( X_mem, t_mem, n_keep_front );
     }
   
   if(n_keep_back > 0)
     {
-    syslib::copy_elem( &(X_mem[n_keep_front]), &(t_mem[in_row2+1]), n_keep_back);
+    arrayops::copy( &(X_mem[n_keep_front]), &(t_mem[in_row2+1]), n_keep_back);
     }
   
   steal_mem(X);
@@ -411,12 +411,12 @@
     
     if(A_n_rows > 0)
       {
-      syslib::copy_elem( out_mem, t_mem, A_n_rows );
+      arrayops::copy( out_mem, t_mem, A_n_rows );
       }
     
     if(B_n_rows > 0)
       {
-      syslib::copy_elem( &(out_mem[row_num + N]), &(t_mem[row_num]), B_n_rows );
+      arrayops::copy( &(out_mem[row_num + N]), &(t_mem[row_num]), B_n_rows );
       }
     
     if(set_to_zero == true)
@@ -516,7 +516,7 @@
     access::rw(Mat<eT>::n_elem)    = fixed_n_elem;
     access::rw(Mat<eT>::vec_state) = 1;
     access::rw(Mat<eT>::mem_state) = 3;
-    access::rw(Mat<eT>::mem)       = (fixed_n_elem > Mat_prealloc::mem_n_elem) ? mem_local_extra : Mat<eT>::mem_local;
+    access::rw(Mat<eT>::mem)       = (fixed_n_elem > arma_config::mat_prealloc) ? mem_local_extra : Mat<eT>::mem_local;
     }
   else
     {

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Col_proto.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Col_proto.hpp	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Col_proto.hpp	2011-02-16 02:34:10 UTC (rev 2901)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2010 Conrad Sanderson
+// Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2011 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -17,7 +17,7 @@
 //! Class for column vectors (matrices with only one column)
 
 template<typename eT>
-class Col : public Mat<eT>, public BaseVec< eT, Col<eT> >
+class Col : public Mat<eT>
   {
   public:
   
@@ -82,7 +82,7 @@
     {
     private:
     
-    arma_aligned eT mem_local_extra[ ( fixed_n_elem > Mat_prealloc::mem_n_elem ) ? fixed_n_elem : 1 ];
+    arma_aligned eT mem_local_extra[ (fixed_n_elem > arma_config::mat_prealloc) ? fixed_n_elem : 1 ];
     
     arma_inline void mem_setup();
     arma_inline void swap_rows_cols() { access::rw(Mat<eT>::n_cols) = fixed_n_elem; access::rw(Mat<eT>::n_rows) = 1; }

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.hpp	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Cube_meat.hpp	2011-02-16 02:34:10 UTC (rev 2901)
@@ -448,7 +448,7 @@
   if(this != &x)
     {
     init(x.n_rows, x.n_cols, x.n_slices);
-    syslib::copy_elem( memptr(), x.mem, n_elem );
+    arrayops::copy( memptr(), x.mem, n_elem );
     }
   }
 
@@ -478,7 +478,7 @@
     {
     init(aux_n_rows, aux_n_cols, aux_n_slices);
     
-    syslib::copy_elem( memptr(), aux_mem, n_elem );
+    arrayops::copy( memptr(), aux_mem, n_elem );
     }
   else
     {
@@ -505,7 +505,7 @@
   arma_extra_debug_sigprint_this(this);
   
   init(aux_n_rows, aux_n_cols, aux_n_slices);
-  syslib::copy_elem( memptr(), aux_mem, n_elem );
+  arrayops::copy( memptr(), aux_mem, n_elem );
   }
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_meat.hpp	2011-02-16 02:34:10 UTC (rev 2901)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2010 Conrad Sanderson
+// Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2011 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -23,7 +23,7 @@
   
   if(mem_state == 0)
     {
-    if(n_elem > Mat_prealloc::mem_n_elem)
+    if(n_elem > arma_config::mat_prealloc)
       {
       delete [] mem;
       }
@@ -131,7 +131,7 @@
       
       if(t_mem_state == 0)
         {
-        if(old_n_elem > Mat_prealloc::mem_n_elem )
+        if(old_n_elem > arma_config::mat_prealloc)
           {
           arma_extra_debug_print("Mat::init(): freeing memory");
           
@@ -140,7 +140,7 @@
         }
       
       
-      if(new_n_elem <= Mat_prealloc::mem_n_elem )
+      if(new_n_elem <= arma_config::mat_prealloc)
         {
         access::rw(mem) = mem_local;
         }
@@ -453,7 +453,7 @@
   if(this != &x)
     {
     init(x.n_rows, x.n_cols);
-    syslib::copy_elem( memptr(), x.mem, x.n_elem );
+    arrayops::copy( memptr(), x.mem, x.n_elem );
     }
   }
 
@@ -540,7 +540,7 @@
       }
     
     
-    if( (x_mem_state == 0) && (x_n_elem > Mat_prealloc::mem_n_elem) && (layout_ok == true) )
+    if( (x_mem_state == 0) && (x_n_elem > arma_config::mat_prealloc) && (layout_ok == true) )
       {
       reset();
       
@@ -584,7 +584,7 @@
     {
     init(aux_n_rows, aux_n_cols);
     
-    syslib::copy_elem( memptr(), aux_mem, n_elem );
+    arrayops::copy( memptr(), aux_mem, n_elem );
     }
   }
 
@@ -607,7 +607,7 @@
   
   init(aux_n_rows, aux_n_cols);
   
-  syslib::copy_elem( memptr(), aux_mem, n_elem );
+  arrayops::copy( memptr(), aux_mem, n_elem );
   }
 
 
@@ -4430,7 +4430,7 @@
     access::rw(Mat<eT>::n_elem)    = fixed_n_elem;
     access::rw(Mat<eT>::vec_state) = 0;
     access::rw(Mat<eT>::mem_state) = 3;
-    access::rw(Mat<eT>::mem)       = (fixed_n_elem > Mat_prealloc::mem_n_elem) ? mem_local_extra : mem_local;
+    access::rw(Mat<eT>::mem)       = (fixed_n_elem > arma_config::mat_prealloc) ? mem_local_extra : mem_local;
     }
   else
     {

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_proto.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_proto.hpp	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Mat_proto.hpp	2011-02-16 02:34:10 UTC (rev 2901)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2010 Conrad Sanderson
+// Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2011 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -16,13 +16,6 @@
 
 
 
-struct Mat_prealloc
-  {
-  static const u32 mem_n_elem = 16;
-  };
-
-
-
 //! Dense matrix class
 
 template<typename eT>
@@ -47,7 +40,7 @@
   arma_aligned const eT* const mem;  //!< pointer to the memory used by the matrix (memory is read-only)
   
   protected:
-  arma_aligned eT mem_local[ Mat_prealloc::mem_n_elem ];
+  arma_aligned eT mem_local[ arma_config::mat_prealloc ];
   
   
   public:
@@ -428,7 +421,7 @@
     
     static const u32 fixed_n_elem = fixed_n_rows * fixed_n_cols;
     
-    arma_aligned eT mem_local_extra[ ( fixed_n_elem > Mat_prealloc::mem_n_elem ) ? fixed_n_elem : 1 ];
+    arma_aligned eT mem_local_extra[ (fixed_n_elem > arma_config::mat_prealloc) ? fixed_n_elem : 1 ];
     
     arma_inline void mem_setup();
     

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Row_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Row_meat.hpp	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Row_meat.hpp	2011-02-16 02:34:10 UTC (rev 2901)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2010 Conrad Sanderson
+// Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2011 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -345,12 +345,12 @@
   
   if(n_keep_front > 0)
     {
-    syslib::copy_elem( X_mem, t_mem, n_keep_front );
+    arrayops::copy( X_mem, t_mem, n_keep_front );
     }
   
   if(n_keep_back > 0)
     {
-    syslib::copy_elem( &(X_mem[n_keep_front]), &(t_mem[in_col2+1]), n_keep_back);
+    arrayops::copy( &(X_mem[n_keep_front]), &(t_mem[in_col2+1]), n_keep_back);
     }
   
   steal_mem(X);
@@ -384,12 +384,12 @@
     
     if(A_n_cols > 0)
       {
-      syslib::copy_elem( out_mem, t_mem, A_n_cols );
+      arrayops::copy( out_mem, t_mem, A_n_cols );
       }
     
     if(B_n_cols > 0)
       {
-      syslib::copy_elem( &(out_mem[col_num + N]), &(t_mem[col_num]), B_n_cols );
+      arrayops::copy( &(out_mem[col_num + N]), &(t_mem[col_num]), B_n_cols );
       }
     
     if(set_to_zero == true)
@@ -489,7 +489,7 @@
     access::rw(Mat<eT>::n_elem)    = fixed_n_elem;
     access::rw(Mat<eT>::vec_state) = 2;
     access::rw(Mat<eT>::mem_state) = 3;
-    access::rw(Mat<eT>::mem)       = (fixed_n_elem > Mat_prealloc::mem_n_elem) ? mem_local_extra : Mat<eT>::mem_local;
+    access::rw(Mat<eT>::mem)       = (fixed_n_elem > arma_config::mat_prealloc) ? mem_local_extra : Mat<eT>::mem_local;
     }
   else
     {

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/Row_proto.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/Row_proto.hpp	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/Row_proto.hpp	2011-02-16 02:34:10 UTC (rev 2901)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2010 Conrad Sanderson
+// Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2011 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -17,7 +17,7 @@
 //! Class for row vectors (matrices with only one row)
 
 template<typename eT>
-class Row : public Mat<eT>, public BaseVec< eT, Row<eT> >
+class Row : public Mat<eT>
   {
   public:
   
@@ -82,7 +82,7 @@
     {
     private:
     
-    arma_aligned eT mem_local_extra[ ( fixed_n_elem > Mat_prealloc::mem_n_elem ) ? fixed_n_elem : 1 ];
+    arma_aligned eT mem_local_extra[ (fixed_n_elem > arma_config::mat_prealloc) ? fixed_n_elem : 1 ];
     
     arma_inline void mem_setup();
     

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_config.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_config.hpp	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_config.hpp	2011-02-16 02:34:10 UTC (rev 2901)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2010 Conrad Sanderson
+// Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2011 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -18,6 +18,12 @@
 
 struct arma_config
   {
+  #if defined(ARMA_MAT_PREALLOC)
+    static const u32 mat_prealloc = (s32(ARMA_MAT_PREALLOC) > 0) ? u32(ARMA_MAT_PREALLOC) : 1;
+  #else
+    static const u32 mat_prealloc = 16;
+  #endif
+  
   #if defined(ARMA_USE_ATLAS)
     static const bool atlas = true;
   #else

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2011-02-16 02:34:10 UTC (rev 2901)
@@ -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
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -18,8 +18,8 @@
 
 #define ARMA_VERSION_MAJOR 1
 #define ARMA_VERSION_MINOR 1
-#define ARMA_VERSION_PATCH 0
-#define ARMA_VERSION_NAME  "Climate Vandal"
+#define ARMA_VERSION_PATCH 2
+#define ARMA_VERSION_NAME  "Flood Kayak"
 
 
 

Added: pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_meat.hpp	                        (rev 0)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_meat.hpp	2011-02-16 02:34:10 UTC (rev 2901)
@@ -0,0 +1,630 @@
+// Copyright (C) 2011 NICTA (www.nicta.com.au)
+// Copyright (C) 2011 Conrad Sanderson
+// 
+// This file is part of the Armadillo C++ library.
+// It is provided without any warranty of fitness
+// for any purpose. You can redistribute this file
+// and/or modify it under the terms of the GNU
+// Lesser General Public License (LGPL) as published
+// by the Free Software Foundation, either version 3
+// of the License or (at your option) any later version.
+// (see http://www.opensource.org/licenses for more info)
+
+
+//! \addtogroup arrayops
+//! @{
+
+
+
+template<typename eT>
+arma_hot
+inline
+void
+arrayops::copy(eT* dest, const eT* src, const u32 n_elem)
+  {
+  #if !defined(__OPTIMIZE__)
+    {
+    std::memcpy(dest, src, n_elem*sizeof(eT));
+    }
+  #else
+    {
+    switch(n_elem)
+      {
+      case 0:
+        break;
+      
+      case 1:
+        *dest = *src;
+        break;
+        
+      case 2:
+        dest[0] = src[0];
+        dest[1] = src[1];
+        break;
+      
+      case 3:
+        dest[0] = src[0];
+        dest[1] = src[1];
+        dest[2] = src[2];
+        break;
+      
+      case 4:
+        dest[0] = src[0];
+        dest[1] = src[1];
+        dest[2] = src[2];
+        dest[3] = src[3];
+        break;
+      
+      default:
+        if( n_elem <= (128/sizeof(eT)) )
+          {
+          u32 i,j;
+          
+          for(i=0, j=1; j<n_elem; i+=2, j+=2)
+            {
+            dest[i] = src[i];
+            dest[j] = src[j];
+            }
+          
+          if(i < n_elem)
+            {
+            dest[i] = src[i];
+            }
+          }
+        else
+          {
+          std::memcpy(dest, src, n_elem*sizeof(eT));
+          }
+      }
+    }
+  #endif
+  }
+
+
+
+template<typename out_eT, typename in_eT>
+arma_hot
+arma_inline
+void
+arrayops::convert_cx_scalar
+  (
+        out_eT& out,
+  const in_eT&  in,
+  const typename arma_not_cx<out_eT>::result* junk1,
+  const typename arma_not_cx< in_eT>::result* junk2
+  )
+  {
+  arma_ignore(junk1);
+  arma_ignore(junk2);
+  
+  out = out_eT(in);
+  }
+
+
+
+template<typename out_eT, typename in_T>
+arma_hot
+arma_inline
+void
+arrayops::convert_cx_scalar
+  (
+        out_eT&             out,
+  const std::complex<in_T>& in,
+  const typename arma_not_cx<out_eT>::result* junk
+  )
+  {
+  arma_ignore(junk);
+  
+  out = out_eT( in.real() );
+  }
+
+
+
+template<typename out_T, typename in_T>
+arma_hot
+arma_inline
+void
+arrayops::convert_cx_scalar
+  (
+        std::complex<out_T>& out,
+  const std::complex< in_T>& in
+  )
+  {
+  typedef std::complex<out_T> out_eT;
+  
+  out = out_eT(in);
+  }
+
+
+
+template<typename out_eT, typename in_eT>
+arma_hot
+inline
+void
+arrayops::convert(out_eT* dest, const in_eT* src, const u32 n_elem)
+  {
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    dest[i] = out_eT( src[i] );
+    dest[j] = out_eT( src[j] );
+    }
+  
+  if(i < n_elem)
+    {
+    dest[i] = out_eT( src[i] );
+    }
+  }
+
+
+
+template<typename out_eT, typename in_eT>
+arma_hot
+inline
+void
+arrayops::convert_cx(out_eT* dest, const in_eT* src, const u32 n_elem)
+  {
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    arrayops::convert_cx_scalar( dest[i], src[i] );
+    arrayops::convert_cx_scalar( dest[j], src[j] );
+    }
+  
+  if(i < n_elem)
+    {
+    arrayops::convert_cx_scalar( dest[i], src[i] );
+    }
+  }
+
+
+
+template<typename eT>
+arma_hot
+inline
+void
+arrayops::inplace_plus(eT* dest, const eT* src, const u32 n_elem)
+  {
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    dest[i] += src[i];
+    dest[j] += src[j];
+    }
+  
+  if(i < n_elem)
+    {
+    dest[i] += src[i];
+    }
+  }
+
+
+
+template<typename eT>
+arma_hot
+inline
+void
+arrayops::inplace_minus(eT* dest, const eT* src, const u32 n_elem)
+  {
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    dest[i] -= src[i];
+    dest[j] -= src[j];
+    }
+  
+  if(i < n_elem)
+    {
+    dest[i] -= src[i];
+    }
+  }
+
+
+
+template<typename eT>
+arma_hot
+inline
+void
+arrayops::inplace_mul(eT* dest, const eT* src, const u32 n_elem)
+  {
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    dest[i] *= src[i];
+    dest[j] *= src[j];
+    }
+  
+  if(i < n_elem)
+    {
+    dest[i] *= src[i];
+    }
+  }
+
+
+
+template<typename eT>
+arma_hot
+inline
+void
+arrayops::inplace_div(eT* dest, const eT* src, const u32 n_elem)
+  {
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    dest[i] /= src[i];
+    dest[j] /= src[j];
+    }
+  
+  if(i < n_elem)
+    {
+    dest[i] /= src[i];
+    }
+  }
+
+
+
+template<typename eT>
+arma_hot
+inline
+void
+arrayops::inplace_set(eT* dest, const eT val, const u32 n_elem)
+  {
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    dest[i] = val;
+    dest[j] = val;
+    }
+  
+  if(i < n_elem)
+    {
+    dest[i] = val;
+    }
+  }
+
+
+
+template<typename eT>
+arma_hot
+inline
+void
+arrayops::inplace_plus(eT* dest, const eT val, const u32 n_elem)
+  {
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    dest[i] += val;
+    dest[j] += val;
+    }
+  
+  if(i < n_elem)
+    {
+    dest[i] += val;
+    }
+  }
+
+
+
+template<typename eT>
+arma_hot
+inline
+void
+arrayops::inplace_minus(eT* dest, const eT val, const u32 n_elem)
+  {
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    dest[i] -= val;
+    dest[j] -= val;
+    }
+  
+  if(i < n_elem)
+    {
+    dest[i] -= val;
+    }
+  }
+
+
+
+template<typename eT>
+arma_hot
+inline
+void
+arrayops::inplace_mul(eT* dest, const eT val, const u32 n_elem)
+  {
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    dest[i] *= val;
+    dest[j] *= val;
+    }
+  
+  if(i < n_elem)
+    {
+    dest[i] *= val;
+    }
+  }
+
+
+
+template<typename eT>
+arma_hot
+inline
+void
+arrayops::inplace_div(eT* dest, const eT val, const u32 n_elem)
+  {
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    dest[i] /= val;
+    dest[j] /= val;
+    }
+  
+  if(i < n_elem)
+    {
+    dest[i] /= val;
+    }
+  }
+
+
+
+template<typename eT>
+arma_hot
+arma_pure
+inline
+eT
+arrayops::accumulate(const eT* src, const u32 n_elem)
+  {
+  u32 i,j;
+  
+  eT acc1 = eT(0);
+  eT acc2 = eT(0);
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    acc1 += src[i];
+    acc2 += src[j];
+    }
+  
+  if(i < n_elem)
+    {
+    acc1 += src[i];
+    }
+  
+  return acc1 + acc2;
+  }
+
+
+
+template<typename eT>
+arma_hot
+arma_pure
+inline
+eT
+arrayops::product(const eT* src, const u32 n_elem)
+  {
+  eT val1 = eT(1);
+  eT val2 = eT(1);
+  
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    val1 *= src[i];
+    val2 *= src[j];
+    }
+  
+  if(i < n_elem)
+    {
+    val1 *= src[i];
+    }
+  
+  return val1 * val2;
+  }
+
+
+
+template<typename eT>
+arma_hot
+arma_pure
+inline
+typename get_pod_type<eT>::result
+arrayops::norm_1(const eT* src, const u32 n_elem)
+  {
+  typedef typename get_pod_type<eT>::result T;
+  
+  T acc = T(0);
+  
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    acc += std::abs(src[i]);
+    acc += std::abs(src[j]);
+    }
+  
+  if(i < n_elem)
+    {
+    acc += std::abs(src[i]);
+    }
+  
+  return acc;
+  }
+
+
+
+template<typename eT>
+arma_hot
+arma_pure
+inline
+eT
+arrayops::norm_2(const eT* src, const u32 n_elem, const typename arma_not_cx<eT>::result* junk)
+  {
+  arma_ignore(junk);
+  
+  eT acc = eT(0);
+  
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    const eT tmp_i = src[i];
+    const eT tmp_j = src[j];
+    
+    acc += tmp_i * tmp_i;
+    acc += tmp_j * tmp_j;
+    }
+  
+  if(i < n_elem)
+    {
+    const eT tmp_i = src[i];
+    
+    acc += tmp_i * tmp_i;
+    }
+  
+  return std::sqrt(acc);
+  }
+
+
+
+template<typename T>
+arma_hot
+arma_pure
+inline
+T
+arrayops::norm_2(const std::complex<T>* src, const u32 n_elem)
+  {
+  T acc = T(0);
+  
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    const T tmp_i = std::abs(src[i]);
+    const T tmp_j = std::abs(src[j]);
+    
+    acc += tmp_i * tmp_i;
+    acc += tmp_j * tmp_j;
+    }
+  
+  if(i < n_elem)
+    {
+    const T tmp_i = std::abs(src[i]);
+    
+    acc += tmp_i * tmp_i;
+    }
+  
+  return std::sqrt(acc);
+  }
+
+
+
+template<typename eT>
+arma_hot
+arma_pure
+inline
+typename get_pod_type<eT>::result
+arrayops::norm_k(const eT* src, const u32 n_elem, const int k)
+  {
+  typedef typename get_pod_type<eT>::result T;
+  
+  T acc = T(0);
+  
+  u32 i,j;
+  
+  for(i=0, j=1; j<n_elem; i+=2, j+=2)
+    {
+    acc += std::pow(std::abs(src[i]), k);
+    acc += std::pow(std::abs(src[j]), k);
+    }
+  
+  if(i < n_elem)
+    {
+    acc += std::pow(std::abs(src[i]), k);
+    }
+  
+  return std::pow(acc, T(1)/T(k));
+  }
+
+
+
+template<typename eT>
+arma_hot
+arma_pure
+inline
+typename get_pod_type<eT>::result
+arrayops::norm_max(const eT* src, const u32 n_elem)
+  {
+  typedef typename get_pod_type<eT>::result T;
+  
+  T max_val = std::abs(src[0]);
+  
+  u32 i,j;
+  
+  for(i=1, j=2; j<n_elem; i+=2, j+=2)
+    {
+    const T tmp_i = std::abs(src[i]);
+    const T tmp_j = std::abs(src[j]);
+    
+    if(max_val < tmp_i) { max_val = tmp_i; }
+    if(max_val < tmp_j) { max_val = tmp_j; }
+    }
+  
+  if(i < n_elem)
+    {
+    const T tmp_i = std::abs(src[i]);
+    
+    if(max_val < tmp_i) { max_val = tmp_i; }
+    }
+  
+  return max_val;
+  }
+
+
+
+template<typename eT>
+arma_hot
+arma_pure
+inline
+typename get_pod_type<eT>::result
+arrayops::norm_min(const eT* src, const u32 n_elem)
+  {
+  typedef typename get_pod_type<eT>::result T;
+  
+  T min_val = std::abs(src[0]);
+  
+  u32 i,j;
+  
+  for(i=1, j=2; j<n_elem; i+=2, j+=2)
+    {
+    const T tmp_i = std::abs(src[i]);
+    const T tmp_j = std::abs(src[j]);
+    
+    if(min_val > tmp_i) { min_val = tmp_i; }
+    if(min_val > tmp_j) { min_val = tmp_j; }
+    }
+  
+  if(i < n_elem)
+    {
+    const T tmp_i = std::abs(src[i]);
+    
+    if(min_val > tmp_i) { min_val = tmp_i; }
+    }
+  
+  return min_val;
+  }
+
+
+
+//! @}

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_proto.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_proto.hpp	2011-02-14 12:55:20 UTC (rev 2900)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arrayops_proto.hpp	2011-02-16 02:34:10 UTC (rev 2901)
@@ -1,5 +1,5 @@
-// Copyright (C) 2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2010 Conrad Sanderson
+// Copyright (C) 2011 NICTA (www.nicta.com.au)
+// Copyright (C) 2011 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -20,437 +20,129 @@
   public:
   
   template<typename eT>
-  arma_hot
-  inline
-  static
-  void
-  inplace_plus(eT* dest, const eT* src, const u32 n_elem)
-    {
-    u32 i,j;
-    
-    for(i=0, j=1; j<n_elem; i+=2, j+=2)
-      {
-      dest[i] += src[i];
-      dest[j] += src[j];
-      }
-    
-    if(i < n_elem)
-      {
-      dest[i] += src[i];
-      }
-    }
+  arma_hot inline static void
+  copy(eT* dest, const eT* src, const u32 n_elem);
   
   
+  // 
+  // array = convert(array)
   
-  template<typename eT>
-  arma_hot
-  inline
-  static
-  void
-  inplace_minus(eT* dest, const eT* src, const u32 n_elem)
-    {
-    u32 i,j;
-    
-    for(i=0, j=1; j<n_elem; i+=2, j+=2)
-      {
-      dest[i] -= src[i];
-      dest[j] -= src[j];
-      }
-    
-    if(i < n_elem)
-      {
-      dest[i] -= src[i];
-      }
-    }
+  template<typename out_eT, typename in_eT>
+  arma_hot arma_inline static void
+  convert_cx_scalar(out_eT& out, const in_eT&  in, const typename arma_not_cx<out_eT>::result* junk1 = 0, const typename arma_not_cx< in_eT>::result* junk2 = 0);
   
+  template<typename out_eT, typename in_T>
+  arma_hot arma_inline static void
+  convert_cx_scalar(out_eT& out, const std::complex<in_T>& in, const typename arma_not_cx<out_eT>::result* junk = 0);
   
+  template<typename out_T, typename in_T>
+  arma_hot arma_inline static void
+  convert_cx_scalar(std::complex<out_T>& out, const std::complex< in_T>& in);
   
-  template<typename eT>
-  arma_hot
-  inline
-  static
-  void
-  inplace_mul(eT* dest, const eT* src, const u32 n_elem)
-    {
-    u32 i,j;
-    
-    for(i=0, j=1; j<n_elem; i+=2, j+=2)
-      {
-      dest[i] *= src[i];
-      dest[j] *= src[j];
-      }
-    
-    if(i < n_elem)
-      {
-      dest[i] *= src[i];
-      }
-    }
+  template<typename out_eT, typename in_eT>
+  arma_hot inline static void
+  convert(out_eT* dest, const in_eT* src, const u32 n_elem);
   
+  template<typename out_eT, typename in_eT>
+  arma_hot inline static void
+  convert_cx(out_eT* dest, const in_eT* src, const u32 n_elem);
   
   
+  // 
+  // array op= array
+  
   template<typename eT>
-  arma_hot
-  inline
-  static
+  arma_hot inline static
   void
-  inplace_div(eT* dest, const eT* src, const u32 n_elem)
-    {
-    u32 i,j;
-    
-    for(i=0, j=1; j<n_elem; i+=2, j+=2)
-      {
-      dest[i] /= src[i];
-      dest[j] /= src[j];
-      }
-    
-    if(i < n_elem)
-      {
-      dest[i] /= src[i];
-      }
-    }
+  inplace_plus(eT* dest, const eT* src, const u32 n_elem);
   
+  template<typename eT>
+  arma_hot inline static
+  void
+  inplace_minus(eT* dest, const eT* src, const u32 n_elem);
   
-  
   template<typename eT>
-  arma_hot
-  inline
-  static
+  arma_hot inline static
   void
-  inplace_set(eT* dest, const eT val, const u32 n_elem)
-    {
-    u32 i,j;
-    
-    for(i=0, j=1; j<n_elem; i+=2, j+=2)
-      {
-      dest[i] = val;
-      dest[j] = val;
-      }
-    
-    if(i < n_elem)
-      {
-      dest[i] = val;
-      }
-    }
+  inplace_mul(eT* dest, const eT* src, const u32 n_elem);
+   
+  template<typename eT>
+  arma_hot inline static
+  void
+  inplace_div(eT* dest, const eT* src, const u32 n_elem);
   
   
+  // 
+  // array op= scalar
   
   template<typename eT>
-  arma_hot
-  inline
-  static
+  arma_hot inline static
   void
-  inplace_plus(eT* dest, const eT val, const u32 n_elem)
-    {
-    u32 i,j;
-    
-    for(i=0, j=1; j<n_elem; i+=2, j+=2)
-      {
-      dest[i] += val;
-      dest[j] += val;
-      }
-    
-    if(i < n_elem)
-      {
-      dest[i] += val;
-      }
-    }
+  inplace_set(eT* dest, const eT val, const u32 n_elem);
   
-  
-
   template<typename eT>
-  arma_hot
-  inline
-  static
+  arma_hot inline static
   void
-  inplace_minus(eT* dest, const eT val, const u32 n_elem)
-    {
-    u32 i,j;
-    
-    for(i=0, j=1; j<n_elem; i+=2, j+=2)
-      {
-      dest[i] -= val;
-      dest[j] -= val;
-      }
-    
-    if(i < n_elem)
-      {
-      dest[i] -= val;
-      }
-    }
+  inplace_plus(eT* dest, const eT val, const u32 n_elem);
   
-  
-
   template<typename eT>
-  arma_hot
-  inline
-  static
+  arma_hot inline static
   void
-  inplace_mul(eT* dest, const eT val, const u32 n_elem)
-    {
-    u32 i,j;
-    
-    for(i=0, j=1; j<n_elem; i+=2, j+=2)
-      {
-      dest[i] *= val;
-      dest[j] *= val;
-      }
-    
-    if(i < n_elem)
-      {
-      dest[i] *= val;
-      }
-    }
+  inplace_minus(eT* dest, const eT val, const u32 n_elem);
   
+  template<typename eT>
+  arma_hot inline static void
+  inplace_mul(eT* dest, const eT val, const u32 n_elem);
   
-
   template<typename eT>
-  arma_hot
-  inline
-  static
+  arma_hot inline static
   void
-  inplace_div(eT* dest, const eT val, const u32 n_elem)
-    {
-    u32 i,j;
-    
-    for(i=0, j=1; j<n_elem; i+=2, j+=2)
-      {
-      dest[i] /= val;
-      dest[j] /= val;
-      }
-    
-    if(i < n_elem)
-      {
[TRUNCATED]

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


More information about the Rcpp-commits mailing list