[Rcpp-commits] r2731 - in pkg/RcppGSL: . inst/doc inst/doc/RcppGSL

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 6 18:44:17 CET 2010


Author: romain
Date: 2010-12-06 18:44:17 +0100 (Mon, 06 Dec 2010)
New Revision: 2731

Modified:
   pkg/RcppGSL/ChangeLog
   pkg/RcppGSL/DESCRIPTION
   pkg/RcppGSL/inst/doc/Makefile
   pkg/RcppGSL/inst/doc/RcppGSL/RcppGSL.Rnw
Log:
vignette cosmetics

Modified: pkg/RcppGSL/ChangeLog
===================================================================
--- pkg/RcppGSL/ChangeLog	2010-12-06 04:27:53 UTC (rev 2730)
+++ pkg/RcppGSL/ChangeLog	2010-12-06 17:44:17 UTC (rev 2731)
@@ -1,3 +1,7 @@
+2010-12-06  Romain Francois <romain at r-enthusiasts.com>
+
+    * inst/doc/RcppGSL/RcppGSL.Rnw: cosmetics
+
 2010-11-30  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Version 0.1.0 and initial release

Modified: pkg/RcppGSL/DESCRIPTION
===================================================================
--- pkg/RcppGSL/DESCRIPTION	2010-12-06 04:27:53 UTC (rev 2730)
+++ pkg/RcppGSL/DESCRIPTION	2010-12-06 17:44:17 UTC (rev 2731)
@@ -1,7 +1,7 @@
 Package: RcppGSL
 Type: Package
 Title: Rcpp integration for GNU GSL vectors and matrices
-Version: 0.1.0
+Version: 0.1.0.1
 Date: $Date$
 Author: Romain Francois and Dirk Eddelbuettel
 Maintainer: Dirk Eddelbuettel and Romain Francois <RomainAndDirk at r-enthusiasts.com>

Modified: pkg/RcppGSL/inst/doc/Makefile
===================================================================
--- pkg/RcppGSL/inst/doc/Makefile	2010-12-06 04:27:53 UTC (rev 2730)
+++ pkg/RcppGSL/inst/doc/Makefile	2010-12-06 17:44:17 UTC (rev 2731)
@@ -16,7 +16,7 @@
 
 RcppGSL.pdf: RcppGSL/RcppGSL.Rnw
 	cp -f RcppGSL/RcppGSL.Rnw .
-	Rscript --vanilla -e "require(highlight); driver <- HighlightWeaveLatex(boxes = TRUE, bg = 'white' ); Sweave( 'RcppGSL.Rnw', driver = driver ); "
+	Rscript --vanilla -e "require(highlight); driver <- HighlightWeaveLatex(boxes = TRUE); Sweave( 'RcppGSL.Rnw', driver = driver ); "
 ifneq (,$(findstring edd,$(whoami)))
 	pdflatex RcppGSL
 else

Modified: pkg/RcppGSL/inst/doc/RcppGSL/RcppGSL.Rnw
===================================================================
--- pkg/RcppGSL/inst/doc/RcppGSL/RcppGSL.Rnw	2010-12-06 04:27:53 UTC (rev 2730)
+++ pkg/RcppGSL/inst/doc/RcppGSL/RcppGSL.Rnw	2010-12-06 17:44:17 UTC (rev 2731)
@@ -299,19 +299,17 @@
 The function can then simply be called from \proglang{R} :
 
 <<results=hide,echo=FALSE>>=
-fx <- cxxfunction( signature( vec_ = "integer" ), '
+fx <- cxxfunction( 
+    list( sum_gsl_vector_int = signature( vec_ = "integer" ) ), 
+    c( sum_gsl_vector_int = '
   RcppGSL::vector<int> vec = as< RcppGSL::vector<int> >(vec_) ;
   int res = std::accumulate( vec.begin(), vec.end(), 0 ) ;
   vec.free() ;  // we need to free vec after use
   return wrap( res ) ;
-', plugin = "RcppGSL" )
-@
-<<eval=FALSE,size=small>>=
+' ), plugin = "RcppGSL" )
+<<size=small>>=
 .Call( "sum_gsl_vector_int", 1:10 )
 @
-<<echo=FALSE>>=
-fx(1:10)
-@
 
 A second example shows a simple function that grabs elements of an
 R list as \verb|gsl_vector| objects using implicit conversion mechanisms
@@ -340,14 +338,9 @@
 
 called from \proglang{R} :
 
-<<size=small>>=
-data <- list( x = seq(0,1,length=10), y = 1:10 )
-@
-<<eval=FALSE>>=
-.Call( "gsl_vector_sum_2", data )
-@
 <<results=hide, echo=FALSE>>=
-fx2 <- cxxfunction( signature( data_ = "list" ), '
+fx2 <- cxxfunction( list( gsl_vector_sum_2 = signature( data_ = "list" ) ), 
+c( gsl_vector_sum_2 = '
     List data(data_) ;
 
   // grab "x" as a gsl_vector through the RcppGSL::vector<double> class
@@ -366,10 +359,11 @@
 
   // return the result
   return wrap(res);
-', plugin = "RcppGSL" )
+' ), plugin = "RcppGSL" )
 @
-<<echo=FALSE>>=
-fx2( data )
+<<>>=
+data <- list( x = seq(0,1,length=10), y = 1:10 )
+.Call( "gsl_vector_sum_2", data )
 @
 
 \subsection{Mapping}



More information about the Rcpp-commits mailing list