net.sourceforge.combean.graph.alg.spath
Class DoubleValuedPathAlgebra

Package class diagram package DoubleValuedPathAlgebra
java.lang.Object
  extended by net.sourceforge.combean.graph.alg.spath.DoubleValuedPathAlgebra
All Implemented Interfaces:
PathAlgebra<Double>

public class DoubleValuedPathAlgebra
extends Object
implements PathAlgebra<Double>

A path algebra which works with subclasses of java.lang.Number and uses double values for the arithmetic


Constructor Summary
DoubleValuedPathAlgebra()
          constructor
 
Method Summary
 Double add(Double pathLenOne, Double pathLenTwo)
          Add the length of to paths, yielding the length of the combined path
 Double emptyPathLen()
          Return a value 'zero' which must be the neutral element of the operation max and is equal to the length of an empty path.
 Double infinitePathLen()
          Return a value 'infinity' which must be the neutral element of the operation min.
 Double min(Double pathLenOne, Double pathLenTwo)
          Calculate the minimum distance of a node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleValuedPathAlgebra

public DoubleValuedPathAlgebra()
constructor

Method Detail

add

public Double add(Double pathLenOne,
                  Double pathLenTwo)
Description copied from interface: PathAlgebra
Add the length of to paths, yielding the length of the combined path

Specified by:
add in interface PathAlgebra<Double>
Returns:
the length of the concatenation of the two paths (which are assumed to be node disjoint.

min

public Double min(Double pathLenOne,
                  Double pathLenTwo)
Description copied from interface: PathAlgebra
Calculate the minimum distance of a node. Assume that two paths lead to the same node. This function calculates distance of this node to the source (usually taking the minimum of the two values but different functions might be considered for certain applications).

Specified by:
min in interface PathAlgebra<Double>
Returns:
the 'minimum' length of the two paths

infinitePathLen

public Double infinitePathLen()
Description copied from interface: PathAlgebra
Return a value 'infinity' which must be the neutral element of the operation min.

Specified by:
infinitePathLen in interface PathAlgebra<Double>
Returns:
the length of an 'infinite' path.

emptyPathLen

public Double emptyPathLen()
Description copied from interface: PathAlgebra
Return a value 'zero' which must be the neutral element of the operation max and is equal to the length of an empty path.

Specified by:
emptyPathLen in interface PathAlgebra<Double>
Returns:
the length of an empty path.