21#ifndef Rcpp__vector__SubMatrix_h
22#define Rcpp__vector__SubMatrix_h
35 iter( static_cast<
Vector<RTYPE>& >(m_).
begin() + row_range_.get_start() + col_range_.get_start() * m_.
nrow() ),
41 inline R_xlen_t
size()
const {
return ((R_xlen_t)
ncol()) *
nrow() ; }
42 inline R_xlen_t
ncol()
const {
return nc ; }
43 inline R_xlen_t
nrow()
const {
return nr ; }
57template <
int RTYPE,
template <
class>
class StoragePolicy >
59 R_xlen_t nc = sub.
ncol() ;
62 for( R_xlen_t j=0; j<nc; j++){
64 for(
int i=0; i<
nrows; i++, ++start){
70template <
int RTYPE,
template <
class>
class StoragePolicy >
72 int nc = sub.
ncol(), nr = sub.
nrow() ;
75 VECTOR::set__( Rf_allocMatrix( RTYPE, nr, nc ) ) ;
79 for(
int j=0; j<nc; j++){
81 for(
int i=0; i<
nrows; i++, ++start){
88#undef RCPP_WRAP_SUBMATRIX
89#define RCPP_WRAP_SUBMATRIX(RTYPE) \
90template<> inline SEXP wrap< SubMatrix<RTYPE> >( \
91 const SubMatrix<RTYPE>& object \
93 return Matrix<RTYPE>( object ) ; \
102#undef RCPP_WRAP_SUBMATRIX
#define RCPP_WRAP_SUBMATRIX(RTYPE)
Vector< RTYPE, StoragePolicy > VECTOR
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