diff --git a/flexsolve/__init__.py b/flexsolve/__init__.py index 74a891d..7bf8df9 100644 --- a/flexsolve/__init__.py +++ b/flexsolve/__init__.py @@ -28,4 +28,4 @@ from .problem import * from .profiler import * -__version__ = '0.5.6' +__version__ = '0.5.7' diff --git a/flexsolve/utils.py b/flexsolve/utils.py index 81c8b56..79ea690 100644 --- a/flexsolve/utils.py +++ b/flexsolve/utils.py @@ -52,9 +52,9 @@ def jit_mean(x): # pragma: no cover # Fixed point -def fixedpoint_converged(dx, xtol): +def fixedpoint_converged(dx, xtol, subset=0): if isinstance(dx, Iterable) and dx.ndim: - return array_fixedpoint_converged(dx, xtol) + return array_fixedpoint_converged(dx, xtol, subset) else: return scalar_fixedpoint_converged(dx, xtol) @@ -70,8 +70,11 @@ def scalar_fixedpoint_converged(dx, xtol): return dx < xtol @njit(cache=True) -def array_fixedpoint_converged(dx, xtol): - return (dx < xtol).all() +def array_fixedpoint_converged(dx, xtol, subset): + if subset: + return (dx[:subset] < xtol).all() + else: + return (dx < xtol).all() # Wegstein diff --git a/setup.py b/setup.py index 51da2f9..f484170 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ name='flexsolve', packages=['flexsolve'], license='MIT', - version='0.5.6', + version='0.5.7', description='Flexible function solvers', long_description=open('README.rst').read(), author='Yoel Cortes-Pena',