public class ProbabilisticPNorm extends java.lang.Object implements RealVectorNorm, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private int |
c
The parameter of the normalization.
|
private int |
p
The parameter for the p-norm.
|
private static long |
serialVersionUID |
Constructor and Description |
---|
ProbabilisticPNorm(int p,
int c)
Creates a new p-norm distance function where distances are normalized.
|
Modifier and Type | Method and Description |
---|---|
double |
distance(java.util.Vector<java.lang.Double> l1,
java.util.Vector<java.lang.Double> l2)
The distance between the two object, i.e.
|
Term |
distanceTerm(Term[] obj1,
Term[] obj2)
The distance between the two objects as a term.
|
Term |
distanceTerm(java.util.Vector<Term> obj1,
java.util.Vector<Term> obj2)
The distance between the two objects as a term.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
double |
norm(java.util.Vector<java.lang.Double> obj)
Returns the norm of the given object
|
Term |
normTerm(Term[] obj)
Returns the norm as a term of the given terms
|
Term |
normTerm(java.util.Vector<Term> obj)
Returns the norm as a term of the given terms
|
java.lang.String |
toString() |
private static final long serialVersionUID
private int p
private int c
public ProbabilisticPNorm(int p, int c)
p
- the parameter for the p-norm.c
- the parameter of the normalization.public double distance(java.util.Vector<java.lang.Double> l1, java.util.Vector<java.lang.Double> l2)
Norm
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public double norm(java.util.Vector<java.lang.Double> obj)
Norm
public Term normTerm(java.util.Vector<Term> obj)
RealVectorNorm
normTerm
in interface RealVectorNorm
obj
- some term vectorpublic Term normTerm(Term[] obj)
RealVectorNorm
normTerm
in interface RealVectorNorm
obj
- some term arraypublic Term distanceTerm(java.util.Vector<Term> obj1, java.util.Vector<Term> obj2)
RealVectorNorm
distanceTerm
in interface RealVectorNorm
obj1
- some termsobj2
- some termspublic Term distanceTerm(Term[] obj1, Term[] obj2)
RealVectorNorm
distanceTerm
in interface RealVectorNorm
obj1
- some termsobj2
- some terms