|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object databionics.math.Distances
public class Distances
Computes all pairwise distances between row vectors of a DoubleMatrix2D. In contrast to Statistic.distance the values are stored in a DoubeArrayList of length N(N-1)/2 rather than in a DoubleMatrix2D.
Field Summary | |
---|---|
protected cern.colt.matrix.DoubleMatrix1D[] |
data
|
protected cern.colt.matrix.DoubleMatrix2D |
data2d
|
protected cern.colt.function.VectorVectorFunction |
distanceFunction
|
protected cern.colt.matrix.DoubleMatrix1D |
distances
|
protected static org.apache.log4j.Logger |
log
|
protected int |
n
|
Constructor Summary | |
---|---|
Distances()
|
Method Summary | |
---|---|
protected void |
calculateDistances()
|
double |
get(int i,
int j)
Get the distance between row i and j of the original data matrix |
cern.colt.matrix.DoubleMatrix2D |
getData()
|
cern.colt.function.VectorVectorFunction |
getDistanceFunction()
|
cern.colt.matrix.DoubleMatrix2D |
getDistanceMatrix()
getting the pairwise distances from matrix/vector set in setData(). |
cern.colt.matrix.DoubleMatrix1D |
getDistances()
getting the pairwise distances from matrix/vector invoked in setData(). |
void |
set(int i,
int j,
double d)
set distance between i and j to d |
void |
setData(cern.colt.matrix.DoubleMatrix1D d)
|
void |
setData(cern.colt.matrix.DoubleMatrix1D[] d)
|
void |
setData(cern.colt.matrix.DoubleMatrix2D d)
|
void |
setDistanceFunction(cern.colt.function.VectorVectorFunction d)
set the function to calculate distances. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.log4j.Logger log
protected cern.colt.function.VectorVectorFunction distanceFunction
protected cern.colt.matrix.DoubleMatrix2D data2d
protected cern.colt.matrix.DoubleMatrix1D[] data
protected cern.colt.matrix.DoubleMatrix1D distances
protected int n
Constructor Detail |
---|
public Distances()
Method Detail |
---|
public cern.colt.matrix.DoubleMatrix1D getDistances() throws java.lang.NullPointerException
java.lang.NullPointerException
public cern.colt.matrix.DoubleMatrix2D getDistanceMatrix() throws java.lang.NullPointerException
java.lang.NullPointerException
public double get(int i, int j) throws java.lang.NullPointerException
i
- row number of first data vectorj
- row number of second data vector
java.lang.NullPointerException
public void setDistanceFunction(cern.colt.function.VectorVectorFunction d)
VectorVectorFunction
- distanceFunctionpublic cern.colt.function.VectorVectorFunction getDistanceFunction()
public void setData(cern.colt.matrix.DoubleMatrix2D d)
public void setData(cern.colt.matrix.DoubleMatrix1D d)
public void setData(cern.colt.matrix.DoubleMatrix1D[] d)
public void set(int i, int j, double d)
i
- j
- d
- protected void calculateDistances()
public cern.colt.matrix.DoubleMatrix2D getData() throws java.lang.NullPointerException
java.lang.NullPointerException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |