Threshold Check (threshold_check)

class pypint.utilities.threshold_check.ThresholdCheck(min_threshold=1e-07, max_threshold=10, conditions=('solution reduction', 'iterations'))[source]

Bases: builtins.object

Threshold Checking Handler

__init__(min_threshold=1e-07, max_threshold=10, conditions=('solution reduction', 'iterations'))[source]
Parameters:
  • min_threshold (float) – threshold value for minimum criteria
  • max_threshold (int) – threshold value for maximum criteria
  • conditions (tuple of str) –

    Tuple of strings defining the active criteria. Possible values are:

    • error reduction
    • solution reduction
    • residual
    • error
    • iterations

    (defaults to: ('solution reduction', 'iterations'))

check(state)[source]

Checks thresholds of given state

compute_reduction(state)[source]

Computes the reduction of the error and solution

With respect to the supremum nomr of the given state’s current iteration (see ISolverState.current_iteration and IIterationState). In case no previous iteration is available, it immediatly returns.

has_reached(log=False, human=False)[source]

Gives list of thresholds reached

Parameters:human (bool) – if True returns a human readable string listing reached thresholds (default False)
Returns:reached_thresholdslist of matched thresholds or None if non reached
Return type:list or None
print_conditions()[source]

Pretty-formatted string of all active criteria and their thresholds

__weakref__

list of weak references to the object (if defined)

max_iterations[source]

Read-only accessor for the maximum iterations threshold

Returns:iterations_thresholdNone if iterations is not a criteria
Return type:int or None
min_error[source]

Read-only accessor for the minimum error threshold

Returns:error_thresholdNone if error is not a criteria
Return type:float or None
min_error_reduction[source]

Read-only accessor for the minimum reduction threshold for the error

Returns:reduction_thresholdNone if reduction of error is not a criteria
Return type:float or None
min_residual[source]

Read-only accessor for the minimum residual threshold

Returns:residual_thresholdNone if residual is not a criteria
Return type:float or None
min_solution_reduction[source]

Read-only accessor for the minimum reduction threshold for the solution

Returns:reduction_thresholdNone if reduction of solution is not a criteria
Return type:float or None