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.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int[]
private int
private static final Comparator
<Pair<Integer, Integer>> private int[]
private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionCSRBooleanMatrix
(int rows, int columns, List<Pair<Integer, Integer>> entries) Create a new CSR boolean matrix -
Method Summary
Modifier and TypeMethodDescriptionint
columns()
Get the number of columns of the matrix.int
nonZeros
(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.int
rows()
Get the number of rows of the matrix.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
INTEGER_PAIR_LEX_COMPARATOR
-
columns
private int columns -
rowOffsets
private int[] rowOffsets -
columnIndices
private int[] columnIndices
-
-
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.
-