[Rcpp-commits] r552 - pkg/src/Rcpp/internal
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Feb 1 22:03:12 CET 2010
Author: romain
Date: 2010-02-01 22:03:12 +0100 (Mon, 01 Feb 2010)
New Revision: 552
Modified:
pkg/src/Rcpp/internal/wrap.h
Log:
some more documentation
Modified: pkg/src/Rcpp/internal/wrap.h
===================================================================
--- pkg/src/Rcpp/internal/wrap.h 2010-02-01 21:00:18 UTC (rev 551)
+++ pkg/src/Rcpp/internal/wrap.h 2010-02-01 21:03:12 UTC (rev 552)
@@ -49,7 +49,11 @@
template <int RTYPE,typename CTYPE> CTYPE get_zero(){ return static_cast<CTYPE>(0) ; } ;
template<> Rcomplex get_zero<CPLXSXP,Rcomplex>() ;
-// initializes a vector. The template does nothing because there is
+/**
+ * Initializes a vector of the given SEXP type. The template fills the
+ * vector with the value 0 of the appropriate type, for example
+ * an INTSXP vector is initialized with (int)0, etc...
+ */
template<int RTYPE> void r_init_vector(SEXP x){
typedef ::Rcpp::traits::storage_type<RTYPE>::type CTYPE ;
CTYPE* start=r_vector_start<RTYPE>(x) ;
More information about the Rcpp-commits
mailing list