Commit 3e1668f5 authored by Benoit Rossignol's avatar Benoit Rossignol

Add min_iter to _match

parent a224d6de
......@@ -418,7 +418,7 @@ def _save_ordering(func):
return wrapper
def _match_functions(func, xmin=-1, xmax=1, tol=1E-8,
def _match_functions(func, xmin=-1, xmax=1, tol=1E-8, min_iter=10,
interval_converged=None, evaluated=None, max_iter=100000):
"""Match the elements of a vector valued function, such that
each vector element describes a continous function.
......@@ -502,6 +502,8 @@ def _match_functions(func, xmin=-1, xmax=1, tol=1E-8,
assert _is_type(xmax, 'real_number')
assert _is_type(tol, 'real_number')
assert _is_type(max_iter, 'integer')
assert _is_type(min_iter, 'integer')
assert min_iter > 0
assert tol > 0
assert callable(func)
......@@ -517,7 +519,9 @@ def _match_functions(func, xmin=-1, xmax=1, tol=1E-8,
func = _save_ordering(func)
order(xmin, xmax)
xs = np.linspace(xmin, xmax, min_iter + 1)
for i in range(min_iter):
order(xs[i], xs[i+1])
except ValueError as err:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment