public class SimilarityMatrix extends ReadWriteableMatrix implements ReadWriteable
| Modifier | Constructor and Description |
|---|---|
protected |
SimilarityMatrix()
Construct an empty similarity matrix.
|
|
SimilarityMatrix(int size)
Construct a similarity matrix with the given size
and allocate the index accordingly.
|
|
SimilarityMatrix(String[] index)
Construct a similarity matrix with the given index
and set the matrix size based on the index length.
|
|
SimilarityMatrix(String[] index,
double[][] data)
Construct a similarity matrix based on the given index
and matrix data.
|
|
SimilarityMatrix(String[] index,
Jama.Matrix data)
Construct a similarity matrix based on the given index
and matrix.
|
| Modifier and Type | Method and Description |
|---|---|
String |
asciiHeader()
Header for ascii input.
|
byte[] |
binaryHeader()
Header for binary input.
|
SimilarityMatrix |
clone() |
SimilarityMatrix |
copy() |
String[] |
getIndex()
Get the index
|
String |
getIndexValue(int i)
Get a value from the index
|
int |
indexOf(String value)
Get the offset in the index for a given value
|
SimilarityMatrix |
process(SimilarityMatrixProcessor proc)
Process a copy of this similarity matrix with the
given processor and return the copy.
|
SimilarityMatrix |
processInplace(SimilarityMatrixProcessor proc)
Process this matrix with the given processor.
|
void |
readASCII(Scanner in)
Read internal state from in.
|
void |
readBinary(DataInput in)
Read internal state from in.
|
void |
setIndexValue(int i,
String value)
Set the value of the index at a given offset
|
String |
toString() |
org.jgrapht.UndirectedGraph<String,org.jgrapht.graph.DefaultEdge> |
toUndirectedUnweightedGraph(double threshold)
Convert the similarity matrix to an unweighted, undirected
graph representation.
|
void |
writeASCII(PrintWriter out)
Write the content of this as ascii to out.
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
setDataarrayLeftDivide, arrayLeftDivideEquals, arrayRightDivide, arrayRightDivideEquals, arrayTimes, arrayTimesEquals, chol, cond, constructWithCopy, det, eig, get, getArray, getArrayCopy, getColumnDimension, getColumnPackedCopy, getMatrix, getMatrix, getMatrix, getMatrix, getRowDimension, getRowPackedCopy, identity, inverse, lu, minus, minusEquals, norm1, norm2, normF, normInf, plus, plusEquals, print, print, print, print, qr, random, rank, read, set, setMatrix, setMatrix, setMatrix, setMatrix, solve, solveTranspose, svd, times, times, timesEquals, trace, transpose, uminusprotected SimilarityMatrix()
public SimilarityMatrix(int size)
size - the size of the matrixpublic SimilarityMatrix(String[] index)
index - the index.public SimilarityMatrix(String[] index, Jama.Matrix data)
index - the indexdata - the matrixpublic SimilarityMatrix(String[] index, double[][] data)
index - the indexdata - the matrix datapublic int indexOf(String value)
value - the valuepublic void setIndexValue(int i, String value)
i - the offsetvalue - the valuepublic String getIndexValue(int i)
i - the offset into the indexpublic void readASCII(Scanner in) throws IOException
ReadableASCIIreadASCII in interface ReadableASCIIreadASCII in class ReadWriteableMatrixin - source to read from.IOException - an error reading inputpublic String asciiHeader()
ReadableASCIIasciiHeader in interface ReadableASCIIasciiHeader in interface WriteableASCIIasciiHeader in class ReadWriteableMatrixpublic void readBinary(DataInput in) throws IOException
ReadableBinaryreadBinary in interface ReadableBinaryreadBinary in class ReadWriteableMatrixin - source to read from.IOException - an error reading inputpublic byte[] binaryHeader()
ReadableBinarybinaryHeader in interface ReadableBinarybinaryHeader in interface WriteableBinarybinaryHeader in class ReadWriteableMatrixpublic void writeASCII(PrintWriter out) throws IOException
WriteableASCIIwriteASCII in interface WriteableASCIIwriteASCII in class ReadWriteableMatrixout - sink to write toIOException - an error writing to outpublic void writeBinary(DataOutput out) throws IOException
WriteableBinarywriteBinary in interface WriteableBinarywriteBinary in class ReadWriteableMatrixout - sink to write toIOException - an error writing to outpublic org.jgrapht.UndirectedGraph<String,org.jgrapht.graph.DefaultEdge> toUndirectedUnweightedGraph(double threshold)
threshold - the thresholdpublic SimilarityMatrix copy()
copy in class Jama.Matrixpublic SimilarityMatrix clone()
clone in class Jama.Matrixpublic SimilarityMatrix process(SimilarityMatrixProcessor proc)
proc - the processorpublic SimilarityMatrix processInplace(SimilarityMatrixProcessor proc)
proc - the processor