![]() |
AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
|
Sparse adjacency matrix. More...
Inheritance diagram for aud.graph.AdjacencyMatrix< Edge >:
Collaboration diagram for aud.graph.AdjacencyMatrix< Edge >:Public Member Functions | |
| AdjacencyMatrix (boolean symmetric) | |
| create empty matrix More... | |
| void | clearColumnAndRow (int idx) |
Set all entries in row idx and column idx to null. More... | |
| Iterator< Edge > | iterator () |
| Get iterator over all edges. More... | |
Public Member Functions inherited from aud.graph.matrix.SparseMatrix< T > | |
| SparseMatrix () | |
| create empty matrix More... | |
| SparseMatrix (boolean symmetric) | |
create empty matrix (see isSymmetricMatrix) More... | |
| SparseMatrix (SparseMatrix< T > other) | |
| copy constructor More... | |
| SparseMatrix (SparseMatrix< T > other, boolean transpose) | |
| copy constructor More... | |
| boolean | isSymmetricMatrix () |
| Was matrix created explicitly as symmetric matrix? More... | |
| int | getNumRows () |
| computed from maximum column index [O(1)] More... | |
| int | getMinRowIndex () |
| get minimum column index [O(1)] More... | |
| T | set (int i, int j, T data) |
Set entry (i,j) to data [O(log(nnz))]. More... | |
| Vector< T > | getRowEntries (int i) |
| get entries in row i as array More... | |
| int[] | getRowColumnIndices (int i) |
| get column indices in row i as array More... | |
| int | rowDegree (int i) |
| get number of nonzero entries in row i More... | |
| SparseMatrixCS< T > | getTransposed () |
| get transposed matrix More... | |
Public Member Functions inherited from aud.graph.matrix.SparseMatrixCS< T > | |
| SparseMatrixCS () | |
| create empty matrix with "arbitrarily growing" dimensions More... | |
| SparseMatrixCS (SparseMatrixCS< T > other) | |
| copy constructor More... | |
| int | nnz () |
| get number of nonzero entries More... | |
| int | getNumRows () |
computes from maximium row index [O(nnz)] More... | |
| int | getMinRowIndex () |
get minimum row index [O(nnz)] More... | |
| int | getNumColumns () |
| computed from maximum column index [O(1)] More... | |
| int | getMinColumnIndex () |
| get minimum row index [O(1)] More... | |
| T | get (int i, int j) |
get entry (i,j) [O(log(nnz))] More... | |
| T | set (int i, int j, T data) |
Set entry (i,j) to data [O(log(nnz))]. More... | |
| Vector< T > | getColumnEntries (int j) |
| get entries in column j as array More... | |
| int[] | getColumnRowIndices (int j) |
| get row indices in column j as array More... | |
| int | columnDegree (int j) |
| get number of nonzero entries in column j More... | |
| SparseMatrixCS< T > | getTransposed () |
| get transposed matrix More... | |
| SparseMatrixCS< Integer > | spones () |
| Get nonzero pattern. More... | |
| int[] | getRowIndices () |
| Get array of row indices. More... | |
| int[] | getColumnIndices () |
Get array of column indices in same order as for getRowIndices. More... | |
| T[] | getValues () |
Get array of values in same order as for getRowIndices. More... | |
| String | toString () |
| String | toLaTeX (String name) |
| get LaTeX code for displaying (TikZ) matrix More... | |
| File | renderSpySVG (File svgfile, Colormap< T > colormap) |
| String | spyTikZ (boolean rulers, Colormap< T > colormap) |
| SVGViewer | spy (String caption, Colormap< T > colormap) |
| render spy plot in new window More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from aud.graph.matrix.SparseMatrix< T > | |
| static void | main (String args[]) |
Example and test: show aud.util.ColormapCount color map. More... | |
Protected Attributes inherited from aud.graph.matrix.SparseMatrix< T > | |
| SparseMatrixCS< T > | rmat_ = null |
| Store transposed. More... | |
Protected Attributes inherited from aud.graph.matrix.SparseMatrixCS< T > | |
| TreeMap< Coordinate, T > | mat_ |
Sparse adjacency matrix.
| <Edge> | edge data |
Definition at line 14 of file AdjacencyMatrix.java.
| aud.graph.AdjacencyMatrix< Edge >.AdjacencyMatrix | ( | boolean | symmetric | ) |
create empty matrix
Definition at line 19 of file AdjacencyMatrix.java.
| void aud.graph.AdjacencyMatrix< Edge >.clearColumnAndRow | ( | int | idx | ) |
Set all entries in row idx and column idx to null.
Note that this method does not shift indices (coordinates) but only "overwrites" existing entries.
Definition at line 27 of file AdjacencyMatrix.java.
References aud.graph.matrix.SparseMatrixCS< T >.getColumnRowIndices(), aud.graph.matrix.SparseMatrix< T >.getRowColumnIndices(), and aud.graph.matrix.SparseMatrix< T >.isSymmetricMatrix().
Referenced by aud.test.AdjacencyMatrixTest.testMatrix(), and aud.test.AdjacencyMatrixTest.testSymmatrixMatrix().
Here is the call graph for this function:
Here is the caller graph for this function:| Iterator< Edge > aud.graph.AdjacencyMatrix< Edge >.iterator | ( | ) |
Get iterator over all edges.
For a symmetric matrix, every (undirected) edges is enumerated only once.
Definition at line 44 of file AdjacencyMatrix.java.
References aud.graph.matrix.Coordinate.i, aud.graph.matrix.SparseMatrix< T >.isSymmetricMatrix(), aud.graph.matrix.Coordinate.j, and aud.graph.matrix.SparseMatrixCS< T >.mat_.
Here is the call graph for this function: