public class SubspaceDistance extends AbstractDistance<SubspaceDistance>
Modifier and Type | Field and Description |
---|---|
private double |
affineDistance
The affine distance.
|
static SubspaceDistance |
FACTORY
The static factory instance
|
static String |
SEPARATOR
Indicates a separator.
|
private static long |
serialVersionUID
Serial version number.
|
static Pattern |
SUBSPACE_PATTERN
The pattern for parsing subspace values
|
private double |
subspaceDistance
The subspace distance.
|
DOUBLE_PATTERN, INFINITY_PATTERN, INTEGER_PATTERN
Constructor and Description |
---|
SubspaceDistance()
Empty constructor for serialization purposes.
|
SubspaceDistance(double subspaceDistance,
double affineDistance)
Constructs a new SubspaceDistance object consisting of the specified
subspace distance and affine distance.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SubspaceDistance other)
Compares this SubspaceDistance with the given SubspaceDistance wrt the
represented subspace distance values.
|
int |
externalizableSize()
Returns the number of Bytes this distance uses if it is written to an
external file.
|
double |
getAffineDistance()
Returns the value of the affine distance.
|
Pattern |
getPattern()
Get the pattern accepted by this distance
|
double |
getSubspaceDistance()
Returns the value of the subspace distance.
|
int |
hashCode()
Any extending class should implement a proper hashCode method.
|
SubspaceDistance |
infiniteDistance()
Provides an infinite distance.
|
SubspaceDistance |
minus(SubspaceDistance distance)
Returns a new Distance by subtracting the given distance from this
distance.
|
SubspaceDistance |
nullDistance()
Provides a null distance.
|
SubspaceDistance |
parseString(String val)
Provides a measurement suitable to this measurement function based on the
given pattern.
|
SubspaceDistance |
plus(SubspaceDistance distance)
Returns a new distance as sum of this distance and the given distance.
|
void |
readExternal(ObjectInput in)
Reads the subspace distance value and the affine distance value of this
SubspaceDistance from the specified stream.
|
String |
toString()
Returns a string representation of this SubspaceDistance.
|
SubspaceDistance |
undefinedDistance()
Provides an undefined distance.
|
void |
writeExternal(ObjectOutput out)
Writes the subspace distance value and the affine distance value of this
SubspaceDistance to the specified stream.
|
equals, isInfiniteDistance, isNullDistance, isUndefinedDistance, requiredInputPattern, testInputPattern
public static final SubspaceDistance FACTORY
private static final long serialVersionUID
public static final String SEPARATOR
public static final Pattern SUBSPACE_PATTERN
private double subspaceDistance
private double affineDistance
public SubspaceDistance()
public SubspaceDistance(double subspaceDistance, double affineDistance)
subspaceDistance
- the distance between the two subspaces spanned by
the strong eigenvectors of the two pointsaffineDistance
- the affine distance between the two subspacespublic SubspaceDistance plus(SubspaceDistance distance)
Distance
distance
- the distance to be added to this distancepublic SubspaceDistance minus(SubspaceDistance distance)
Distance
distance
- the distance to be subtracted from this distancepublic String toString()
toString
in interface Distance<SubspaceDistance>
toString
in class Object
public int compareTo(SubspaceDistance other)
Double.compare(this.subspaceDistance, other.subspaceDistance)
if
it is a non zero value, the value of
Double.compare(this.affineDistance, other.affineDistance)
otherwisepublic int hashCode()
AbstractDistance
hashCode
in class AbstractDistance<SubspaceDistance>
public double getSubspaceDistance()
public double getAffineDistance()
public void writeExternal(ObjectOutput out) throws IOException
IOException
public void readExternal(ObjectInput in) throws IOException
IOException
public int externalizableSize()
public Pattern getPattern()
AbstractDistance
getPattern
in class AbstractDistance<SubspaceDistance>
public SubspaceDistance parseString(String val) throws IllegalArgumentException
Distance
val
- a pattern defining a similarity suitable to this measurement
functionIllegalArgumentException
- if the given pattern is not compatible
with the requirements of this measurement functionpublic SubspaceDistance infiniteDistance()
Distance
public SubspaceDistance nullDistance()
Distance
public SubspaceDistance undefinedDistance()
Distance