V
- the value type this Comparator is defined on.public abstract class SkipExtendedComparator<V extends Value> extends Object implements SkipComparator<V>, SparseDerivableComparator<V,double[]>
Constructor and Description |
---|
SkipExtendedComparator() |
Modifier and Type | Method and Description |
---|---|
double |
calculateLocalDerivative(int paramIdx,
V a,
V b,
OperationType type)
This is called by an AlignmentDerivativeAlgorithm and should calculate
the local derivative for only one comparison of the values a and b.
|
SparseLocalDerivative |
calculateSparseLocalDerivative(V a,
V b,
OperationType type)
This method shall return a sparse representation of the derivative for
all parameters that have non-zero derivatives in this step of the
alignment.
|
abstract double |
comparisonDerivative(int paramIdx,
V a,
V b)
This should implement the local derivative calculation in case of
comparisons.
|
double |
delete(V a)
This should be called during an alignment to retrieve the costs for a
deletion of value a from the first sequence.
|
boolean |
equals(Object obj) |
double |
getDeletionCost()
Returns the (constant) cost for deleting a value.
|
double |
getInsertionCost()
Returns the (constant) cost for inserting a value.
|
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.
|
Class<double[]> |
getResultClass()
Returns the class of the intuitive format of the derivatives for all
parameters of this comparator.
|
double |
getSkipDeletionCost()
Returns the (constant) cost for deleting a value using a skip.
|
double |
getSkipInsertionCost()
Returns the (constant) cost for inserting a value using a skip.
|
int |
hashCode() |
double |
insert(V b)
This should be called during an alignment to retrieve the costs for an
insertion of value b into the first sequence.
|
void |
setDeletionCost(double deletionCost)
Sets the (constant) cost for deleting a value.
|
void |
setInsertionCost(double insertionCost)
Sets the (constant) cost for inserting a value.
|
void |
setSkipDeletionCost(double skipDeletionCost)
Sets the (constant) cost for deleting a value using a skip.
|
void |
setSkipInsertionCost(double skipInsertionCost)
Sets the (constant) cost for inserting a value using a skip.
|
double |
skipDelete(V a)
This should be called during an alignment to retrieve the costs for a
skip deletion of value a from the first sequence.
|
double |
skipInsert(V b)
This should be called during an alignment to retrieve the costs for a
skip insertion of value b into the first sequence.
|
abstract SparseLocalDerivative |
sparseComparisonDerivative(V a,
V b)
This should implement the local derivative calculation in case of
comparisons.
|
double[] |
transformToResult(double[] derivatives)
This method is supposed to construct the derivative for this comparator
in an intuitive format given its vectorial form.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
compare, getType
public void setDeletionCost(double deletionCost)
deletionCost
- the new (constant) cost for deleting a value.public double getDeletionCost()
public void setInsertionCost(double insertionCost)
insertionCost
- the new (constant) cost for inserting a value.public double getInsertionCost()
public void setSkipDeletionCost(double skipDeletionCost)
skipDeletionCost
- the new (constant) cost for deleting a value
using a skip.public double getSkipDeletionCost()
public void setSkipInsertionCost(double skipInsertionCost)
skipInsertionCost
- the new (constant) cost for inserting a value
using a skip.public double getSkipInsertionCost()
public double delete(V a)
delete
in interface GapComparator<V extends Value>
a
- a value.public double insert(V b)
insert
in interface GapComparator<V extends Value>
b
- a value.public double skipDelete(V a)
skipDelete
in interface SkipComparator<V extends Value>
a
- a value.public double skipInsert(V b)
skipInsert
in interface SkipComparator<V extends Value>
b
- a value.public double calculateLocalDerivative(int paramIdx, V a, V b, OperationType type)
calculateLocalDerivative
in interface DerivableComparator<V extends Value,double[]>
paramIdx
- the index for this parameters.a
- the value that has been compared with b.b
- the value that has been compared with a.type
- the operation type that has actually been used in the
comparison.public abstract double comparisonDerivative(int paramIdx, V a, V b)
paramIdx
- the index of the parameter the alignment is currently
derived to. Note that the first four parameters (0-3) are reserved for
the parameters of this superclass.a
- the value on the left side of the comparison.b
- the value on the right side of the comparison.public SparseLocalDerivative calculateSparseLocalDerivative(V a, V b, OperationType type)
calculateSparseLocalDerivative
in interface SparseDerivableComparator<V extends Value,double[]>
a
- the value that has been compared with b.b
- the value that has been compared with a.type
- the operation type that has actually been used in the
comparison.public abstract SparseLocalDerivative sparseComparisonDerivative(V a, V b)
a
- the value on the left side of the comparison.b
- the value on the right side of the comparison.public double[] transformToResult(double[] derivatives)
transformToResult
in interface DerivableComparator<V extends Value,double[]>
derivatives
- the derivatives for all parameters of this comparator
in its vectorial form.public int getNumberOfParameters()
getNumberOfParameters
in interface DerivableComparator<V extends Value,double[]>
public abstract int getNumberOfComparisonParameters()
public Class<double[]> getResultClass()
DerivableComparator
getResultClass
in interface DerivableComparator<V extends Value,double[]>
Copyright (C) 2013-2015 Benjamin Paaßen, Georg Zentgraf, 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