22 #ifndef Rcpp__vector__SubMatrix_h
23 #define Rcpp__vector__SubMatrix_h
36 iter( static_cast<
Vector<RTYPE>& >(m_).
begin() + row_range_.get_start() + col_range_.get_start() * m_.
nrow() ),
42 inline R_xlen_t
size()
const {
return ((R_xlen_t)
ncol()) *
nrow() ; }
43 inline int ncol()
const {
return nc ; }
44 inline int nrow()
const {
return nr ; }
58 template <
int RTYPE,
template <
class>
class StoragePolicy >
63 for(
int j=0; j<nc; j++){
65 for(
int i=0; i<
nrows; i++, ++start){
71 template <
int RTYPE,
template <
class>
class StoragePolicy >
73 int nc = sub.
ncol(), nr = sub.
nrow() ;
74 if( nc != nrow() || nr != ncol() ){
76 VECTOR::set__( Rf_allocMatrix( RTYPE, nr, nc ) ) ;
80 for(
int j=0; j<nc; j++){
82 for(
int i=0; i<nrows; i++, ++start){
89 #undef RCPP_WRAP_SUBMATRIX
90 #define RCPP_WRAP_SUBMATRIX(RTYPE) \
91 template<> inline SEXP wrap< SubMatrix<RTYPE> >( \
92 const SubMatrix<RTYPE>& object \
94 return Matrix<RTYPE>( object ) ; \
103 #undef RCPP_WRAP_SUBMATRIX
#define RCPP_WRAP_SUBMATRIX(RTYPE)
Matrix & operator=(const Matrix &other)
VECTOR::iterator iterator
Vector< RTYPE >::iterator vec_iterator
Proxy operator()(int i, int j) const
vec_iterator column_iterator(int j) const
SubMatrix(MATRIX &m_, const Range &row_range_, const Range &col_range_)
traits::r_vector_iterator< RTYPE, StoragePolicy >::type iterator