| 35 | typedef typename MATRIX::const_iterator const_iterator ; |
| 36 | |
| 37 | MatrixColumn( MATRIX& parent, int i ) : |
| 38 | n(parent.nrow()), |
| 39 | start(parent.begin() + static_cast<R_xlen_t>(i) * n ), |
| 40 | const_start(const_cast<const MATRIX&>(parent).begin() + static_cast<R_xlen_t>(i) * n) |
| 41 | { |
| 42 | if( i < 0 || i >= parent.ncol() ) { |
| 43 | const char* fmt = "Column index is out of bounds: " |
| 44 | "[index=%i; column extent=%i]."; |
| 45 | throw index_out_of_bounds(fmt, i, parent.ncol()) ; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | MatrixColumn( const MATRIX& parent, int i ) : |
| 50 | n(parent.nrow()), |