public class ProximityMatrix extends AbstractMatrix
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 and Description |
|---|
ProximityMatrix(int numDimensions)
Construct a square proximity matrix of the specified
dimensionality, with all values initially zero.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
columnVector, equals, hashCode, rowVectorpublic ProximityMatrix(int numDimensions)
numDimensions - Number of dimensions.public int numColumns()
numColumns in interface MatrixnumColumns in class AbstractMatrixpublic int numRows()
numRows in interface MatrixnumRows in class AbstractMatrixpublic 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.Copyright © 2016 Alias-i, Inc.. All rights reserved.