[Rcpp-commits] r2578 - in pkg/RcppGSL/inst: examples/RcppGSLExample/src include
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Nov 29 05:57:54 CET 2010
Author: edd
Date: 2010-11-29 05:57:54 +0100 (Mon, 29 Nov 2010)
New Revision: 2578
Modified:
pkg/RcppGSL/inst/examples/RcppGSLExample/src/colNorm.cpp
pkg/RcppGSL/inst/include/RcppGSLForward.h
Log:
for new, revert back to vector_ and matrix_ as public elements of vector_view
/ matrix_view. Maybe we need to hide these as private and use inline getters
vector() and matrix() ?
Modified: pkg/RcppGSL/inst/examples/RcppGSLExample/src/colNorm.cpp
===================================================================
--- pkg/RcppGSL/inst/examples/RcppGSLExample/src/colNorm.cpp 2010-11-29 04:56:52 UTC (rev 2577)
+++ pkg/RcppGSL/inst/examples/RcppGSLExample/src/colNorm.cpp 2010-11-29 04:57:54 UTC (rev 2578)
@@ -36,7 +36,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.vector_ );
}
M.free() ;
return n; // return vector
Modified: pkg/RcppGSL/inst/include/RcppGSLForward.h
===================================================================
--- pkg/RcppGSL/inst/include/RcppGSLForward.h 2010-11-29 04:56:52 UTC (rev 2577)
+++ pkg/RcppGSL/inst/include/RcppGSLForward.h 2010-11-29 04:57:54 UTC (rev 2578)
@@ -130,17 +130,17 @@
typedef typename vector_view_type<T>::type view_type ;
typedef typename vector<T>::Proxy Proxy ;
- vector_view( view_type view_ ) : view(view_), vector(&view_.vector) {}
+ vector_view( view_type view_ ) : view(view_), vector_(&view_.vector) {}
inline operator view_type(){ return view ; }
inline Proxy operator[]( int i){
- return vector[i] ;
+ return vector_[i] ;
}
- inline iterator begin(){ return vector.begin() ; }
- inline iterator end(){ return vector.end() ; }
- inline size_t size(){ return vector.size(); }
+ inline iterator begin(){ return vector_.begin() ; }
+ inline iterator end(){ return vector_.end() ; }
+ inline size_t size(){ return vector_.size(); }
view_type view ;
- VEC vector ;
+ VEC vector_ ;
} ;
template <typename T> class matrix_view {
@@ -151,17 +151,17 @@
typedef typename matrix_view_type<T>::type view_type ;
typedef typename matrix<T>::Proxy Proxy ;
- matrix_view( view_type view_ ) : view(view_), matrix(&view_.matrix) {}
+ matrix_view( view_type view_ ) : view(view_), matrix_(&view_.matrix) {}
inline operator view_type(){ return view; }
inline Proxy operator()(int row, int col){
- return matrix(row,col);
+ return matrix_(row,col);
}
- inline size_t nrow(){ return matrix.nrow() ; }
- inline size_t ncol(){ return matrix.ncol() ; }
- inline size_t size(){ return matrix.size() ; }
+ inline size_t nrow(){ return matrix_.nrow() ; }
+ inline size_t ncol(){ return matrix_.ncol() ; }
+ inline size_t size(){ return matrix_.size() ; }
view_type view ;
- MAT matrix ;
+ MAT matrix_ ;
} ;
}
More information about the Rcpp-commits
mailing list