[Rcpp-commits] r2599 - pkg/RcppGSL/inst/doc/RcppGSL
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Nov 29 18:25:11 CET 2010
Author: edd
Date: 2010-11-29 18:25:11 +0100 (Mon, 29 Nov 2010)
New Revision: 2599
Modified:
pkg/RcppGSL/inst/doc/RcppGSL/RcppGSL.Rnw
Log:
updated vignette to new implicit converter to GSL type
Modified: pkg/RcppGSL/inst/doc/RcppGSL/RcppGSL.Rnw
===================================================================
--- pkg/RcppGSL/inst/doc/RcppGSL/RcppGSL.Rnw 2010-11-29 17:20:52 UTC (rev 2598)
+++ pkg/RcppGSL/inst/doc/RcppGSL/RcppGSL.Rnw 2010-11-29 17:25:11 UTC (rev 2599)
@@ -426,12 +426,11 @@
\label{tab:mappingVectorViews}
\end{table}
-The \texttt{getVector()} member function returns the underlying vector stored
-in the vector view class. This enables use of vector views where \pkg{GSL}
-would expect a vector.
+The vector view class also contains a conversion operator to automatically
+transform the data of the view object to a \pkg{GSL} vector object. This
+enables use of vector views where \pkg{GSL} would expect a vector.
-
\section{Matrices}
The \pkg{GSL} also defines a set of matrix data types : \texttt{gsl\_matrix},
@@ -500,8 +499,8 @@
\subsection{Matrix views}
Similar to the vector views discussed above, the \pkg{RcppGSL} also provides
-view variants of matrices. Here, the \texttt{getMatrix()} member function
-returns the underlying matrix stored in the matrix view class.
+an implicit conversion operator which returns the underlying matrix stored in
+the matrix view class.
\section{Using \pkg{RcppGSL} in your package}
@@ -580,7 +579,7 @@
for (int j = 0; j < k; j++) {
RcppGSL::vector_view<double> colview = gsl_matrix_column (M, j);
- n[j] = gsl_blas_dnrm2(colview.vector_ );
+ n[j] = gsl_blas_dnrm2(colview);
}
M.free() ;
return n; // return vector
@@ -655,7 +654,7 @@
for (int j = 0; j < k; j++) {
RcppGSL::vector_view<double> colview = gsl_matrix_column (M, j);
- n[j] = gsl_blas_dnrm2(colview.getVector());
+ n[j] = gsl_blas_dnrm2(colview);
}
M.free() ;
return n; // return vector
More information about the Rcpp-commits
mailing list