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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 6 03:50:36 CET 2012


Author: edd
Date: 2012-03-06 03:50:35 +0100 (Tue, 06 Mar 2012)
New Revision: 3489

Modified:
   pkg/RcppArmadillo/ChangeLog
   pkg/RcppArmadillo/DESCRIPTION
   pkg/RcppArmadillo/inst/NEWS
   pkg/RcppArmadillo/inst/include/armadillo
   pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/auxlib_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_conv_to.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_qr.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/fn_syl_lyap.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/subview_elem1_meat.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/wall_clock_bones.hpp
   pkg/RcppArmadillo/inst/include/armadillo_bits/wall_clock_meat.hpp
   pkg/RcppArmadillo/man/RcppArmadillo-package.Rd
Log:
RcppArmadillo 0.2.36 with Armadillo 2.4.4


Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2012-03-03 17:52:32 UTC (rev 3488)
+++ pkg/RcppArmadillo/ChangeLog	2012-03-06 02:50:35 UTC (rev 3489)
@@ -1,3 +1,9 @@
+2012-03-05  Dirk Eddelbuettel  <edd at debian.org>
+
+	* DESCRIPTION: Release 0.2.36 
+	
+	* inst/include/*: Upgraded to new release 2.4.4 of Armadillo
+
 2012-02-17  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Release 0.2.35 (depending on Rcpp 0.9.10)

Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION	2012-03-03 17:52:32 UTC (rev 3488)
+++ pkg/RcppArmadillo/DESCRIPTION	2012-03-06 02:50:35 UTC (rev 3489)
@@ -1,7 +1,7 @@
 Package: RcppArmadillo
 Type: Package
 Title: Rcpp integration for Armadillo templated linear algebra library
-Version: 0.2.35
+Version: 0.2.36
 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.4.2). Thus users do not need to
+ Armadillo library (currently version 2.4.4). 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-03-03 17:52:32 UTC (rev 3488)
+++ pkg/RcppArmadillo/inst/NEWS	2012-03-06 02:50:35 UTC (rev 3489)
@@ -1,3 +1,11 @@
+0.2.36  2012-03-05
+
+    o   Upgraded to Armadillo release 2.4.4
+
+          * fixes for qr() and syl()
+          * more portable wall_clock class
+          * faster relational operators on submatrices
+
 0.2.35  2012-02-17
 
     o   Upgraded to Armadillo release 2.4.3

Modified: pkg/RcppArmadillo/inst/include/armadillo
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo	2012-03-03 17:52:32 UTC (rev 3488)
+++ pkg/RcppArmadillo/inst/include/armadillo	2012-03-06 02:50:35 UTC (rev 3489)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2011 Conrad Sanderson
+// Copyright (C) 2008-2012 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2012 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -40,6 +40,10 @@
 #endif
 
 
+#if !defined(ARMA_HAVE_GETTIMEOFDAY) && !defined(ARMA_USE_BOOST_DATE)
+  #include <ctime>
+#endif
+
 #if defined(ARMA_HAVE_GETTIMEOFDAY)
   #include <sys/time.h>
   #undef ARMA_USE_BOOST_DATE

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2012-03-03 17:52:32 UTC (rev 3488)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/arma_version.hpp	2012-03-06 02:50:35 UTC (rev 3489)
@@ -18,7 +18,7 @@
 
 #define ARMA_VERSION_MAJOR 2
 #define ARMA_VERSION_MINOR 4
-#define ARMA_VERSION_PATCH 3
+#define ARMA_VERSION_PATCH 4
 #define ARMA_VERSION_NAME  "Loco Lounge Lizard"
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/auxlib_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/auxlib_meat.hpp	2012-03-03 17:52:32 UTC (rev 3488)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/auxlib_meat.hpp	2012-03-06 02:50:35 UTC (rev 3489)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2011 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2011 Conrad Sanderson
+// Copyright (C) 2008-2012 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2012 Conrad Sanderson
 // Copyright (C) 2009 Edmund Highcock
 // Copyright (C) 2011 James Sanders
 // Copyright (C) 2011 Stanislav Funiak
@@ -2690,7 +2690,7 @@
   
   #if defined(ARMA_USE_LAPACK)
     {
-    arma_debug_check( (A.is_square() == false), "schur_dec(): matrix A is not square" );
+    arma_debug_check( (A.is_square() == false), "schur_dec(): given matrix is not square" );
     
     if(A.is_empty())
       {
@@ -2803,31 +2803,32 @@
   {
   arma_extra_debug_sigprint();
   
-  arma_debug_check( (A.is_square() == false), "syl(): matrix A is not square" );
-  arma_debug_check( (B.is_square() == false), "syl(): matrix B is not square" );
+  arma_debug_check
+    (
+    (A.is_square() == false) || (B.is_square() == false),
+    "syl(): given matrix is not square"
+    );
+    
+  arma_debug_check
+    (
+    (C.n_rows != A.n_rows) || (C.n_cols != B.n_cols),
+    "syl(): matrices are not conformant"
+    );
   
-  arma_debug_check( (C.n_rows != A.n_rows) || (C.n_cols != B.n_cols), "syl(): matrices are not conformant" );
-  
   if(A.is_empty() || B.is_empty() || C.is_empty())
     {
     X.reset();
     return true;
     }
   
-  bool status;
-  
   #if defined(ARMA_USE_LAPACK)
     {
     Mat<eT> Z1, Z2, T1, T2;
     
-    status = auxlib::schur_dec(Z1, T1, A);
-    if(status == false)
-      {
-      return false;
-      }
+    const bool status_sd1 = auxlib::schur_dec(Z1, T1, A);
+    const bool status_sd2 = auxlib::schur_dec(Z2, T2, B);
     
-    status = auxlib::schur_dec(Z2, T2, B);
-    if(status == false)
+    if( (status_sd1 == false) || (status_sd2 == false) )
       {
       return false;
       }
@@ -2850,7 +2851,7 @@
     
     X = Z1 * Y * trans(Z2);
     
-    status = (info == 0);
+    return (info >= 0);
     }
   #else
     {
@@ -2858,9 +2859,6 @@
     return false;
     }
   #endif
-  
-  
-  return status;
   }
   
   

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_conv_to.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_conv_to.hpp	2012-03-03 17:52:32 UTC (rev 3488)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_conv_to.hpp	2012-03-06 02:50:35 UTC (rev 3489)
@@ -462,11 +462,11 @@
   typename std::vector<in_eT>::const_iterator in_begin = in.begin();
   typename std::vector<in_eT>::const_iterator in_end   = in.end();
   
-  typename Col<out_eT>::iterator out_begin = out.begin();
-  typename Col<out_eT>::iterator out_end   = out.end();
+  typename Row<out_eT>::iterator out_begin = out.begin();
+  typename Row<out_eT>::iterator out_end   = out.end();
   
   typename std::vector<in_eT>::const_iterator in_it;
-  typename Col<out_eT>::iterator              out_it;
+  typename Row<out_eT>::iterator              out_it;
   
   for(in_it = in_begin, out_it = out_begin; (in_it != in_end) && (out_it != out_end); ++in_it, ++out_it)
     {
@@ -493,11 +493,11 @@
   typename std::vector<in_eT>::const_iterator in_begin = in.begin();
   typename std::vector<in_eT>::const_iterator in_end   = in.end();
   
-  typename Col<out_eT>::iterator out_begin = out.begin();
-  typename Col<out_eT>::iterator out_end   = out.end();
+  typename Row<out_eT>::iterator out_begin = out.begin();
+  typename Row<out_eT>::iterator out_end   = out.end();
   
   typename std::vector<in_eT>::const_iterator in_it;
-  typename Col<out_eT>::iterator              out_it;
+  typename Row<out_eT>::iterator              out_it;
   
   for(in_it = in_begin, out_it = out_begin; (in_it != in_end) && (out_it != out_end); ++in_it, ++out_it)
     {

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_qr.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_qr.hpp	2012-03-03 17:52:32 UTC (rev 3488)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_qr.hpp	2012-03-06 02:50:35 UTC (rev 3489)
@@ -1,5 +1,5 @@
-// Copyright (C) 2009-2011 NICTA (www.nicta.com.au)
-// Copyright (C) 2009-2011 Conrad Sanderson
+// Copyright (C) 2009-2012 NICTA (www.nicta.com.au)
+// Copyright (C) 2009-2012 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -42,7 +42,7 @@
     arma_bad("qr(): failed to converge", false);
     }
   
-  return false;
+  return status;
   }
 
 

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/fn_syl_lyap.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/fn_syl_lyap.hpp	2012-03-03 17:52:32 UTC (rev 3488)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/fn_syl_lyap.hpp	2012-03-06 02:50:35 UTC (rev 3489)
@@ -1,5 +1,5 @@
-// Copyright (C) 2011 NICTA (www.nicta.com.au)
-// Copyright (C) 2011 Conrad Sanderson
+// Copyright (C) 2011-2012 NICTA (www.nicta.com.au)
+// Copyright (C) 2011-2012 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -49,7 +49,7 @@
     arma_bad("syl(): equation appears to be singular", false);
     }
   
-  return false;
+  return status;
   }
 
 
@@ -70,9 +70,18 @@
   
   typedef typename T1::elem_type eT;
   
+  const unwrap<T1> tmp_A( in_A.get_ref() );
+  const unwrap<T2> tmp_B( in_B.get_ref() );
+  const unwrap<T3> tmp_C( in_C.get_ref() );
+  
+  const Mat<eT>& A = tmp_A.M;
+  const Mat<eT>& B = tmp_B.M;
+  const Mat<eT>& C = tmp_C.M;
+  
   Mat<eT> out;
-  const bool status = syl(out, in_A, in_B, in_C);
   
+  const bool status = auxlib::syl(out, A, B, C);
+  
   if(status == false)
     {
     out.reset();

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/subview_elem1_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/subview_elem1_meat.hpp	2012-03-03 17:52:32 UTC (rev 3488)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/subview_elem1_meat.hpp	2012-03-06 02:50:35 UTC (rev 3489)
@@ -225,7 +225,7 @@
   
   arma_debug_check( (aa_n_elem != P.get_n_elem()), "Mat::elem(): size mismatch" );
   
-  if(P.is_alias(m) == false)
+  if( (P.is_alias(m) == false) && (Proxy<T2>::prefer_at_accessor == false) )
     {
     typename Proxy<T2>::ea_type X = P.get_ea();
     
@@ -259,7 +259,7 @@
     }
   else
     {
-    arma_extra_debug_print("subview_elem1::inplace_op(): aliasing detected");
+    arma_extra_debug_print("subview_elem1::inplace_op(): aliasing or prefer_at_accessor detected");
     
     const unwrap_check<typename Proxy<T2>::stored_type> tmp(P.Q, m_local);
     const Mat<eT>& M = tmp.M;

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/wall_clock_bones.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/wall_clock_bones.hpp	2012-03-03 17:52:32 UTC (rev 3488)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/wall_clock_bones.hpp	2012-03-06 02:50:35 UTC (rev 3489)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2010 Conrad Sanderson
+// Copyright (C) 2008-2012 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2012 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -34,11 +34,11 @@
   #if defined(ARMA_USE_BOOST_DATE)
     boost::posix_time::ptime         boost_time1;
     boost::posix_time::time_duration boost_duration;
+  #elif defined(ARMA_HAVE_GETTIMEOFDAY)
+    struct timeval posix_time1;
+    struct timeval posix_time2;
   #else
-    #if defined(ARMA_HAVE_GETTIMEOFDAY)
-      struct timeval posix_time1;
-      struct timeval posix_time2;
-    #endif
+    clock_t time1;
   #endif
   
   };

Modified: pkg/RcppArmadillo/inst/include/armadillo_bits/wall_clock_meat.hpp
===================================================================
--- pkg/RcppArmadillo/inst/include/armadillo_bits/wall_clock_meat.hpp	2012-03-03 17:52:32 UTC (rev 3488)
+++ pkg/RcppArmadillo/inst/include/armadillo_bits/wall_clock_meat.hpp	2012-03-06 02:50:35 UTC (rev 3489)
@@ -1,5 +1,5 @@
-// Copyright (C) 2008-2010 NICTA (www.nicta.com.au)
-// Copyright (C) 2008-2010 Conrad Sanderson
+// Copyright (C) 2008-2012 NICTA (www.nicta.com.au)
+// Copyright (C) 2008-2012 Conrad Sanderson
 // 
 // This file is part of the Armadillo C++ library.
 // It is provided without any warranty of fitness
@@ -43,17 +43,16 @@
     boost_time1 = boost::posix_time::microsec_clock::local_time();
     valid = true;
     }
+  #elif defined(ARMA_HAVE_GETTIMEOFDAY)
+    {
+    gettimeofday(&posix_time1, 0);
+    valid = true;
+    }
   #else
-    #if defined(ARMA_HAVE_GETTIMEOFDAY)
-      {
-      gettimeofday(&posix_time1, 0);
-      valid = true;
-      }
-    #else
-      {
-      arma_stop("wall_clock::tic(): need Boost libraries or POSIX gettimeofday()");
-      }
-    #endif
+    {
+    time1 = clock();
+    valid = true;
+    }
   #endif
   }
 
@@ -72,22 +71,23 @@
       boost_duration = boost::posix_time::microsec_clock::local_time() - boost_time1;
       return boost_duration.total_microseconds() * 1e-6;
       }
+    #elif defined(ARMA_HAVE_GETTIMEOFDAY)
+      {
+      gettimeofday(&posix_time2, 0);
+      
+      const double tmp_time1 = posix_time1.tv_sec + posix_time1.tv_usec * 1.0e-6;
+      const double tmp_time2 = posix_time2.tv_sec + posix_time2.tv_usec * 1.0e-6;
+      
+      return tmp_time2 - tmp_time1;
+      }
     #else
-      #if defined(ARMA_HAVE_GETTIMEOFDAY)
-        {
-        gettimeofday(&posix_time2, 0);
-        
-        const double tmp_time1 = posix_time1.tv_sec + posix_time1.tv_usec * 1.0e-6;
-        const double tmp_time2 = posix_time2.tv_sec + posix_time2.tv_usec * 1.0e-6;
-        
-        return tmp_time2 - tmp_time1;
-        }
-      #else
-        {
-        arma_stop("wall_clock::toc(): need Boost libraries or POSIX gettimeofday()");
-        return 0.0;
-        }
-      #endif
+      {
+      clock_t time2 = clock();
+      
+      clock_t diff = time2 - time1;
+      
+      return double(diff) / double(CLOCKS_PER_SEC);
+      }
     #endif
     }
   else
@@ -96,5 +96,7 @@
     }
   }
 
+
+
 //! @}
 

Modified: pkg/RcppArmadillo/man/RcppArmadillo-package.Rd
===================================================================
--- pkg/RcppArmadillo/man/RcppArmadillo-package.Rd	2012-03-03 17:52:32 UTC (rev 3488)
+++ pkg/RcppArmadillo/man/RcppArmadillo-package.Rd	2012-03-06 02:50:35 UTC (rev 3489)
@@ -13,8 +13,8 @@
   \tabular{ll}{
     Package: \tab RcppArmadillo\cr
     Type: \tab Package\cr
-    Version: \tab 0.2.35\cr
-    Date: \tab 2012-02-17\cr
+    Version: \tab 0.2.36\cr
+    Date: \tab 2012-03-05\cr
     License: \tab GPL (>= 2)\cr
     LazyLoad: \tab yes\cr
   }



More information about the Rcpp-commits mailing list