Пример #1
0
def _max_residual_condition(residual_index, accuracy):
    """continue if the maximum deviation from zero is bigger than desired accuracy"""
    if accuracy is None:
        return lambda *args: True
    else:
        return lambda *args: math.max(math.abs(args[residual_index])) > accuracy
Пример #2
0
 def loop_condition(_1, _2, _3, residual, _i):
     '''continue if the maximum deviation from zero is bigger than desired accuracy'''
     return math.max(math.abs(residual)) >= accuracy