relentless.optimize.ValueTest#

class relentless.optimize.ValueTest(value, absolute=1e-08, relative=1e-05)#

Value test for convergence.

The result is converged if and only if the value of the function \(f\) is close to the value according to Tolerance.isclose(). Absolute and/or relative tolerances may be used.

Parameters:
  • value (float) – The value to check.

  • absolute (float) – The default absolute tolerance (defaults to 1e-8).

  • relative (float) – The default relative tolerance (defaults to 1e-5).

Methods

converged(result)

Check if the function is converged using the value test.

Attributes

absolute

The absolute tolerance.

relative

The relative tolerance.

value

The value(s) to check.

property absolute#

The absolute tolerance.

Type:

float

converged(result)#

Check if the function is converged using the value test.

Determines if two the value of a result is close to the specified value using Tolerance.isclose().

Parameters:

result (ObjectiveFunctionResult) – The result to check for convergence.

Returns:

True if the function is converged.

Return type:

bool

property relative#

The relative tolerance.

Type:

float

property value#

The value(s) to check.

Type:

float