VPTissue Reference Manual
|
Represents a binary matrix with n rows and m columns in a Compressed Sparse Row representation. More...
#include <CSRMatrix.h>
Public Attributes | |
std::vector< int > | col_ind |
Indices of columns that have nonzeros in a row. | |
std::vector< std::size_t > | row_ptr |
Indices to col_ind elements where rows start. | |
Represents a binary matrix with n rows and m columns in a Compressed Sparse Row representation.
All nonzero values are implicitly one (or true).
Example: A = [.x..] where . is a zero (false) and x is a nonzero (1 or true) [..x.] [.x.x] [x..x] [xxx.]
#rows, #columns = 5, 4 number of nonzeros = 9 col_ind = [1, 2, 1, 3, 0, 3, 0, 1, 2] length(col_ind) = 9 (= #nonzeros) row_ptr = [0, 1, 2, 4, 6, 9] length(row_ptr) = 6 (= #rows + 1)
Note that the number of nonzeros of a row i equals row_ptr[i+1] - row_ptr[i]
Definition at line 52 of file CSRMatrix.h.