6import static org.junit.Assert.*;
19 assertSame(m.
nnz(),9);
23 assertSame(m.
nnz(),4);
24 assertSame(m.
get(1,1),1); assertSame(m.
get(1,3),7);
25 assertSame(m.
get(3,1),3); assertSame(m.
get(3,3),9);
34 m.
set(2,1,2); m.
set(2,2,4);
37 assertSame(m.
nnz(),9);
41 assertSame(m.
nnz(),4);
42 assertSame(m.
get(1,1),1); assertSame(m.
get(1,3),3);
43 assertSame(m.
get(3,1),3); assertSame(m.
get(3,3),6);
46 public static void main(String args[]) {
47 org.junit.runner.JUnitCore.main(
"aud.test.AdjacencyMatrixTest");
void clearColumnAndRow(int idx)
Set all entries in row idx and column idx to null.
T get(int i, int j)
get entry (i,j) [O(log(nnz))]
int nnz()
get number of nonzero entries
T set(int i, int j, T data)
Set entry (i,j) to data [O(log(nnz))].
boolean isSymmetricMatrix()
Was matrix created explicitly as symmetric matrix?
static void main(String args[])
void testSymmatrixMatrix()
Graph data structures and algorithms.
AuD lecture: Data structures, algorithms, examples.