[Rcpp-commits] r2442 - pkg/Rcpp/inst/include/Rcpp/vector
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Nov 17 14:01:36 CET 2010
Author: romain
Date: 2010-11-17 14:01:36 +0100 (Wed, 17 Nov 2010)
New Revision: 2442
Modified:
pkg/Rcpp/inst/include/Rcpp/vector/Matrix.h
Log:
more subsetting
Modified: pkg/Rcpp/inst/include/Rcpp/vector/Matrix.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/Matrix.h 2010-11-17 12:55:04 UTC (rev 2441)
+++ pkg/Rcpp/inst/include/Rcpp/vector/Matrix.h 2010-11-17 13:01:36 UTC (rev 2442)
@@ -155,7 +155,15 @@
return SubMatrix<RTYPE>( const_cast<Matrix&>(*this), row_range, col_range ) ;
}
+ inline SubMatrix<RTYPE> operator()( internal::NamedPlaceHolder, const Range& col_range){
+ return SubMatrix<RTYPE>( const_cast<Matrix&>(*this), Range(0,nrow()-1) , col_range ) ;
+ }
+ inline SubMatrix<RTYPE> operator()( const Range& row_range, internal::NamedPlaceHolder ){
+ return SubMatrix<RTYPE>( const_cast<Matrix&>(*this), row_range, Range(0,ncol()-1) ) ;
+ }
+
+
private:
inline int offset( int i, int j) const {
More information about the Rcpp-commits
mailing list