Click or drag to resize
Accord.NET (logo)

AbsoluteConvergence Class

Absolute convergence criteria.
Inheritance Hierarchy
SystemObject
  Accord.MathAbsoluteConvergence

Namespace:  Accord.Math
Assembly:  Accord.Math (in Accord.Math.dll) Version: 3.8.0
Syntax
public class AbsoluteConvergence : ISingleValueConvergence, 
	IConvergence<double>, IConvergence
Request Example View Source

The AbsoluteConvergence type exposes the following members.

Constructors
  NameDescription
Public methodAbsoluteConvergence
Initializes a new instance of the AbsoluteConvergence class.
Public methodAbsoluteConvergence(Int32, Double, Double)
Initializes a new instance of the AbsoluteConvergence class.
Top
Properties
  NameDescription
Public propertyCurrentIteration
Gets or sets the current iteration number.
Public propertyHasConverged
Gets whether the algorithm has converged.
Public propertyIterations Obsolete.
Please use MaxIterations instead.
Public propertyMaxIterations
Gets or sets the maximum number of iterations performed by the iterative algorithm. Default is 100.
Public propertyNewValue
Gets or sets the watched value after the iteration.
Public propertyOldValue
Gets the watched value before the iteration.
Public propertyTolerance
Gets or sets the maximum change in the watched value after an iteration of the algorithm used to detect convergence. Default is 0.
Top
Methods
  NameDescription
Public methodClear
Clears this instance.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodIsEqual
Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.)
Public Extension MethodTo(Type)Overloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Top
Remarks
This class can be used to track progress and convergence of methods which rely on the absolute change of a value.
Examples
// Create a new convergence criteria for a maximum of 10 iterations
var criteria = new AbsoluteConvergence(iterations: 10, tolerance: 0.1);

int progress = 1;

do
{
    // Do some processing...


    // Update current iteration information:
    criteria.NewValue = 12345.6 / progress++;

} while (!criteria.HasConverged);


// The method will converge after reaching the 
// maximum of 10 iterations with a final value
// of 1371.73:

int iterations = criteria.CurrentIteration; // 10
double value = criteria.OldValue; // 1371.7333333
See Also