11 : num_cols_(mask[0].size()), col_idx_(), row_ptr_(mask.size()+1,0)
14 for (
unsigned int i=0; i<mask.size(); ++i){
15 const std::vector<bool>& col = mask[i];
41 int mid = (low+high)>>1;
73 int idx = (*this)(i,j);
int operator()(int i, int j) const
return the index at location (i,j).
Compressed Row Storage (CRS) indexing.
unsigned int num_cols_
The number of columns in the matrix.
int num_rows() const
number of rows in the sparse matrix.
sparse_vector sparse_row(int i) const
returns row i as a vector of index-column pairs.
sparse_vector sparse_col(int j) const
returns column j as a vector of index-row pairs.
vnl_crs_index()
Constructor - default.
std::pair< int, int > idx_pair
std::vector< idx_pair > sparse_vector
std::vector< int > row_ptr_
The index of the first non-zero element in each row.
std::vector< int > col_idx_
The column for each non-zero element.