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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 2 02:01:23 CEST 2011


Author: edd
Date: 2011-09-02 02:01:23 +0200 (Fri, 02 Sep 2011)
New Revision: 3189

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_as_scalar.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_svd.hpp
Log:
Release 0.2.29 with Armadillo 2.2.3


Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2011-08-31 20:44:37 UTC (rev 3188)
+++ pkg/RcppArmadillo/ChangeLog	2011-09-02 00:01:23 UTC (rev 3189)
@@ -1,3 +1,9 @@
+2011-09-01  Dirk Eddelbuettel  <edd at debian.org>
+
+	* DESCRIPTION: Release 0.2.29
+
+	* inst/include/*: Updated to bug-fix release 2.2.3 of Armadillo
+
 2011-08-02  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Release 0.2.28

Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION	2011-08-31 20:44:37 UTC (rev 3188)
+++ pkg/RcppArmadillo/DESCRIPTION	2011-09-02 00:01:23 UTC (rev 3189)
@@ -1,7 +1,7 @@
 Package: RcppArmadillo
 Type: Package
 Title: Rcpp integration for Armadillo templated linear algebra library
-Version: 0.2.28
+Version: 0.2.29
 Date: $Date$
 Author: Romain Francois, Dirk Eddelbuettel and Doug Bates
 Maintainer: Romain Francois, Dirk Eddelbuettel and Doug Bates <RcppArmadillo-authors at r-enthusiasts.com>

Modified: pkg/RcppArmadillo/inst/NEWS
===================================================================
--- pkg/RcppArmadillo/inst/NEWS	2011-08-31 20:44:37 UTC (rev 3188)
+++ pkg/RcppArmadillo/inst/NEWS	2011-09-02 00:01:23 UTC (rev 3189)
@@ -1,3 +1,9 @@
+0.2.29  2011-09-01
+
+    o   Upgraded to Armadillo release 2.2.3
+
+          * Release fixes a speed issue in the as_scalar() function.
+
 0.2.28  2011-08-02
 
     o   Upgraded to Armadillo release 2.2.1 "Blue Skies Debauchery"

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2011-08-31 20:44:37 UTC (rev 3188)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2011-09-02 00:01:23 UTC (rev 3189)
@@ -18,7 +18,7 @@
 
 #define ARMA_VERSION_MAJOR 2
 #define ARMA_VERSION_MINOR 2
-#define ARMA_VERSION_PATCH 1
+#define ARMA_VERSION_PATCH 3
 #define ARMA_VERSION_NAME  "Blue Skies Debauchery"
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_as_scalar.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_as_scalar.hpp	2011-08-31 20:44:37 UTC (rev 3188)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_as_scalar.hpp	2011-09-02 00:01:23 UTC (rev 3189)
@@ -116,71 +116,24 @@
   const bool tmp2_do_inv     = strip1.do_inv;
   const bool tmp2_do_diagmat = strip2.do_diagmat;
   
-  const partial_unwrap<T1>            tmp1(X.A.A);
-  const partial_unwrap<T2_stripped_2> tmp2(strip2.M);
-  const partial_unwrap<T3>            tmp3(X.B);
-  
-  const Mat<eT>& A = tmp1.M;
-  const Mat<eT>& B = tmp2.M;
-  const Mat<eT>& C = tmp3.M;
-  
-  
   if(tmp2_do_diagmat == false)
     {
-    const u32 A_n_rows = (tmp1.do_trans == false) ? A.n_rows : A.n_cols;
-    const u32 A_n_cols = (tmp1.do_trans == false) ? A.n_cols : A.n_rows;
+    const Mat<eT> tmp(X);
     
-    const u32 B_n_rows = (tmp2.do_trans == false) ? B.n_rows : B.n_cols;
-    const u32 B_n_cols = (tmp2.do_trans == false) ? B.n_cols : B.n_rows;
+    arma_debug_check( (tmp.n_elem != 1), "as_scalar(): expression doesn't evaluate to exactly one element" );
     
-    const u32 C_n_rows = (tmp3.do_trans == false) ? C.n_rows : C.n_cols;
-    const u32 C_n_cols = (tmp3.do_trans == false) ? C.n_cols : C.n_rows;
-    
-    const eT val = tmp1.get_val() * tmp2.get_val() * tmp3.get_val();
-    
-    arma_debug_check
-      (
-      (A_n_rows != 1)        ||
-      (C_n_cols != 1)        ||
-      (A_n_cols != B_n_rows) ||
-      (B_n_cols != C_n_rows)
-      ,
-      "as_scalar(): incompatible dimensions"
-      );
-    
-    
-    if(tmp2_do_inv == true)
-      {
-      arma_debug_check( (B.is_square() == false), "as_scalar(): incompatible dimensions" );
-      
-      Mat<eT> B_inv;
-      
-      if(tmp2.do_trans == false)
-        {
-        op_inv::apply(B_inv, B);
-        }
-      else
-        {
-        const Mat<eT> B_trans = trans(B);
-        op_inv::apply(B_inv, B_trans);
-        }
-      
-      return val * op_dotext::direct_rowvec_mat_colvec(A.mem, B_inv, C.mem);
-      }
-    else
-      {
-      if(tmp2.do_trans == false)
-        {
-        return val * op_dotext::direct_rowvec_mat_colvec(A.mem, B, C.mem);
-        }
-      else
-        {
-        return val * op_dotext::direct_rowvec_transmat_colvec(A.mem, B, C.mem);
-        }
-      }
+    return tmp[0];
     }
   else
     {
+    const partial_unwrap<T1>            tmp1(X.A.A);
+    const partial_unwrap<T2_stripped_2> tmp2(strip2.M);
+    const partial_unwrap<T3>            tmp3(X.B);
+    
+    const Mat<eT>& A = tmp1.M;
+    const Mat<eT>& B = tmp2.M;
+    const Mat<eT>& C = tmp3.M;
+    
     const u32 A_n_rows = (tmp1.do_trans == false) ? A.n_rows : A.n_cols;
     const u32 A_n_cols = (tmp1.do_trans == false) ? A.n_cols : A.n_rows;
     

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_svd.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_svd.hpp	2011-08-31 20:44:37 UTC (rev 3188)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_svd.hpp	2011-09-02 00:01:23 UTC (rev 3189)
@@ -113,7 +113,7 @@
 template<typename T1>
 inline
 bool
-svd_thin
+svd_econ
   (
          Mat<typename T1::elem_type>&    U,
          Col<typename T1::pod_type >&    S,
@@ -131,13 +131,13 @@
   arma_debug_check
     (
     ( ((void*)(&U) == (void*)(&S)) || (&U == &V) || ((void*)(&S) == (void*)(&V)) ),
-    "svd_thin(): two or more output objects are the same object"
+    "svd_econ(): two or more output objects are the same object"
     );
   
   arma_debug_check
     (
     ( (mode != 'l') && (mode != 'r') && (mode != 'b') ),
-    "svd_thin(): parameter 'mode' is incorrect"
+    "svd_econ(): parameter 'mode' is incorrect"
     );
   
   
@@ -149,7 +149,7 @@
     U.reset();
     S.reset();
     V.reset();
-    arma_bad("svd_thin(): failed to converge", false);
+    arma_bad("svd_econ(): failed to converge", false);
     }
   
   return status;
@@ -157,4 +157,24 @@
 
 
 
+template<typename T1>
+inline
+bool
+svd_thin
+  (
+         Mat<typename T1::elem_type>&    U,
+         Col<typename T1::pod_type >&    S,
+         Mat<typename T1::elem_type>&    V,
+  const Base<typename T1::elem_type,T1>& X,
+  const char                             mode = 'b',
+  const typename arma_blas_type_only<typename T1::elem_type>::result* junk = 0
+  )
+  {
+  arma_ignore(junk);
+  
+  return svd_econ(U,S,V,X,mode);
+  }
+
+
+
 //! @}



More information about the Rcpp-commits mailing list