[Rcpp-commits] r3012 - in pkg/RcppArmadillo: . inst src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Apr 25 13:58:13 CEST 2011


Author: edd
Date: 2011-04-25 13:58:13 +0200 (Mon, 25 Apr 2011)
New Revision: 3012

Modified:
   pkg/RcppArmadillo/ChangeLog
   pkg/RcppArmadillo/DESCRIPTION
   pkg/RcppArmadillo/inst/NEWS
   pkg/RcppArmadillo/src/RcppArmadillo.cpp
Log:
armadillo_version no longer needs an instance of arma_version


Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2011-04-23 16:54:30 UTC (rev 3011)
+++ pkg/RcppArmadillo/ChangeLog	2011-04-25 11:58:13 UTC (rev 3012)
@@ -1,3 +1,8 @@
+2011-04-25  Dirk Eddelbuettel  <edd at debian.org>
+
+	* src/RcppArmadillo.cpp: Rewritten armadillo_version as to no longer
+	require an instance of arma::arma_version, with Thanks to Conrad
+
 2011-04-22  Dirk Eddelbuettel  <edd at debian.org>
 
 	* inst/examples/varSimulation.r: New example simulating a first-order

Modified: pkg/RcppArmadillo/DESCRIPTION
===================================================================
--- pkg/RcppArmadillo/DESCRIPTION	2011-04-23 16:54:30 UTC (rev 3011)
+++ pkg/RcppArmadillo/DESCRIPTION	2011-04-25 11:58:13 UTC (rev 3012)
@@ -1,7 +1,7 @@
 Package: RcppArmadillo
 Type: Package
 Title: Rcpp integration for Armadillo templated linear algebra library
-Version: 0.2.19
+Version: 0.2.19.1
 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-04-23 16:54:30 UTC (rev 3011)
+++ pkg/RcppArmadillo/inst/NEWS	2011-04-25 11:58:13 UTC (rev 3012)
@@ -3,6 +3,9 @@
     o   Added a new subdirectory examples/ seeded with a nice Vector
         Autoregression simulation simulation example by Lance Bachmeier
 
+    o   Rewrote armadillo_version as to no longer require an instance 
+        of arma::arma_version, with Thanks to Conrad for the suggestion
+
 0.2.19  2011-04-18
 
     o   Upgraded to Armadillo version 1.2.0 "Unscrupulous Carbon Emitter"

Modified: pkg/RcppArmadillo/src/RcppArmadillo.cpp
===================================================================
--- pkg/RcppArmadillo/src/RcppArmadillo.cpp	2011-04-23 16:54:30 UTC (rev 3011)
+++ pkg/RcppArmadillo/src/RcppArmadillo.cpp	2011-04-25 11:58:13 UTC (rev 3012)
@@ -2,7 +2,7 @@
 //
 // RcppArmadillo.cpp: Rcpp/Armadillo glue
 //
-// Copyright (C)  2010 Dirk Eddelbuettel, Romain Francois and Douglas Bates
+// Copyright (C)  2010 - 2011  Dirk Eddelbuettel, Romain Francois and Douglas Bates
 //
 // This file is part of RcppArmadillo.
 //
@@ -21,19 +21,24 @@
 
 #include <RcppArmadillo.h>
 
-using namespace Rcpp ;
+using namespace Rcpp;
 
 extern "C" SEXP armadillo_version(SEXP single_){
-    struct arma::arma_version av;
-    bool single = Rcpp::as<bool>( single_) ;
+
+    bool single = as<bool>( single_) ;
+
     if( single ){
-	return Rcpp::wrap( 10000*av.major + 100*av.minor + av.patch ) ;
+	return wrap( 10000*arma::arma_version::major +
+		     100*arma::arma_version::minor + 
+		     arma::arma_version::patch ) ;
     }
-    IntegerVector version = IntegerVector::create( 
-    	_["major"] = av.major, 
-    	_["minor"] = av.minor, 
-    	_["patch"] = av.patch
-    	) ;
-    return version ;
+
+    IntegerVector version = 
+	IntegerVector::create(_["major"] = arma::arma_version::major,
+			      _["minor"] = arma::arma_version::minor,
+			      _["patch"] = arma::arma_version::patch);
+
+   return version ;
+
 }
 



More information about the Rcpp-commits mailing list