X
- the node class for the left input.Y
- the node class for the right input.R
- the result class to be computed.public abstract class AbstractTreeEditAlgorithm<X,Y,R> extends Object implements TreeEditAlgorithm<X,Y,R>
Constructor and Description |
---|
AbstractTreeEditAlgorithm(Comparator<Tree<X>,Tree<Y>> comparator) |
Modifier and Type | Method and Description |
---|---|
Comparator<Tree<X>,Tree<Y>> |
getComparator()
This should return the Comparator d used to compute the operation costs for this
TreeEditAlgorithm.
|
static double |
min(double... C)
Computes the minimum of the given input values.
|
static int |
min(int... C)
Computes the minimum of the given input values.
|
boolean |
requires(OperationType type)
This method should return true if and only if this AlignmentAlgorithm uses the given
operation.
|
void |
setComparator(Comparator<Tree<X>,Tree<Y>> comparator)
This should set the Comparator used to compute the operation costs for this
TreeEditAlgorithm.
|
static int |
worstCaseDistance(int[] X_r,
int[] Y_r,
int[] X_kr,
int[] Y_kr)
Computes the worst-case tree edit distance between two trees, if a comparator would be used
that always returns 1.
|
static <X,Y> int |
worstCaseDistance(Tree<X> X,
Tree<Y> Y)
Computes the worst-case tree edit distance between two trees X and Y, if a comparator would
be used that always returns 1.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
calculateAlignment, getResultClass
public AbstractTreeEditAlgorithm(@NonNull Comparator<Tree<X>,Tree<Y>> comparator)
public Comparator<Tree<X>,Tree<Y>> getComparator()
TreeEditAlgorithm
getComparator
in interface TreeEditAlgorithm<X,Y,R>
public void setComparator(Comparator<Tree<X>,Tree<Y>> comparator)
TreeEditAlgorithm
setComparator
in interface TreeEditAlgorithm<X,Y,R>
comparator
- the comparator that is used to compute the operation costs for this
TreeEditAlgorithm.public static double min(double... C)
C
- an array of input values.public static int min(int... C)
C
- an array of input values.public static <X,Y> int worstCaseDistance(Tree<X> X, Tree<Y> Y)
X
- the label class for X.Y
- the label class for Y.X
- the left input tree.Y
- the right input tree.public static int worstCaseDistance(@NonNull int[] X_r, @NonNull int[] Y_r, @NonNull int[] X_kr, @NonNull int[] Y_kr)
X_r
- an m x 1 array of outermost right descendant indices, where X_r[i] is the
index of the outermost right descendant of node xi in X according to the pre-order
sequence.Y_r
- an n x 1 array of outermost right descendant indices, where Y_r[j] is the
index of the outermost right descendant of node yj in Y according to the pre-order
sequence.X_kr
- an m_l x 1 array of key-root indices for each leaf in X, sorted in
descending orderY_kr
- an m_r x 1 array of key-roots for each leaf in Y, sorted in
descending orderpublic final boolean requires(@NonNull OperationType type)
TreeEditAlgorithm
requires
in interface TreeEditAlgorithm<X,Y,R>
type
- an OperationType.Copyright (C) 2016-2018 Benjamin Paaßen, AG Theoretical Computer Science, Centre of Excellence Cognitive Interaction Technology (CITEC), University of Bielefeld, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/tcs . This documentation is licensed under the conditions of CC-BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/