java.lang.Object
org.jgrapht.opt.graph.sparse.specifics.CSRBooleanMatrix
- All Implemented Interfaces:
Serializable
A sparse boolean matrix in Compressed Sparse Row (CSR) format.
This is a helper class for graph representation and thus does not provide a fully fledged matrix.
- Author:
- Dimitrios Michail
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCSRBooleanMatrix(int rows, int columns, List<Pair<Integer, Integer>> entries) Create a new CSR boolean matrix -
Method Summary
Modifier and TypeMethodDescriptionintcolumns()Get the number of columns of the matrix.intnonZeros(int row) Get the number of non-zero entries of a row.nonZerosPositionIterator(int row) Get an iterator over the non-zero entries of a row.nonZerosSet(int row) Get the position of non-zero entries of a row as a set.introws()Get the number of rows of the matrix.
-
Constructor Details
-
CSRBooleanMatrix
Create a new CSR boolean matrix- Parameters:
rows- the number of rowscolumns- the number of columnsentries- the position of the entries of the matrix
-
-
Method Details
-
columns
public int columns()Get the number of columns of the matrix.- Returns:
- the number of columns
-
rows
public int rows()Get the number of rows of the matrix.- Returns:
- the number of rows
-
nonZeros
public int nonZeros(int row) Get the number of non-zero entries of a row.- Parameters:
row- the row- Returns:
- the number of non-zero entries of a row
-
nonZerosPositionIterator
Get an iterator over the non-zero entries of a row.- Parameters:
row- the row- Returns:
- an iterator over the non-zero entries of a row
-
nonZerosSet
Get the position of non-zero entries of a row as a set.- Parameters:
row- the row- Returns:
- the position of non-zero entries of a row as a set.
-