| 57 | return (int) dims.size() ; |
| 58 | } |
| 59 | inline R_xlen_t prod() const { |
| 60 | return std::accumulate( dims.begin(), dims.end(), static_cast<R_xlen_t>(1), std::multiplies<R_xlen_t>() ); |
| 61 | } |
| 62 | |
| 63 | inline reference operator[](int i){ |
| 64 | if( i < 0 || i>=static_cast<int>(dims.size()) ) throw std::range_error("index out of bounds") ; |