From 954c26a61dc6408c2892a0b0c24d8d1a9e0654e6 Mon Sep 17 00:00:00 2001 From: Alessandro Lucantonio Date: Mon, 10 Jul 2023 08:42:22 +0200 Subject: [PATCH] [WIP] Maxfunctionevals. --- src/dctkit/math/opt/optctrl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dctkit/math/opt/optctrl.py b/src/dctkit/math/opt/optctrl.py index 5683828..60497ad 100644 --- a/src/dctkit/math/opt/optctrl.py +++ b/src/dctkit/math/opt/optctrl.py @@ -163,6 +163,7 @@ def run(self, x0: npt.NDArray, **kwargs: Dict) -> npt.NDArray: x = PETSc.Vec().createWithArray(x0) self.tao.setSolution(x) self.tao.setMaximumIterations(maxeval) + self.tao.setMaximumFunctionEvaluations(maxeval) self.tao.setTolerances(gatol=gatol, grtol=grtol, gttol=gttol) self.tao.setFromOptions() # Set options for the solver self.tao.solve()