|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.matrix.AbstractMatrix
com.aliasi.matrix.ProximityMatrix
public class ProximityMatrix
A ProximityMatrix provides a pseudo-metric of proximities
between points. As a matrix, proximity matrices are symmetric, contain
only non-negative values and have 0.0 values on the diagonal.
Implementation Note: Proximity matrices are implemented as a wrapper around a triangular matrix of primitive double values without the diagonal values.
| Constructor Summary | |
|---|---|
ProximityMatrix(int numDimensions)
Construct a square proximity matrix of the specified dimensionality, with all values initially zero. |
|
| Method Summary | |
|---|---|
int |
numColumns()
Returns the number of columns for this matrix. |
int |
numRows()
Returns the number of rows for this matrix. |
void |
setValue(int row,
int column,
double value)
Sets the value for the specified row and column to the specified non-negative value as well as swapping row for column for symmetry. |
double |
value(int row,
int column)
Returns the value in this proximity matrix for the specified row and column. |
| Methods inherited from class com.aliasi.matrix.AbstractMatrix |
|---|
columnVector, equals, hashCode, rowVector |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProximityMatrix(int numDimensions)
numDimensions - Number of dimensions.| Method Detail |
|---|
public int numColumns()
numColumns in interface MatrixnumColumns in class AbstractMatrixpublic int numRows()
numRows in interface MatrixnumRows in class AbstractMatrix
public void setValue(int row,
int column,
double value)
setValue(i,j,x) sets the value
for row i and column j to
x as well as setting the value for row
j and column i to x.
setValue in interface MatrixsetValue in class AbstractMatrixrow - Matrix row.column - Matrix column.value - Value to set for row and column and reverse.
IllegalArgumentException - If the row and column are the
same or if the value is negative or not a number.
IndexOutOfBoundsException - If the row or column are less
than 0 or greater than the dimensionality of this proximity
matrix.
public double value(int row,
int column)
value in interface Matrixvalue in class AbstractMatrixrow - Specified row.column - Specified column.
IndexOutOfBoundsException - If the row or column are
negative or greater than or equal to the dimensionality of this
matrix.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||