es.yrbcn.graph.weighted
Class WeightedPageRank.NormDeltaStoppingCriterion

java.lang.Object
  extended by es.yrbcn.graph.weighted.WeightedPageRank.NormDeltaStoppingCriterion
All Implemented Interfaces:
WeightedPageRank.StoppingCriterion
Enclosing class:
WeightedPageRank

public static class WeightedPageRank.NormDeltaStoppingCriterion
extends Object
implements WeightedPageRank.StoppingCriterion

A stopping criterion that evaluates the norm of the difference between the last two iterates, and stops if this value is smaller than a given threshold.


Constructor Summary
WeightedPageRank.NormDeltaStoppingCriterion(double threshold)
          Creates an instance with given threshold.
 
Method Summary
 boolean shouldStop(WeightedPageRank p)
          Determines if the computation should be stopped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeightedPageRank.NormDeltaStoppingCriterion

public WeightedPageRank.NormDeltaStoppingCriterion(double threshold)
Creates an instance with given threshold.

Parameters:
threshold - the threshold.
Method Detail

shouldStop

public boolean shouldStop(WeightedPageRank p)
Description copied from interface: WeightedPageRank.StoppingCriterion
Determines if the computation should be stopped.

Specified by:
shouldStop in interface WeightedPageRank.StoppingCriterion
Parameters:
p - the PageRank object.
Returns:
true iff the computation should be stopped.