[Rcpp-commits] r807 - pkg/Rcpp/inst/examples/RcppInline

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Mar 1 14:39:46 CET 2010


Author: romain
Date: 2010-03-01 14:39:46 +0100 (Mon, 01 Mar 2010)
New Revision: 807

Modified:
   pkg/Rcpp/inst/examples/RcppInline/RcppInlineWithLibsExamples.r
Log:
Rcpp::wrap(x).asInt() -> Rcpp::as<int>(x)

Modified: pkg/Rcpp/inst/examples/RcppInline/RcppInlineWithLibsExamples.r
===================================================================
--- pkg/Rcpp/inst/examples/RcppInline/RcppInlineWithLibsExamples.r	2010-03-01 13:35:07 UTC (rev 806)
+++ pkg/Rcpp/inst/examples/RcppInline/RcppInlineWithLibsExamples.r	2010-03-01 13:39:46 UTC (rev 807)
@@ -55,7 +55,7 @@
 
     ## now use Rcpp to pass down a parameter for the seed
     gslrng <- '
-    int seed = Rcpp::wrap(par).asInt();
+    int seed = Rcpp::as<int>(par) ;
 
     gsl_rng *r;
     gsl_rng_env_setup();
@@ -102,8 +102,8 @@
 
     ## now use Rcpp to pass down a parameter for the seed, and a vector size
     gslrng <- '
-    int seed = Rcpp::wrap(s).asInt();
-    int len = Rcpp::wrap(n).asInt();
+    int seed = Rcpp::as<int>(s) ;
+    int len = Rcpp::as<int>(n);
 
     gsl_rng *r;
     gsl_rng_env_setup();
@@ -139,8 +139,8 @@
 
     ## now use Rcpp to pass down a parameter for the seed, and a vector size
     gslrng <- '
-    int seed = wrap(s).asInt();
-    int len = wrap(n).asInt();
+    int seed = Rcpp::as<int>(s);
+    int len = Rcpp::as<int>(n);
 
     gsl_rng *r;
     gsl_rng_env_setup();



More information about the Rcpp-commits mailing list