de.unibi.techfak.jpredictor.clustering
Class MatrixRelationMeasure

java.lang.Object
  extended by de.unibi.techfak.jpredictor.clustering.RelationMeasure
      extended by de.unibi.techfak.jpredictor.clustering.MatrixRelationMeasure
All Implemented Interfaces:
Computable, java.lang.Comparable
Direct Known Subclasses:
MatrixAlignment, MatrixSimilarity

public abstract class MatrixRelationMeasure
extends RelationMeasure

Superclass for all relations defined on two or more matrices filled with numerical values. A matrix in this sense is a collection of arrays.


Field Summary
(package private)  java.util.Vector matrixList
          The list of matrices.
 
Fields inherited from class de.unibi.techfak.jpredictor.clustering.RelationMeasure
computationResult
 
Fields inherited from interface de.unibi.techfak.jpredictor.clustering.Computable
COMPUTATION_FAILED, COMPUTATION_PENDING, COMPUTATION_SUCCESS, COMPUTATION_WAITING
 
Constructor Summary
MatrixRelationMeasure()
           
 
Method Summary
 boolean add(double[][] v, boolean clone)
          Adds a matrix of double values to this class.
 boolean add(java.util.Vector v)
          Adds a matrix to this class.
 void clear()
          Empties the list of matrices in this class.
 int length()
          Returns the length of the last matrix added to this measure.
 int lengthRow()
          Returns the length of one row of the last matrix added to this measure.
 
Methods inherited from class de.unibi.techfak.jpredictor.clustering.RelationMeasure
atomicCombine, atomicCombine, atomicNormalize, compareTo, newInstance, optimum, optimum, result, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.unibi.techfak.jpredictor.clustering.Computable
compute
 

Field Detail

matrixList

java.util.Vector matrixList
The list of matrices. Every matrices is added through a call to one of the add methods. The type of every matrices is double[][].

Constructor Detail

MatrixRelationMeasure

public MatrixRelationMeasure()
Method Detail

clear

public void clear()
Empties the list of matrices in this class. After invoking this method every call to compute() will fail. Nevertheless, the result is not cleared.


length

public int length()
Returns the length of the last matrix added to this measure.

Returns:
The length of the last matrix added to this class, -1 in case no matrix was added yet.

lengthRow

public int lengthRow()
Returns the length of one row of the last matrix added to this measure.

Returns:
The length of one row of the last matrix added to this class, or -1, in case no matrix was added yet.

add

public boolean add(double[][] v,
                   boolean clone)
Adds a matrix of double values to this class.

Parameters:
v - The matrix to be added.
clone - Whether or not the matrix is to be deep cloned.
Returns:
true if the matrix was added, false otherwise

add

public boolean add(java.util.Vector v)
Adds a matrix to this class. The matrix is organized as a Vector of either other Vectors which hold Numbers or of arrays of ints or doubles. Both, even mixed, is possible and will be recognized by this method. Note, that column vectors or arrays, respectively, must be of the same size, otherwise the matrix is not inserted and false is returned.

Parameters:
v - The matrix to be added, which contains of double or int arrays or of Vectors of Numbers.
Returns:
true if the matrix was added, false otherwise
See Also:
Number