public class TrivialEditComparator extends Object implements SkipComparator<SymbolicValue>, SparseDerivableComparator<SymbolicValue,double[]>
Constructor and Description |
---|
TrivialEditComparator() |
Modifier and Type | Method and Description |
---|---|
double |
calculateLocalDerivative(int paramIdent,
SymbolicValue a,
SymbolicValue 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(SymbolicValue a,
SymbolicValue 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.
|
double |
compare(SymbolicValue a,
SymbolicValue 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)
Please note that this has to be well-defined, even if an input is null.
|
double |
delete(SymbolicValue a)
This should be called during an alignment to retrieve the costs for a
deletion of value a from the first sequence.
|
double |
getGapScore()
Returns the score used if a symbol is deleted or inserted.
|
double |
getMatchScore()
Returns the score used if equal symbols are replaced.
|
double |
getMismatchScore()
Returns the score used if different symbols are replaced.
|
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[] |
getScoringScheme()
Please refer to the corresponding setter method for more information.
|
double |
getSkipScore()
Returns the score used if a symbol is skipped.
|
ValueType |
getType() |
double |
insert(SymbolicValue b)
This should be called during an alignment to retrieve the costs for an
insertion of value b into the first sequence.
|
void |
setGapScore(double score)
Specifies the score used if a symbol is deleted or inserted.
|
void |
setMatchScore(double score)
Specifies the score used if equal symbols are replaced.
|
void |
setMismatchScore(double score)
Specifies the score used if different symbols are replaced.
|
void |
setScoringScheme(double[] scoringScheme)
This specifies what scoring scheme should be used in this
TrivialEditComparator.
|
void |
setSkipScore(double score)
Specifies the score used if a symbol is skipped.
|
double |
skipDelete(SymbolicValue 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(SymbolicValue b)
This should be called during an alignment to retrieve the costs for a
skip insertion of value b into the first sequence.
|
double[] |
transformToResult(double[] derivatives)
This method is supposed to construct the derivative for this comparator
in an intuitive format given its vectorial form.
|
public double[] getScoringScheme()
public void setScoringScheme(double[] scoringScheme)
scoringScheme
- a vector specifying how costly edit operations of
symbols are.public double getMatchScore()
public double getMismatchScore()
public double getGapScore()
public double getSkipScore()
public void setMatchScore(double score)
score
- the score used if equal symbols are replaced.public void setMismatchScore(double score)
score
- the score used if different symbols are replaced.public void setGapScore(double score)
score
- the score used if a symbol is deleted or inserted.public void setSkipScore(double score)
score
- the score used if a symbol is skipped.public double skipDelete(SymbolicValue a)
skipDelete
in interface SkipComparator<SymbolicValue>
a
- a value.public double skipInsert(SymbolicValue b)
skipInsert
in interface SkipComparator<SymbolicValue>
b
- a value.public double delete(SymbolicValue a)
delete
in interface GapComparator<SymbolicValue>
a
- a value.public double insert(SymbolicValue b)
insert
in interface GapComparator<SymbolicValue>
b
- a value.public ValueType getType()
getType
in interface Comparator<SymbolicValue>
public double compare(SymbolicValue a, SymbolicValue b)
compare
in interface Comparator<SymbolicValue>
a
- the left input.b
- the right input.public double calculateLocalDerivative(int paramIdent, SymbolicValue a, SymbolicValue b, OperationType type)
calculateLocalDerivative
in interface DerivableComparator<SymbolicValue,double[]>
paramIdent
- 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 SparseLocalDerivative calculateSparseLocalDerivative(SymbolicValue a, SymbolicValue b, OperationType type)
calculateSparseLocalDerivative
in interface SparseDerivableComparator<SymbolicValue,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 Class<double[]> getResultClass()
getResultClass
in interface DerivableComparator<SymbolicValue,double[]>
public double[] transformToResult(double[] derivatives)
transformToResult
in interface DerivableComparator<SymbolicValue,double[]>
derivatives
- the derivatives for all parameters of this comparator
in its vectorial form.public int getNumberOfParameters()
getNumberOfParameters
in interface DerivableComparator<SymbolicValue,double[]>
Copyright © 2014. All rights reserved.