Package net.sf.tweety.math.norm
Class PNorm
- java.lang.Object
-
- net.sf.tweety.math.norm.AbstractRealVectorNorm
-
- net.sf.tweety.math.norm.PNorm
-
- All Implemented Interfaces:
Norm<java.util.Vector<java.lang.Double>>
,RealVectorNorm
public class PNorm extends AbstractRealVectorNorm
The p-norm.- Author:
- Matthias Thimm
-
-
Constructor Summary
Constructors Constructor Description PNorm(int p)
Creates a new p-norm with the given parameter.
-
Method Summary
Modifier and Type Method Description double
distance(java.util.Vector<java.lang.Double> obj1, java.util.Vector<java.lang.Double> obj2)
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.double
norm(java.util.Vector<java.lang.Double> obj)
Returns the norm of the given objectTerm
normTerm(java.util.Vector<Term> obj)
Returns the norm as a term of the given terms-
Methods inherited from class net.sf.tweety.math.norm.AbstractRealVectorNorm
distanceTerm, normTerm
-
-
-
-
Method Detail
-
norm
public double norm(java.util.Vector<java.lang.Double> obj)
Description copied from interface:Norm
Returns the norm of the given object- Parameters:
obj
- some object- Returns:
- the norm of the object
-
distance
public double distance(java.util.Vector<java.lang.Double> obj1, java.util.Vector<java.lang.Double> obj2)
Description copied from interface:Norm
The distance between the two object, i.e. the norm of the difference vector.- Parameters:
obj1
- some objectobj2
- some object- Returns:
- the distance between the two objects
-
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 interfaceRealVectorNorm
- Specified by:
normTerm
in classAbstractRealVectorNorm
- Parameters:
obj
- some term vector- 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 interfaceRealVectorNorm
- Specified by:
distanceTerm
in classAbstractRealVectorNorm
- Parameters:
obj1
- some termsobj2
- some terms- Returns:
- the distance between the two objects as a term
-
-