| 32 | typedef typename Rcpp::traits::storage_type<RTYPE>::type STORAGE ; |
| 33 | |
| 34 | Diag_Extractor( const MAT_TYPE& object_ ) : object(object_), n(0) { |
| 35 | int nr = object.nrow() ; |
| 36 | int nc = object.ncol() ; |
| 37 | n = (nc < nr ) ? nc : nr ; |
| 38 | } |
| 39 | |
| 40 | inline STORAGE operator[]( int i ) const { |
| 41 | return object( i, i ) ; |