[Rcpp-commits] r982 - in pkg/RcppGsl: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Apr 4 16:02:33 CEST 2010


Author: romain
Date: 2010-04-04 16:02:32 +0200 (Sun, 04 Apr 2010)
New Revision: 982

Modified:
   pkg/RcppGsl/DESCRIPTION
   pkg/RcppGsl/src/RcppGsl.cpp
Log:
use implicit wrap through templated assignement op

Modified: pkg/RcppGsl/DESCRIPTION
===================================================================
--- pkg/RcppGsl/DESCRIPTION	2010-04-04 13:59:04 UTC (rev 981)
+++ pkg/RcppGsl/DESCRIPTION	2010-04-04 14:02:32 UTC (rev 982)
@@ -8,4 +8,4 @@
 Description: glue between Rcpp and gsl
 License: GPL (>=2)
 LazyLoad: yes
-Depends: Rcpp (>= 0.7.11)
+Depends: Rcpp (>= 0.7.11.2)

Modified: pkg/RcppGsl/src/RcppGsl.cpp
===================================================================
--- pkg/RcppGsl/src/RcppGsl.cpp	2010-04-04 13:59:04 UTC (rev 981)
+++ pkg/RcppGsl/src/RcppGsl.cpp	2010-04-04 14:02:32 UTC (rev 982)
@@ -4,7 +4,12 @@
 	gsl_vector * x = gsl_vector_alloc (10);
 	gsl_vector_set_zero( x ) ;
 	
-	Rcpp::NumericVector xx = Rcpp::wrap( *x ) ;
+	// we cannot have Rcpp::NumericVector xx = x ; 
+	// because this does not involve the assignment operator
+	// but the constructor and Vector only had templated assignement
+	// operator, not templated constructor, so we have to do this in two steps
+	Rcpp::NumericVector xx ;
+	xx = *x  ;
 	gsl_vector_free (x);
 	return xx ;
 }



More information about the Rcpp-commits mailing list