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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon May 21 14:29:28 CEST 2012


Author: edd
Date: 2012-05-21 14:29:28 +0200 (Mon, 21 May 2012)
New Revision: 3610

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_accu.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_cumsum.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_max.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_mean.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_median.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_min.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_prod.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_stddev.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_strans.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_sum.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_trans.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_var.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/op_sum_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/op_sum_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/podarray_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/podarray_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/traits.hpp
Log:
RcppArmadillo 0.3.2.0 with Armadillo 3.2.0


Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/ChangeLog	2012-05-21 12:29:28 UTC (rev 3610)
@@ -1,3 +1,9 @@
+2012-05-21  Dirk Eddelbuettel  <edd at debian.org>
+
+	* DESCRIPTION: Release 0.3.2.0
+
+	* inst/include/*: Upgraded to new release 3.2.0 of Armadillo
+
 2012-05-15  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Release 0.3.1.94

Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/DESCRIPTION	2012-05-21 12:29:28 UTC (rev 3610)
@@ -1,7 +1,7 @@
 Package: RcppArmadillo
 Type: Package
 Title: Rcpp integration for Armadillo templated linear algebra library
-Version: 0.3.1.94
+Version: 0.3.2.0
 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 3.1.94). Thus users do not need to
+ Armadillo library (currently version 3.2.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	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/inst/NEWS	2012-05-21 12:29:28 UTC (rev 3610)
@@ -1,3 +1,13 @@
+0.3.2.0  2012-05-21
+
+    o   Upgraded to Armadillo release 3.2.0 "Creamfields"
+
+    	  * faster eigen decomposition via "divide and conquer" algorithm
+    	  * faster transpose of vectors and compound expressions
+    	  * faster handling of diagonal views
+    	  * faster handling of tiny fixed size vectors (≤ 4 elements)
+    	  * added unique(), for finding unique elements of a matrix
+
 0.3.1.94  2012-05-15
 
     o   Upgraded to Armadillo release 3.1.94 "v3.2 beta 2"

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2012-05-21 12:29:28 UTC (rev 3610)
@@ -17,9 +17,9 @@
 
 
 #define ARMA_VERSION_MAJOR 3
-#define ARMA_VERSION_MINOR 1
-#define ARMA_VERSION_PATCH 94
-#define ARMA_VERSION_NAME  "v3.2 beta 4"
+#define ARMA_VERSION_MINOR 2
+#define ARMA_VERSION_PATCH 0
+#define ARMA_VERSION_NAME  "Creamfields"
 
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_accu.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_accu.hpp	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_accu.hpp	2012-05-21 12:29:28 UTC (rev 3610)
@@ -40,7 +40,7 @@
   
   if(i < n_elem)
     {
-    val1 += A[i];
+    val1 += A[i];   // equivalent to: val1 += A[n_elem-1];
     }
   
   return (val1 + val2);
@@ -86,12 +86,12 @@
 template<typename T1>
 arma_hot
 inline
-typename T1::elem_type
-accu(const Base<typename T1::elem_type,T1>& X)
+typename enable_if2< is_arma_type<T1>::value, typename T1::elem_type >::result
+accu(const T1& X)
   {
   arma_extra_debug_sigprint();
   
-  const Proxy<T1> P(X.get_ref());
+  const Proxy<T1> P(X);
   
   return (Proxy<T1>::prefer_at_accessor == false) ? accu_proxy_linear(P) : accu_proxy_at(P);
   }
@@ -156,6 +156,7 @@
 
 //! accumulate the elements of a subview (submatrix)
 template<typename eT>
+arma_hot
 arma_pure
 arma_warn_unused
 inline
@@ -209,6 +210,7 @@
 
 
 template<typename eT>
+arma_hot
 arma_pure
 arma_warn_unused
 inline

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_cumsum.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_cumsum.hpp	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_cumsum.hpp	2012-05-21 12:29:28 UTC (rev 3610)
@@ -21,17 +21,17 @@
 const Op<T1, op_cumsum_mat>
 cumsum
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword dim = 0,
-  const typename enable_if<resolves_to_vector<T1>::value == false>::result* junk1 = 0,
-  const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = 0
+  const typename enable_if< is_arma_type<T1>::value       == true  >::result* junk1 = 0,
+  const typename enable_if< resolves_to_vector<T1>::value == false >::result* junk2 = 0
   )
   {
   arma_extra_debug_sigprint();
   arma_ignore(junk1);
   arma_ignore(junk2);
   
-  return Op<T1, op_cumsum_mat>(X.get_ref(), dim, 0);
+  return Op<T1, op_cumsum_mat>(X, dim, 0);
   }
 
 
@@ -41,7 +41,7 @@
 const Op<T1, op_cumsum_mat>
 cumsum
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword dim,
   const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
   )
@@ -49,7 +49,7 @@
   arma_extra_debug_sigprint();
   arma_ignore(junk);
   
-  return Op<T1, op_cumsum_mat>(X.get_ref(), dim, 0);
+  return Op<T1, op_cumsum_mat>(X, dim, 0);
   }
 
 
@@ -59,7 +59,7 @@
 const Op<T1, op_cumsum_vec>
 cumsum
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const arma_empty_class junk1 = arma_empty_class(),
   const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
   )
@@ -68,26 +68,44 @@
   arma_ignore(junk1);
   arma_ignore(junk2);
   
-  return Op<T1, op_cumsum_vec>(X.get_ref());
+  return Op<T1, op_cumsum_vec>(X);
   }
 
 
 
 template<typename T1>
 arma_inline
-const Op<T1, op_cumsum_vec>
+const Op<Op<T1, op_cumsum_vec>, op_cumsum_mat>
 cumsum
   (
-  const T1& X,
+  const Op<T1, op_cumsum_vec>& X,
+  const uword dim,
+  const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
+  )
+  {
+  arma_extra_debug_sigprint();
+  arma_ignore(junk);
+  
+  return Op<Op<T1, op_cumsum_vec>, op_cumsum_mat>(X, dim, 0);
+  }
+
+
+
+template<typename T1>
+arma_inline
+const Op<Op<T1, op_cumsum_vec>, op_cumsum_vec>
+cumsum
+  (
+  const Op<T1, op_cumsum_vec>& X,
   const arma_empty_class junk1 = arma_empty_class(),
-  const typename enable_if<is_basevec<T1>::value == true>::result* junk2 = 0
+  const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
   )
   {
   arma_extra_debug_sigprint();
   arma_ignore(junk1);
   arma_ignore(junk2);
   
-  return Op<T1, op_cumsum_vec>(X);
+  return Op<Op<T1, op_cumsum_vec>, op_cumsum_vec>(X);
   }
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_max.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_max.hpp	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_max.hpp	2012-05-21 12:29:28 UTC (rev 3610)
@@ -27,17 +27,17 @@
 const Op<T1, op_max>
 max
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword dim = 0,
-  const typename enable_if<resolves_to_vector<T1>::value == false>::result* junk1 = 0,
-  const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = 0
+  const typename enable_if< is_arma_type<T1>::value       == true  >::result* junk1 = 0,
+  const typename enable_if< resolves_to_vector<T1>::value == false >::result* junk2 = 0
   )
   {
   arma_extra_debug_sigprint();
   arma_ignore(junk1);
   arma_ignore(junk2);
   
-  return Op<T1, op_max>(X.get_ref(), dim, 0);
+  return Op<T1, op_max>(X, dim, 0);
   }
 
 
@@ -47,7 +47,7 @@
 const Op<T1, op_max>
 max
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword dim,
   const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
   )
@@ -55,47 +55,18 @@
   arma_extra_debug_sigprint();
   arma_ignore(junk);
   
-  return Op<T1, op_max>(X.get_ref(), dim, 0);
+  return Op<T1, op_max>(X, dim, 0);
   }
 
 
 
-//! \brief
-//! Immediate 'find maximum value' operation,
-//! invoked, for example, by: max(max(A))
 template<typename T1>
 inline
 arma_warn_unused
 typename T1::elem_type
-max(const Op<T1, op_max>& in)
-  {
-  arma_extra_debug_sigprint();
-  arma_extra_debug_print("max(): two consecutive max() calls detected");
-  
-  return op_max::max(in.m);
-  }
-
-
-
-template<typename T1>
-arma_inline
-const Op< Op<T1, op_max>, op_max>
-max(const Op<T1, op_max>& in, const uword dim)
-  {
-  arma_extra_debug_sigprint();
-  
-  return Op< Op<T1, op_max>, op_max>(in, dim, 0);
-  }
-
-
-
-template<typename T1>
-inline
-arma_warn_unused
-typename T1::elem_type
 max
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const arma_empty_class junk1 = arma_empty_class(),
   const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
   )
@@ -109,26 +80,35 @@
 
 
 
+//! \brief
+//! Immediate 'find maximum value' operation,
+//! invoked, for example, by: max(max(A))
 template<typename T1>
 inline
 arma_warn_unused
 typename T1::elem_type
-max
-  (
-  const T1& X,
-  const arma_empty_class junk1 = arma_empty_class(),
-  const typename enable_if<is_basevec<T1>::value == true>::result* junk2 = 0
-  )
+max(const Op<T1, op_max>& in)
   {
   arma_extra_debug_sigprint();
-  arma_ignore(junk1);
-  arma_ignore(junk2);
+  arma_extra_debug_print("max(): two consecutive max() calls detected");
   
-  return op_max::max(X);
+  return op_max::max(in.m);
   }
 
 
 
+template<typename T1>
+arma_inline
+const Op< Op<T1, op_max>, op_max>
+max(const Op<T1, op_max>& in, const uword dim)
+  {
+  arma_extra_debug_sigprint();
+  
+  return Op< Op<T1, op_max>, op_max>(in, dim, 0);
+  }
+
+
+
 template<typename T>
 arma_inline
 arma_warn_unused

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_mean.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_mean.hpp	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_mean.hpp	2012-05-21 12:29:28 UTC (rev 3610)
@@ -21,17 +21,17 @@
 const Op<T1, op_mean>
 mean
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword dim = 0,
-  const typename enable_if<resolves_to_vector<T1>::value == false>::result* junk1 = 0,
-  const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = 0
+  const typename enable_if< is_arma_type<T1>::value       == true  >::result* junk1 = 0,
+  const typename enable_if< resolves_to_vector<T1>::value == false >::result* junk2 = 0
   )
   {
   arma_extra_debug_sigprint();
   arma_ignore(junk1);
   arma_ignore(junk2);
   
-  return Op<T1, op_mean>(X.get_ref(), dim, 0);
+  return Op<T1, op_mean>(X, dim, 0);
   }
 
 
@@ -41,7 +41,7 @@
 const Op<T1, op_mean>
 mean
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword dim,
   const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
   )
@@ -49,11 +49,31 @@
   arma_extra_debug_sigprint();
   arma_ignore(junk);
   
-  return Op<T1, op_mean>(X.get_ref(), dim, 0);
+  return Op<T1, op_mean>(X, dim, 0);
   }
 
 
 
+template<typename T1>
+inline
+arma_warn_unused
+typename T1::elem_type
+mean
+  (
+  const T1& X,
+  const arma_empty_class junk1 = arma_empty_class(),
+  const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
+  )
+  {
+  arma_extra_debug_sigprint();
+  arma_ignore(junk1);
+  arma_ignore(junk2);
+  
+  return op_mean::mean_all(X);
+  }
+
+
+
 //! \brief
 //! Immediate 'find mean value' operation,
 //! invoked, for example, by: mean(mean(A))
@@ -85,46 +105,6 @@
 
 
 
-template<typename T1>
-inline
-arma_warn_unused
-typename T1::elem_type
-mean
-  (
-  const Base<typename T1::elem_type,T1>& X,
-  const arma_empty_class junk1 = arma_empty_class(),
-  const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
-  )
-  {
-  arma_extra_debug_sigprint();
-  arma_ignore(junk1);
-  arma_ignore(junk2);
-  
-  return op_mean::mean_all(X);
-  }
-
-
-
-template<typename T1>
-inline
-arma_warn_unused
-typename T1::elem_type
-mean
-  (
-  const T1& X,
-  const arma_empty_class junk1 = arma_empty_class(),
-  const typename enable_if<is_basevec<T1>::value == true>::result* junk2 = 0
-  )
-  {
-  arma_extra_debug_sigprint();
-  arma_ignore(junk1);
-  arma_ignore(junk2);
-  
-  return op_mean::mean_all(X);
-  }
-
-
-
 template<typename T>
 arma_inline
 arma_warn_unused

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_median.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_median.hpp	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_median.hpp	2012-05-21 12:29:28 UTC (rev 3610)
@@ -20,17 +20,17 @@
 const Op<T1, op_median>
 median
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword dim = 0,
-  const typename enable_if<resolves_to_vector<T1>::value == false>::result* junk1 = 0,
-  const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = 0
+  const typename enable_if< is_arma_type<T1>::value       == true  >::result* junk1 = 0,
+  const typename enable_if< resolves_to_vector<T1>::value == false >::result* junk2 = 0
   )
   {
   arma_extra_debug_sigprint();
   arma_ignore(junk1);
   arma_ignore(junk2);
   
-  return Op<T1, op_median>(X.get_ref(), dim, 0);
+  return Op<T1, op_median>(X, dim, 0);
   }
 
 
@@ -40,7 +40,7 @@
 const Op<T1, op_median>
 median
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword dim,
   const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
   )
@@ -48,7 +48,7 @@
   arma_extra_debug_sigprint();
   arma_ignore(junk);
   
-  return Op<T1, op_median>(X.get_ref(), dim, 0);
+  return Op<T1, op_median>(X, dim, 0);
   }
 
 
@@ -59,7 +59,7 @@
 typename T1::elem_type
 median
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const arma_empty_class junk1 = arma_empty_class(),
   const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
   )
@@ -68,26 +68,6 @@
   arma_ignore(junk1);
   arma_ignore(junk2);
   
-  return op_median::median_vec(X.get_ref());
-  }
-
-
-
-template<typename T1>
-inline
-arma_warn_unused
-typename T1::elem_type
-median
-  (
-  const T1& X,
-  const arma_empty_class junk1 = arma_empty_class(),
-  const typename enable_if<is_basevec<T1>::value == true>::result* junk2 = 0
-  )
-  {
-  arma_extra_debug_sigprint();
-  arma_ignore(junk1);
-  arma_ignore(junk2);
-  
   return op_median::median_vec(X);
   }
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_min.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_min.hpp	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_min.hpp	2012-05-21 12:29:28 UTC (rev 3610)
@@ -26,17 +26,17 @@
 const Op<T1, op_min>
 min
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword dim = 0,
-  const typename enable_if<resolves_to_vector<T1>::value == false>::result* junk1 = 0,
-  const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = 0
+  const typename enable_if< is_arma_type<T1>::value       == true  >::result* junk1 = 0,
+  const typename enable_if< resolves_to_vector<T1>::value == false >::result* junk2 = 0
   )
   {
   arma_extra_debug_sigprint();
   arma_ignore(junk1);
   arma_ignore(junk2);
   
-  return Op<T1, op_min>(X.get_ref(), dim, 0);
+  return Op<T1, op_min>(X, dim, 0);
   }
 
 
@@ -45,7 +45,7 @@
 const Op<T1, op_min>
 min
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword dim,
   const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
   )
@@ -53,47 +53,18 @@
   arma_extra_debug_sigprint();
   arma_ignore(junk);
   
-  return Op<T1, op_min>(X.get_ref(), dim, 0);
+  return Op<T1, op_min>(X, dim, 0);
   }
 
 
 
-//! \brief
-//! Immediate 'find minimum value' operation,
-//! invoked, for example, by: min(min(A))
 template<typename T1>
 inline
 arma_warn_unused
 typename T1::elem_type
-min(const Op<T1, op_min>& in)
-  {
-  arma_extra_debug_sigprint();
-  arma_extra_debug_print("min(): two consecutive min() calls detected");
-  
-  return op_min::min(in.m);
-  }
-
-
-
-template<typename T1>
-arma_inline
-const Op< Op<T1, op_min>, op_min>
-min(const Op<T1, op_min>& in, const uword dim)
-  {
-  arma_extra_debug_sigprint();
-  
-  return Op< Op<T1, op_min>, op_min>(in, dim, 0);
-  }
-
-
-
-template<typename T1>
-inline
-arma_warn_unused
-typename T1::elem_type
 min
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const arma_empty_class junk1 = arma_empty_class(),
   const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
   )
@@ -107,26 +78,35 @@
 
 
 
+//! \brief
+//! Immediate 'find minimum value' operation,
+//! invoked, for example, by: min(min(A))
 template<typename T1>
 inline
 arma_warn_unused
 typename T1::elem_type
-min
-  (
-  const T1& X,
-  const arma_empty_class junk1 = arma_empty_class(),
-  const typename enable_if<is_basevec<T1>::value == true>::result* junk2 = 0
-  )
+min(const Op<T1, op_min>& in)
   {
   arma_extra_debug_sigprint();
-  arma_ignore(junk1);
-  arma_ignore(junk2);
+  arma_extra_debug_print("min(): two consecutive min() calls detected");
   
-  return op_min::min(X);
+  return op_min::min(in.m);
   }
 
 
 
+template<typename T1>
+arma_inline
+const Op< Op<T1, op_min>, op_min>
+min(const Op<T1, op_min>& in, const uword dim)
+  {
+  arma_extra_debug_sigprint();
+  
+  return Op< Op<T1, op_min>, op_min>(in, dim, 0);
+  }
+
+
+
 template<typename T>
 arma_inline
 arma_warn_unused

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_prod.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_prod.hpp	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_prod.hpp	2012-05-21 12:29:28 UTC (rev 3610)
@@ -28,17 +28,17 @@
 const Op<T1, op_prod>
 prod
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword dim = 0,
-  const typename enable_if<resolves_to_vector<T1>::value == false>::result* junk1 = 0,
-  const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = 0
+  const typename enable_if< is_arma_type<T1>::value       == true  >::result* junk1 = 0,
+  const typename enable_if< resolves_to_vector<T1>::value == false >::result* junk2 = 0
   )
   {
   arma_extra_debug_sigprint();
   arma_ignore(junk1);
   arma_ignore(junk2);
   
-  return Op<T1, op_prod>(X.get_ref(), dim, 0);
+  return Op<T1, op_prod>(X, dim, 0);
   }
 
 
@@ -48,7 +48,7 @@
 const Op<T1, op_prod>
 prod
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword dim,
   const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
   )
@@ -56,76 +56,57 @@
   arma_extra_debug_sigprint();
   arma_ignore(junk);
   
-  return Op<T1, op_prod>(X.get_ref(), dim, 0);
+  return Op<T1, op_prod>(X, dim, 0);
   }
 
 
 
-//! \brief
-//! Immediate 'product of all values' operation,
-//! invoked, for example, by: prod(prod(A))
-
 template<typename T1>
 inline
+arma_warn_unused
 typename T1::elem_type
-prod(const Op<T1, op_prod>& in)
+prod
+  (
+  const T1& X,
+  const arma_empty_class junk1 = arma_empty_class(),
+  const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
+  )
   {
   arma_extra_debug_sigprint();
-  arma_extra_debug_print("prod(): two consecutive prod() calls detected");
+  arma_ignore(junk1);
+  arma_ignore(junk2);
   
-  return op_prod::prod( in.m );
+  return op_prod::prod( X );
   }
 
 
 
-template<typename T1>
-inline
-const Op<Op<T1, op_prod>, op_prod>
-prod(const Op<T1, op_prod>& in, const uword dim)
-  {
-  arma_extra_debug_sigprint();
-  
-  return Op<Op<T1, op_prod>, op_prod>(in, dim, 0);
-  }
+//! \brief
+//! Immediate 'product of all values' operation,
+//! invoked, for example, by: prod(prod(A))
 
-
-
 template<typename T1>
 inline
 arma_warn_unused
 typename T1::elem_type
-prod
-  (
-  const Base<typename T1::elem_type,T1>& X,
-  const arma_empty_class junk1 = arma_empty_class(),
-  const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
-  )
+prod(const Op<T1, op_prod>& in)
   {
   arma_extra_debug_sigprint();
-  arma_ignore(junk1);
-  arma_ignore(junk2);
+  arma_extra_debug_print("prod(): two consecutive prod() calls detected");
   
-  return op_prod::prod( X.get_ref() );
+  return op_prod::prod( in.m );
   }
 
 
 
 template<typename T1>
 inline
-arma_warn_unused
-typename T1::elem_type
-prod
-  (
-  const T1& X,
-  const arma_empty_class junk1 = arma_empty_class(),
-  const typename enable_if<is_basevec<T1>::value == true>::result* junk2 = 0
-  )
+const Op<Op<T1, op_prod>, op_prod>
+prod(const Op<T1, op_prod>& in, const uword dim)
   {
   arma_extra_debug_sigprint();
-  arma_ignore(junk1);
-  arma_ignore(junk2);
   
-  return op_prod::prod(X);
+  return Op<Op<T1, op_prod>, op_prod>(in, dim, 0);
   }
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_stddev.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_stddev.hpp	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_stddev.hpp	2012-05-21 12:29:28 UTC (rev 3610)
@@ -21,18 +21,18 @@
 const mtOp<typename T1::pod_type, T1, op_stddev>
 stddev
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword norm_type = 0,
   const uword dim = 0,
-  const typename enable_if<resolves_to_vector<T1>::value == false>::result* junk1 = 0,
-  const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = 0
+  const typename enable_if< is_arma_type<T1>::value       == true  >::result* junk1 = 0,
+  const typename enable_if< resolves_to_vector<T1>::value == false >::result* junk2 = 0
   )
   {
   arma_extra_debug_sigprint();
   arma_ignore(junk1);
   arma_ignore(junk2);
   
-  return mtOp<typename T1::pod_type, T1, op_stddev>(X.get_ref(), norm_type, dim);
+  return mtOp<typename T1::pod_type, T1, op_stddev>(X, norm_type, dim);
   }
 
 
@@ -42,7 +42,7 @@
 const mtOp<typename T1::pod_type, T1, op_stddev>
 stddev
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword norm_type,
   const uword dim,
   const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
@@ -51,7 +51,7 @@
   arma_extra_debug_sigprint();
   arma_ignore(junk);
   
-  return mtOp<typename T1::pod_type, T1, op_stddev>(X.get_ref(), norm_type, dim);
+  return mtOp<typename T1::pod_type, T1, op_stddev>(X, norm_type, dim);
   }
 
 
@@ -62,7 +62,7 @@
 typename T1::pod_type
 stddev
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword norm_type = 0,
   const arma_empty_class junk1 = arma_empty_class(),
   const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
@@ -72,28 +72,18 @@
   arma_ignore(junk1);
   arma_ignore(junk2);
   
-  return std::sqrt( op_var::var_vec(X.get_ref(), norm_type) );
+  return std::sqrt( op_var::var_vec(X, norm_type) );
   }
 
 
 
-template<typename T1>
-inline
+template<typename T>
+arma_inline
 arma_warn_unused
-typename T1::pod_type
-stddev
-  (
-  const T1& X,
-  const uword norm_type = 0,
-  const arma_empty_class junk1 = arma_empty_class(),
-  const typename enable_if<is_basevec<T1>::value == true>::result* junk2 = 0
-  )
+const typename arma_scalar_only<T>::result
+stddev(const T&)
   {
-  arma_extra_debug_sigprint();
-  arma_ignore(junk1);
-  arma_ignore(junk2);
-  
-  return std::sqrt( op_var::var_vec(X, norm_type) );
+  return T(0);
   }
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_strans.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_strans.hpp	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_strans.hpp	2012-05-21 12:29:28 UTC (rev 3610)
@@ -21,49 +21,9 @@
 const Op<T1, op_strans>
 strans
   (
-  const Base<typename T1::elem_type,T1>& X,
-  const typename enable_if<is_basevec<T1>::value == false>::result* junk1 = 0,
-  const typename arma_cx_only<typename T1::elem_type>::result* junk2 = 0
-  )
-  {
-  arma_extra_debug_sigprint();
-  arma_ignore(junk1);
-  arma_ignore(junk2);
-  
-  return Op<T1, op_strans>(X.get_ref());
-  }
-
-
-
-// NOTE: deliberately returning op_htrans instead of op_strans,
-// NOTE: due to currently more optimisations available when using op_htrans, especially by glue_times
-template<typename T1>
-arma_inline
-const Op<T1, op_htrans>
-strans
-  (
-  const Base<typename T1::elem_type,T1>& X,
-  const typename enable_if<is_basevec<T1>::value == false>::result* junk1 = 0,
-  const typename arma_not_cx<typename T1::elem_type>::result* junk2 = 0
-  )
-  {
-  arma_extra_debug_sigprint();
-  arma_ignore(junk1);
-  arma_ignore(junk2);
-  
-  return Op<T1, op_htrans>(X.get_ref());
-  }
-
-
-
-template<typename T1>
-arma_inline
-const Op<T1, op_strans>
-strans
-  (
   const T1& X,
-  const typename enable_if<is_basevec<T1>::value == true>::result* junk1 = 0,
-  const typename arma_cx_only<typename T1::elem_type>::result* junk2 = 0
+  const typename enable_if< is_arma_type<T1>::value == true >::result* junk1 = 0,
+  const typename arma_cx_only<typename T1::elem_type>::result*         junk2 = 0
   )
   {
   arma_extra_debug_sigprint();
@@ -75,7 +35,7 @@
 
 
 
-// NOTE: deliberately returning op_htrans instead of op_strans,
+// NOTE: for non-complex objects, deliberately returning op_htrans instead of op_strans,
 // NOTE: due to currently more optimisations available when using op_htrans, especially by glue_times
 template<typename T1>
 arma_inline
@@ -83,8 +43,8 @@
 strans
   (
   const T1& X,
-  const typename enable_if<is_basevec<T1>::value == true>::result* junk1 = 0,
-  const typename arma_not_cx<typename T1::elem_type>::result* junk2 = 0
+  const typename enable_if< is_arma_type<T1>::value == true >::result* junk1 = 0,
+  const typename arma_not_cx<typename T1::elem_type>::result*          junk2 = 0
   )
   {
   arma_extra_debug_sigprint();

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_sum.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_sum.hpp	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_sum.hpp	2012-05-21 12:29:28 UTC (rev 3610)
@@ -18,27 +18,27 @@
 //! \brief
 //! Delayed sum of elements of a matrix along a specified dimension (either rows or columns).
 //! The result is stored in a dense matrix that has either one column or one row.
-//! For dim = 0, find the sum of each column.
-//! For dim = 1, find the sum of each row.
+//! For dim = 0, find the sum of each column (traverse across rows)
+//! For dim = 1, find the sum of each row (traverse across columns)
 //! The default is dim = 0.
-//! NOTE: this function works differently than in Matlab/Octave.
+//! NOTE: the dim argument is different than in Matlab/Octave.
 
 template<typename T1>
 arma_inline
 const Op<T1, op_sum>
 sum
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword dim = 0,
-  const typename enable_if<resolves_to_vector<T1>::value == false>::result* junk1 = 0,
-  const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = 0
+  const typename enable_if< is_arma_type<T1>::value       == true  >::result* junk1 = 0,
+  const typename enable_if< resolves_to_vector<T1>::value == false >::result* junk2 = 0
   )
   {
   arma_extra_debug_sigprint();
   arma_ignore(junk1);
   arma_ignore(junk2);
   
-  return Op<T1, op_sum>(X.get_ref(), dim, 0);
+  return Op<T1, op_sum>(X, dim, 0);
   }
 
 
@@ -48,87 +48,67 @@
 const Op<T1, op_sum>
 sum
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword dim,
-  const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
+  const typename enable_if< resolves_to_vector<T1>::value == true >::result* junk = 0
   )
   {
   arma_extra_debug_sigprint();
   arma_ignore(junk);
   
-  return Op<T1, op_sum>(X.get_ref(), dim, 0);
+  return Op<T1, op_sum>(X, dim, 0);
   }
 
 
 
 //! \brief
-//! Immediate 'sum all values' operation,
-//! invoked, for example, by: sum(sum(A))
-
+//! Immediate 'sum all values' operation for expressions which resolve to a vector 
 template<typename T1>
 inline
 arma_warn_unused
 typename T1::elem_type
-sum(const Op<T1, op_sum>& in)
+sum
+  (
+  const T1& X,
+  const arma_empty_class junk1 = arma_empty_class(),
+  const typename enable_if< resolves_to_vector<T1>::value == true >::result* junk2 = 0
+  )
   {
   arma_extra_debug_sigprint();
-  arma_extra_debug_print("sum(): two consecutive sum() calls detected");
+  arma_ignore(junk1);
+  arma_ignore(junk2);
   
-  return accu(in.m);
+  return accu(X);
   }
 
 
 
-template<typename T1>
-arma_inline
-const Op<Op<T1, op_sum>, op_sum>
-sum(const Op<T1, op_sum>& in, const uword dim)
-  {
-  arma_extra_debug_sigprint();
-  
-  return Op<Op<T1, op_sum>, op_sum>(in, dim, 0);
-  }
-
-
-
 //! \brief
-//! Immediate 'sum all values' operation for expressions which resolve to a vector 
+//! Immediate 'sum all values' operation,
+//! invoked, for example, by: sum(sum(A))
+
 template<typename T1>
 inline
 arma_warn_unused
 typename T1::elem_type
-sum
-  (
-  const Base<typename T1::elem_type,T1>& X,
-  const arma_empty_class junk1 = arma_empty_class(),
-  const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk2 = 0
-  )
+sum(const Op<T1, op_sum>& in)
   {
   arma_extra_debug_sigprint();
-  arma_ignore(junk1);
-  arma_ignore(junk2);
+  arma_extra_debug_print("sum(): two consecutive sum() calls detected");
   
-  return accu(X.get_ref());
+  return accu(in.m);
   }
 
 
 
 template<typename T1>
-inline
-arma_warn_unused
-typename T1::elem_type
-sum
-  (
-  const T1& X,
-  const arma_empty_class junk1 = arma_empty_class(),
-  const typename enable_if<is_basevec<T1>::value == true>::result* junk2 = 0
-  )
+arma_inline
+const Op<Op<T1, op_sum>, op_sum>
+sum(const Op<T1, op_sum>& in, const uword dim)
   {
   arma_extra_debug_sigprint();
-  arma_ignore(junk1);
-  arma_ignore(junk2);
   
-  return accu(X);
+  return Op<Op<T1, op_sum>, op_sum>(in, dim, 0);
   }
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_trans.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_trans.hpp	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_trans.hpp	2012-05-21 12:29:28 UTC (rev 3610)
@@ -20,26 +20,8 @@
 const Op<T1, op_htrans>
 trans
   (
-  const Base<typename T1::elem_type,T1>& X,
-  const typename enable_if<is_basevec<T1>::value == false>::result* junk = 0
-  )
-  {
-  arma_extra_debug_sigprint();
-  arma_ignore(junk);
-  
-  return Op<T1, op_htrans>(X.get_ref());
-  }
-
-
-
-template<typename T1>
-arma_inline
-arma_warn_unused
-const Op<T1, op_htrans>
-trans
-  (
   const T1& X,
-  const typename enable_if<is_basevec<T1>::value == true>::result* junk = 0
+  const typename enable_if< is_arma_type<T1>::value == true >::result* junk = 0
   )
   {
   arma_extra_debug_sigprint();
@@ -55,26 +37,8 @@
 const Op<T1, op_htrans>
 htrans
   (
-  const Base<typename T1::elem_type,T1>& X,
-  const typename enable_if<is_basevec<T1>::value == false>::result* junk = 0
-  )
-  {
-  arma_extra_debug_sigprint();
-  arma_ignore(junk);
-  
-  return Op<T1, op_htrans>(X.get_ref());
-  }
-
-
-
-template<typename T1>
-arma_inline
-arma_warn_unused
-const Op<T1, op_htrans>
-htrans
-  (
   const T1& X,
-  const typename enable_if<is_basevec<T1>::value == true>::result* junk = 0
+  const typename enable_if< is_arma_type<T1>::value == true >::result* junk = 0
   )
   {
   arma_extra_debug_sigprint();

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_var.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_var.hpp	2012-05-15 23:54:18 UTC (rev 3609)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_var.hpp	2012-05-21 12:29:28 UTC (rev 3610)
@@ -21,18 +21,18 @@
 const mtOp<typename T1::pod_type, T1, op_var>
 var
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword norm_type = 0,
   const uword dim = 0,
-  const typename enable_if<resolves_to_vector<T1>::value == false>::result* junk1 = 0,
-  const typename enable_if<is_basevec<T1>::value == false>::result* junk2 = 0
+  const typename enable_if< is_arma_type<T1>::value       == true  >::result* junk1 = 0,
+  const typename enable_if< resolves_to_vector<T1>::value == false >::result* junk2 = 0
   )
   {
   arma_extra_debug_sigprint();
   arma_ignore(junk1);
   arma_ignore(junk2);
   
-  return mtOp<typename T1::pod_type, T1, op_var>(X.get_ref(), norm_type, dim);
+  return mtOp<typename T1::pod_type, T1, op_var>(X, norm_type, dim);
   }
 
 
@@ -42,7 +42,7 @@
 const mtOp<typename T1::pod_type, T1, op_var>
 var
   (
-  const Base<typename T1::elem_type,T1>& X,
+  const T1& X,
   const uword norm_type,
   const uword dim,
   const typename enable_if<resolves_to_vector<T1>::value == true>::result* junk = 0
@@ -51,7 +51,7 @@
   arma_extra_debug_sigprint();
   arma_ignore(junk);
   
-  return mtOp<typename T1::pod_type, T1, op_var>(X.get_ref(), norm_type, dim);
[TRUNCATED]

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


More information about the Rcpp-commits mailing list