X
- the class of left-hand values for this comparator.Y
- the class of right-hand values for this comparator.public abstract class SkipExtendedComparator<X,Y> extends Object implements DerivableComparator<X,Y>
Constructor and Description |
---|
SkipExtendedComparator() |
Modifier and Type | Method and Description |
---|---|
abstract double |
actualCompare(X a,
Y b)
This has to return a distance between a and b with the following restrictions:
The return value has to lie between 0 and 1.
1 means maximum dissimilarity between a and b.
0 means maximum similarity between a and b (especially it should be true that a = b
implies a zero distance).
distance(a,b) should be equal or at least close to distance(b,a)
|
double |
compare(OperationType type,
X a,
Y b)
This method returns a dissimilarity between x and y using the alignment operation op with the
following restrictions:
compare(op,x,y) ≥ 0 (non-negativity)
compare(op,x,y) ≤ 1 (normalization)
x = y ⇒ compare(op,x,y) = 0 (equality)
Further, this function guarantees consistency with respect to null inputs, that is, for any
operation op ∈ {REPLACEMENT, DELETIONREPLACEMENT, INSERTIONREPLACEMENT} it holds:
d(op, x, null) = d(DELETION, x, null)
d(op, null, y) = d(INSERTION, null, y)
and for any operation it holds:
d(op, null, null) = 0
Please note that a and b might be null if this alignment uses gaps or
skips.
|
abstract Gradient |
computeComparisonGradient(X a,
Y b)
Computes the gradient of the comparator function w.r.t.
|
Gradient |
computeGradient(OperationType type,
X a,
Y b)
Computes the gradient of this comparator function w.r.t.
|
boolean |
equals(Object obj) |
abstract double[] |
getComparisonParameters()
Return the current value of all parameters of this comparator.
|
abstract int |
getNumberOfComparisonParameters()
Implementing classes should return the number of (derivative-relevant) parameters used for
the compare-function.
|
int |
getNumberOfParameters()
This shall return the number of parameters of this comparator.
|
double[] |
getParameters()
Return the current value of all parameters of this comparator.
|
boolean |
hasCoherentReplacementCost()
This method should return true if and only if this Comparator guarantees that
compare(OperationType.REPLACEMENT, x, y) =
compare(OperationType.DELETIONREPLACEMENT, x, y) =
compare(OperationType.INSERTIONREPLACEMENT, x, y)
for all possible inputs x, y.
|
int |
hashCode() |
abstract void |
setComparisonParameters(double[] params)
Sets the current value of all parameters of this comparator.
|
void |
setParameters(double[] params)
Sets the current value of all parameters of this comparator.
|
boolean |
supports(OperationType type)
This method should return true if and only if this Comparator supports the given alignment
operation.
|
public abstract double actualCompare(@NonNull X a, @NonNull Y b)
a
- the left input.b
- the right input.public abstract Gradient computeComparisonGradient(@NonNull X a, @NonNull Y b)
a
- the left input.b
- the right input.public abstract int getNumberOfComparisonParameters()
public abstract double[] getComparisonParameters()
public abstract void setComparisonParameters(@NonNull double[] params)
params
- the new value of all parameters of this comparator.public double compare(@NonNull OperationType type, X a, Y b)
Comparator
compare
in interface Comparator<X,Y>
type
- the type of alignment operation to be used.a
- the left input.b
- the right input.public boolean supports(@NonNull OperationType type)
Comparator
supports
in interface Comparator<X,Y>
type
- an alignment OperationType.public boolean hasCoherentReplacementCost()
Comparator
hasCoherentReplacementCost
in interface Comparator<X,Y>
public Gradient computeGradient(@NonNull OperationType type, X a, Y b)
DerivableComparator
computeGradient
in interface DerivableComparator<X,Y>
type
- the type of alignment operation to be useda
- the left input.b
- the right input.public int getNumberOfParameters()
DerivableComparator
getNumberOfParameters
in interface DerivableComparator<X,Y>
public double[] getParameters()
DerivableComparator
getParameters
in interface DerivableComparator<X,Y>
public void setParameters(@NonNull double[] params)
DerivableComparator
setParameters
in interface DerivableComparator<X,Y>
params
- the new value of all parameters of this comparator.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/