[Rcpp-commits] r835 - pkg/RcppExamples/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Mar 4 22:14:37 CET 2010
Author: edd
Date: 2010-03-04 22:14:36 +0100 (Thu, 04 Mar 2010)
New Revision: 835
Modified:
pkg/RcppExamples/src/RcppMatrixExample.cpp
Log:
correction to RcppMatrix creation
Modified: pkg/RcppExamples/src/RcppMatrixExample.cpp
===================================================================
--- pkg/RcppExamples/src/RcppMatrixExample.cpp 2010-03-04 15:54:06 UTC (rev 834)
+++ pkg/RcppExamples/src/RcppMatrixExample.cpp 2010-03-04 21:14:36 UTC (rev 835)
@@ -25,8 +25,8 @@
RcppExport SEXP newRcppMatrixExample(SEXP matrix) {
- Rcpp::NumericMatrix mat(matrix); // creates Rcpp matrix from SEXP
- Rcpp::NumericMatrix orig(matrix); // keep a copy
+ Rcpp::NumericMatrix orig(matrix); // creates Rcpp matrix from SEXP
+ Rcpp::NumericMatrix mat(orig.nrow(), orig.ncol()); // keep a copy
// we could query size via
// int n = mat.nrow(), k=mat.ncol();
More information about the Rcpp-commits
mailing list