Class ProbabilisticPNorm

  • All Implemented Interfaces:
    java.io.Serializable, Norm<java.util.Vector<java.lang.Double>>, RealVectorNorm

    public class ProbabilisticPNorm
    extends java.lang.Object
    implements RealVectorNorm, java.io.Serializable
    This class implement the p-norm distance function where distances are normalized corresponding to their distance to 0.5.
    Author:
    Matthias Thimm
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ProbabilisticPNorm​(int p, int c)
      Creates a new p-norm distance function where distances are normalized.
    • Method Summary

      Modifier and Type Method 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​(java.util.Vector<Term> obj1, java.util.Vector<Term> obj2)
      The distance between the two objects as a term.
      Term distanceTerm​(Term[] obj1, 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​(java.util.Vector<Term> obj)
      Returns the norm as a term of the given terms
      Term normTerm​(Term[] obj)
      Returns the norm as a term of the given terms
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ProbabilisticPNorm

        public ProbabilisticPNorm​(int p,
                                  int c)
        Creates a new p-norm distance function where distances are normalized.
        Parameters:
        p - the parameter for the p-norm.
        c - the parameter of the normalization.
    • Method Detail

      • distance

        public double distance​(java.util.Vector<java.lang.Double> l1,
                               java.util.Vector<java.lang.Double> l2)
        Description copied from interface: Norm
        The distance between the two object, i.e. the norm of the difference vector.
        Specified by:
        distance in interface Norm<java.util.Vector<java.lang.Double>>
        Parameters:
        l1 - some object
        l2 - some object
        Returns:
        the distance between the two objects
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • norm

        public double norm​(java.util.Vector<java.lang.Double> obj)
        Description copied from interface: Norm
        Returns the norm of the given object
        Specified by:
        norm in interface Norm<java.util.Vector<java.lang.Double>>
        Parameters:
        obj - some object
        Returns:
        the norm of the object
      • normTerm

        public Term normTerm​(java.util.Vector<Term> obj)
        Description copied from interface: RealVectorNorm
        Returns the norm as a term of the given terms
        Specified by:
        normTerm in interface RealVectorNorm
        Parameters:
        obj - some term vector
        Returns:
        the term of the norm
      • normTerm

        public Term normTerm​(Term[] obj)
        Description copied from interface: RealVectorNorm
        Returns the norm as a term of the given terms
        Specified by:
        normTerm in interface RealVectorNorm
        Parameters:
        obj - some term array
        Returns:
        the term of the norm
      • distanceTerm

        public Term distanceTerm​(java.util.Vector<Term> obj1,
                                 java.util.Vector<Term> obj2)
        Description copied from interface: RealVectorNorm
        The distance between the two objects as a term.
        Specified by:
        distanceTerm in interface RealVectorNorm
        Parameters:
        obj1 - some terms
        obj2 - some terms
        Returns:
        the distance between the two objects as a term
      • distanceTerm

        public Term distanceTerm​(Term[] obj1,
                                 Term[] obj2)
        Description copied from interface: RealVectorNorm
        The distance between the two objects as a term.
        Specified by:
        distanceTerm in interface RealVectorNorm
        Parameters:
        obj1 - some terms
        obj2 - some terms
        Returns:
        the distance between the two objects as a term