SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative
Class CountMonitor

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.matrixtype.sparse.solver.iterative.CountMonitor
All Implemented Interfaces:
IterationMonitor

public class CountMonitor
extends java.lang.Object
implements IterationMonitor

This simple IterationMonitor monitors the number of iterates generated, hence iterations. Note that the initial guess of solution is added as the first iterate. Therefore, the count() should normally return an integer greater than or equal to 1 if the iterative method is performed without error (or breakdown).


Constructor Summary
CountMonitor()
           
 
Method Summary
 void addIterate(Vector x)
          Add a newly computed iterate to this monitor.
 int count()
          Get the number of iterates generated by the iterative algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountMonitor

public CountMonitor()
Method Detail

addIterate

public void addIterate(Vector x)
Description copied from interface: IterationMonitor
Add a newly computed iterate to this monitor. This should also be called with the initial guess of solution.

Specified by:
addIterate in interface IterationMonitor
Parameters:
x - the new iterate

count

public int count()
Get the number of iterates generated by the iterative algorithm.

Returns:
the number of iterates

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.