[Rcpp-commits] r874 - papers/rjournal pkg/Rcpp/inst pkg/Rcpp/inst/doc
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Mar 11 02:57:52 CET 2010
Author: edd
Date: 2010-03-11 02:57:51 +0100 (Thu, 11 Mar 2010)
New Revision: 874
Modified:
papers/rjournal/EddelbuettelFrancois.tex
pkg/Rcpp/inst/ChangeLog
pkg/Rcpp/inst/doc/Rcpp-introduction.Rnw
Log:
applied a few of the fixes suggested by Matt Kraai
Modified: papers/rjournal/EddelbuettelFrancois.tex
===================================================================
--- papers/rjournal/EddelbuettelFrancois.tex 2010-03-10 22:46:24 UTC (rev 873)
+++ papers/rjournal/EddelbuettelFrancois.tex 2010-03-11 01:57:51 UTC (rev 874)
@@ -160,7 +160,7 @@
Third, both inputs are converted to templated\footnote{C++ templates
allow functions or classes to be written somewhat independently from the
template parameter. The actual class is instantiated by the compiler
-by replacing occurences of the templated parameter(s).}
+by replacing occurrences of the templated parameter(s).}
C++ vector types, here a standard \code{double}
type is used to create a vector of doubles from the template type.
Fourth, the usefulness of these classes can be seen when we query the
@@ -320,7 +320,7 @@
\end{example}
This imposes on the programmer knowledge of \code{PROTECT}, \code{UNPROTECT},
-\code{SEXP}, \code{allocVector}, \code{SET\_STRING\_ELT}, \code{mkChar}.
+\code{SEXP}, \code{allocVector}, \code{SET\_STRING\_ELT}, and \code{mkChar}.
Using the \pkg{Rcpp::CharacterVector} class, we can express the same
code more concisely:
@@ -422,21 +422,21 @@
interchange data between C++ and R.
\begin{example}
-# assuming the global environment contains
-# a variable 'x' that is a numeric vector
+// assuming the global environment contains
+// a variable 'x' that is a numeric vector
Rcpp::Environment global =
\ \ \ \ Rcpp::Environment::global_env()
-# extract a std::vector<double> from
-# the global environment
+// extract a std::vector<double> from
+// the global environment
std::vector<double> vx = global["x"] ;
-# create a map<string,string>
+// create a map<string,string>
std::map<std::string,std::string> map ;
map["foo"] = "oof" ;
map["bar"] = "rab" ;
-# push the STL map to R
+// push the STL map to R
global["y"] = map ;
\end{example}
Modified: pkg/Rcpp/inst/ChangeLog
===================================================================
--- pkg/Rcpp/inst/ChangeLog 2010-03-10 22:46:24 UTC (rev 873)
+++ pkg/Rcpp/inst/ChangeLog 2010-03-11 01:57:51 UTC (rev 874)
@@ -1,7 +1,10 @@
2010-03-10 Dirk Eddelbuettel <edd at debian.org>
- * R/RcppLdPath.R: Be more specific about quote-protection of path on Windows
+ * R/RcppLdPath.R: More specific about quote-protection of path on Windows
+ * inst/doc/Rcpp-introduction.Rnw: Applied several fixes kindly suggested
+ by Matt Kraai
+
2010-03-09 Dirk Eddelbuettel <edd at debian.org>
* DESCRIPTION: Release 0.7.8
Modified: pkg/Rcpp/inst/doc/Rcpp-introduction.Rnw
===================================================================
--- pkg/Rcpp/inst/doc/Rcpp-introduction.Rnw 2010-03-10 22:46:24 UTC (rev 873)
+++ pkg/Rcpp/inst/doc/Rcpp-introduction.Rnw 2010-03-11 01:57:51 UTC (rev 874)
@@ -190,7 +190,7 @@
Third, both inputs are converted to templated\footnote{C++ templates
allow functions or classes to be written somewhat independently from the
template parameter. The actual class is instantiated by the compiler
-by replacing occurences of the templated parameter(s).}
+by replacing occurrences of the templated parameter(s).}
C++ vector types, here a standard \code{double}
type is used to create a vector of doubles from the template type.
Fourth, the usefulness of these classes can be seen when we query the
@@ -350,7 +350,7 @@
\end{example}
This imposes on the programmer knowledge of \code{PROTECT}, \code{UNPROTECT},
-\code{SEXP}, \code{allocVector}, \code{SET\_STRING\_ELT}, \code{mkChar}.
+\code{SEXP}, \code{allocVector}, \code{SET\_STRING\_ELT}, and \code{mkChar}.
Using the \pkg{Rcpp::CharacterVector} class, we can express the same
code more concisely:
@@ -452,21 +452,21 @@
interchange data between C++ and R.
\begin{example}
-# assuming the global environment contains
-# a variable 'x' that is a numeric vector
+// assuming the global environment contains
+// a variable 'x' that is a numeric vector
Rcpp::Environment global =
\ \ \ \ Rcpp::Environment::global_env()
-# extract a std::vector<double> from
-# the global environment
+// extract a std::vector<double> from
+// the global environment
std::vector<double> vx = global["x"] ;
-# create a map<string,string>
+// create a map<string,string>
std::map<std::string,std::string> map ;
map["foo"] = "oof" ;
map["bar"] = "rab" ;
-# push the STL map to R
+// push the STL map to R
global["y"] = map ;
\end{example}
More information about the Rcpp-commits
mailing list