|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.intel.hadoop.graphbuilder.graph.glgraph.SparseGraphStruct
public class SparseGraphStruct
A dense data structure of a sparse matrix: (Compressed Sparse Row)
://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_row_.28CSR_or_CRS
.29
. This class only represents the zero/non-zero structure of the matrix,
and the actual entry data, if any, should be stored separately as a list
elsewhere.
Constructor Summary | |
---|---|
SparseGraphStruct(int n)
Initialize a n by n empty matrix. |
|
SparseGraphStruct(int numVertices,
java.util.List<java.lang.Integer> sources,
java.util.List<java.lang.Integer> targets)
Initialize a n by n matrix, with entries encoded by a source array and target array. |
Method Summary | |
---|---|
int |
begin(int row)
|
void |
clear()
Clear the matrix. |
int |
end(int row)
|
java.util.List<java.lang.Integer> |
getColIndex()
|
java.util.List<java.lang.Integer> |
getRowIndex()
|
int |
numEdges()
|
int |
numVertices()
|
net.minidev.json.JSONObject |
toJSONObj()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SparseGraphStruct(int n)
n
- the size of the square matrix.public SparseGraphStruct(int numVertices, java.util.List<java.lang.Integer> sources, java.util.List<java.lang.Integer> targets)
n
- the size of the square matrix.sources
- the list of source ids.targets
- the list of target ids.Method Detail |
---|
public int numEdges()
public int numVertices()
public int begin(int row)
row
-
public int end(int row)
row
-
public void clear()
public java.util.List<java.lang.Integer> getRowIndex()
public java.util.List<java.lang.Integer> getColIndex()
public net.minidev.json.JSONObject toJSONObj()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |