1package aud.graph.matrix;
62 return rmat_.getNumColumns();
66 return rmat_.getMinColumnIndex();
69 @Override
public T
set(
int i,
int j,T data) {
71 v=super.set(i,j,data);
72 vr=
rmat_._set(j,i,data);
73 assert(v==vr || i==j);
81 return rmat_.getColumnEntries(i);
88 return rmat_.getColumnRowIndices(i);
106 public static void main(String args[]) {
130 m.
spy(
"colormap",colormap);
132 System.out.println(m.
spyTikZ(
true,colormap));
Implementation of an array-based vector.
Simple sparse matrix data structure.
SVGViewer spy(String caption, Colormap< T > colormap)
render spy plot in new window
String spyTikZ(boolean rulers, Colormap< T > colormap)
Simple sparse matrix data structure.
int getMinRowIndex()
get minimum column index [O(1)]
int getNumRows()
computed from maximum column index [O(1)]
T set(int i, int j, T data)
Set entry (i,j) to data [O(log(nnz))].
Vector< T > getRowEntries(int i)
get entries in row i as array
SparseMatrixCS< T > getTransposed()
get transposed matrix
boolean isSymmetricMatrix()
Was matrix created explicitly as symmetric matrix?
SparseMatrixCS< T > rmat_
Store transposed.
static void main(String args[])
Example and test: show aud.util.ColormapCount color map.
int rowDegree(int i)
get number of nonzero entries in row i
SparseMatrix(SparseMatrix< T > other, boolean transpose)
copy constructor
SparseMatrix(boolean symmetric)
create empty matrix (see isSymmetricMatrix)
SparseMatrix()
create empty matrix
SparseMatrix(SparseMatrix< T > other)
copy constructor
int[] getRowColumnIndices(int i)
get column indices in row i as array
color map for (small) positive integer counts
simple interface for color map
utilities (not related to AuD lecture)
AuD lecture: Data structures, algorithms, examples.