| 169 | |
| 170 | template<typename I, typename V> |
| 171 | MatrixPtr<V> SparseMatrix<I,V>::rowBlock(SizeR range) const { |
| 172 | CHECK(rowMajor()); |
| 173 | CHECK(!range.empty()); |
| 174 | |
| 175 | auto new_offset = offset_.segment(SizeR(range.begin(), range.end()+1)); |
| 176 | |
| 177 | auto new_info = info_; |
| 178 | range.to(new_info.mutable_row()); |
| 179 | new_info.set_nnz(new_offset.back() - new_offset.front()); |
| 180 | |
| 181 | return MatrixPtr<V>(new SparseMatrix<I,V>(new_info, new_offset, index_, value_)); |
| 182 | // return static_cast<Matrix>(re); |
| 183 | } |
| 184 | |
| 185 | template<typename I, typename V> |
| 186 | MatrixPtr<V> SparseMatrix<I,V>::alterStorage() const { |