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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 29 14:59:45 CEST 2011


Author: edd
Date: 2011-06-29 14:59:45 +0200 (Wed, 29 Jun 2011)
New Revision: 3110

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/fn_misc.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_princomp.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/subview_meat.hpp
Log:
Release 0.2.24 containing Armadillo 2.0.0


Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2011-06-28 16:36:40 UTC (rev 3109)
+++ pkg/RcppArmadillo/ChangeLog	2011-06-29 12:59:45 UTC (rev 3110)
@@ -1,3 +1,9 @@
+2011-06-29  Dirk Eddelbuettel  <edd at debian.org>
+
+	* DESCRIPTION: Release 0.2.24
+
+	* inst/include/*: Updated to release 2.0.0 of Armadillo
+
 2011-06-23  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Release 0.2.23

Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION	2011-06-28 16:36:40 UTC (rev 3109)
+++ pkg/RcppArmadillo/DESCRIPTION	2011-06-29 12:59:45 UTC (rev 3110)
@@ -1,7 +1,7 @@
 Package: RcppArmadillo
 Type: Package
 Title: Rcpp integration for Armadillo templated linear algebra library
-Version: 0.2.23
+Version: 0.2.24
 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.99.5). Thus users do not need to
+ Armadillo library (currently version 2.0.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-06-28 16:36:40 UTC (rev 3109)
+++ pkg/RcppArmadillo/inst/NEWS	2011-06-29 12:59:45 UTC (rev 3110)
@@ -1,5 +1,35 @@
-0.2.23  2011-05-23
+0.2.24  2011-06-29
 
+    o   Upgraded to Armadillo release 2.0.0 "Carnivorous Sugar Glider"
+
+          * faster multiplication of tiny matrices (≤ 4x4)
+	  * faster compound expressions containing submatrices
+	  * faster inverse of symmetric positive definite matrices
+	  * faster element access for fixed size matrices
+	  * added handling of arbitrarily sized empty matrices (eg. 5x0)
+	  * added loading & saving of matrices as CSV text files
+	  * added .count() member function to running_stat and
+	    running_stat_vec 
+	  * added syl(), strans(), symmatu()/symmatl()
+	  * added submatrices of submatrices
+	  * det(), inv() and solve() can be forced to use more precise
+	  * algorithms for tiny matrices (≤ 4x4)
+	  * htrans() has been deprecated; use trans() instead
+	  * API change: trans() now takes the complex conjugate when
+	    transposing a complex matrix 
+	  * API change: .is_vec() now outputs true for empty vectors
+	    (eg. 0x1) 
+	  * API change: forms of chol(), eig_sym(), eig_gen(), inv(), 
+            lu(), pinv(), princomp(), qr(), solve(), svd(), syl() that do not
+	    return a bool indicating success now throw std::runtime_error
+	    exceptions when failures are detected 
+	  * API change: princomp_cov() has been removed; princomp() in 
+            conjunction with cov() can be used instead
+	  * API change: set_log_stream() & get_log_stream() have been 
+            replaced by set_stream_err1() & get_stream_err1()
+
+0.2.23  2011-06-23
+
     o   Upgraded to Armadillo release 1.99.5 "v2.0 beta 5"
 
           * Forms of chol(), eig_sym(), eig_gen(), inv(), lu(), pinv(),

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2011-06-28 16:36:40 UTC (rev 3109)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2011-06-29 12:59:45 UTC (rev 3110)
@@ -16,13 +16,13 @@
 
 
 
-#define ARMA_VERSION_MAJOR 1
-#define ARMA_VERSION_MINOR 99
-#define ARMA_VERSION_PATCH 5
-#define ARMA_VERSION_NAME  "v2.0 beta 5"
+#define ARMA_VERSION_MAJOR 2
+#define ARMA_VERSION_MINOR 0
+#define ARMA_VERSION_PATCH 0
+#define ARMA_VERSION_NAME  "Carnivorous Sugar Glider"
+// http://en.wikipedia.org/wiki/Sugar_glider
 
 
-
 struct arma_version
   {
   static const unsigned int major = ARMA_VERSION_MAJOR;

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_misc.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_misc.hpp	2011-06-28 16:36:40 UTC (rev 3109)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_misc.hpp	2011-06-29 12:59:45 UTC (rev 3110)
@@ -27,48 +27,56 @@
   (
   const typename vec_type::pod_type start,
   const typename vec_type::pod_type end,
-  const u32 num,
+  const u32 num = 100u,
   const typename arma_Mat_Col_Row_only<vec_type>::result* junk = 0
   )
   {
   arma_extra_debug_sigprint();
-  
   arma_ignore(junk);
   
-  arma_debug_check( (num < 2), "linspace(): num must be >= 2");
-  
   typedef typename vec_type::elem_type eT;
   typedef typename vec_type::pod_type   T;
   
-  const u32 n_rows = (is_Row<vec_type>::value == true) ? 1   : num;
-  const u32 n_cols = (is_Row<vec_type>::value == true) ? num : 1;
-  
-  Mat<eT> x(n_rows, n_cols);
-  eT* x_mem = x.memptr();
-  
-  const u32 num_m1 = num - 1;
-  
-  if(is_non_integral<T>::value == true)
+  vec_type x;
+    
+  if(num >= 2)
     {
-    const T delta = (end-start)/T(num_m1);
+    x.set_size(num);
     
-    for(u32 i=0; i<num_m1; ++i)
+    eT* x_mem = x.memptr();
+    
+    const u32 num_m1 = num - 1;
+    
+    if(is_non_integral<T>::value == true)
       {
-      x_mem[i] = eT(start + i*delta);
+      const T delta = (end-start)/T(num_m1);
+      
+      for(u32 i=0; i<num_m1; ++i)
+        {
+        x_mem[i] = eT(start + i*delta);
+        }
+      
+      x_mem[num_m1] = eT(end);
       }
+    else
+      {
+      const double delta = (end >= start) ? double(end-start)/double(num_m1) : -double(start-end)/double(num_m1);
+      
+      for(u32 i=0; i<num_m1; ++i)
+        {
+        x_mem[i] = eT(double(start) + i*delta);
+        }
+      
+      x_mem[num_m1] = eT(end);
+      }
     
-    x_mem[num_m1] = eT(end);
+    return x;
     }
   else
     {
-    const double delta = (end >= start) ? double(end-start)/double(num_m1) : -double(start-end)/double(num_m1);
+    x.set_size(1);
     
-    for(u32 i=0; i<num_m1; ++i)
-      {
-      x_mem[i] = eT(double(start) + i*delta);
-      }
-    
-    x_mem[num_m1] = eT(end);
+    x[0] = eT(end);
     }
   
   return x;
@@ -78,7 +86,7 @@
 
 inline
 mat
-linspace(const double start, const double end, const u32 num)
+linspace(const double start, const double end, const u32 num = 100u)
   {
   arma_extra_debug_sigprint();
   return linspace<mat>(start, end, num);

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_princomp.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_princomp.hpp	2011-06-28 16:36:40 UTC (rev 3109)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_princomp.hpp	2011-06-29 12:59:45 UTC (rev 3110)
@@ -142,6 +142,37 @@
 //! coeff_out    -> principal component coefficients
 template<typename T1>
 inline
+bool
+princomp
+  (
+         Mat<typename T1::elem_type>&    coeff_out,
+  const Base<typename T1::elem_type,T1>& X,
+  const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0
+  )
+  {
+  arma_extra_debug_sigprint();
+  
+  typedef typename T1::elem_type eT;
+  
+  const unwrap<T1>   tmp(X.get_ref());
+  const Mat<eT>& A = tmp.M;
+  
+  const bool status = op_princomp::direct_princomp(coeff_out, A);
+  
+  if(status == false)
+    {
+    coeff_out.reset();
+    
+    arma_bad("princomp(): failed to converge", false);
+    }
+  
+  return status;
+  }
+
+
+
+template<typename T1>
+inline
 const Op<T1, op_princomp>
 princomp
   (

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/subview_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/subview_meat.hpp	2011-06-28 16:36:40 UTC (rev 3109)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/subview_meat.hpp	2011-06-29 12:59:45 UTC (rev 3110)
@@ -1347,7 +1347,7 @@
 bool
 subview<eT>::is_vec() const
   {
-  return ( (n_rows <= 1) || (n_cols <= 1) );
+  return ( (n_rows == 1) || (n_cols == 1) );
   }
 
 



More information about the Rcpp-commits mailing list