| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uci.ics.jung.algorithms.util.IterativeProcess
public abstract class IterativeProcess
Provides basic infrastructure for iterative algorithms. Services provided include:
 Algorithms that subclass this class are typically used in the following way: 
 
FooAlgorithm foo = new FooAlgorithm(...) foo.setMaximumIterations(100); //set up conditions ... foo.evaluate(); //key method which initiates iterative process foo.getSomeResult();
| Constructor Summary | |
|---|---|
IterativeProcess()
Generic constructor.  | 
|
| Method Summary | |
|---|---|
 boolean | 
done()
Returns true if this iterative process is finished, and false otherwise.  | 
 void | 
evaluate()
Performs the iterative process.  | 
protected  void | 
finalizeIterations()
Perform eventual clean-up operations (must be implement by subclass when needed).  | 
 double | 
getDesiredPrecision()
Returns the desired precision.  | 
 int | 
getIterations()
Returns the number of iterations performed.  | 
 int | 
getMaximumIterations()
Returns the maximum allowed number of iterations.  | 
 double | 
getPrecision()
Returns the attained precision.  | 
 boolean | 
hasConverged()
Check to see if the result has been attained.  | 
protected  void | 
initializeIterations()
Initializes internal parameters to start the iterative process.  | 
 double | 
relativePrecision(double epsilon,
                  double x)
 | 
 void | 
reset()
 | 
 void | 
setDesiredPrecision(double prec)
Defines the desired precision.  | 
 void | 
setMaximumIterations(int maxIter)
Defines the maximum allowed number of iterations.  | 
 void | 
setPrecision(double precision)
 | 
abstract  void | 
step()
Evaluate the result of the current iteration.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public IterativeProcess()
| Method Detail | 
|---|
public void evaluate()
public abstract void step()
step in interface IterativeContextprotected void finalizeIterations()
public double getDesiredPrecision()
public int getIterations()
public int getMaximumIterations()
public double getPrecision()
public void setPrecision(double precision)
precision - the precision to setpublic boolean hasConverged()
public boolean done()
IterativeContext
done in interface IterativeContextprotected void initializeIterations()
public void reset()
public double relativePrecision(double epsilon,
                                double x)
epsilon - doublex - double
public void setDesiredPrecision(double prec)
                         throws IllegalArgumentException
IllegalArgumentException
public void setMaximumIterations(int maxIter)
                          throws IllegalArgumentException
IllegalArgumentException
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||