Added test for function evaluation counter.
@@ -42,6 +42,13 @@ class TestOptimize(unittest.TestCase):
self.m.optimize(disp=False)
self.assertTrue(self.m.x.value.max() < 1e-6)
+ def test_feval_counter(self):
+ self.m._compile()
+ self.m.num_fevals = 0
+ for _ in range(10):
+ self.m._objective(self.m.get_free_state())
+ self.assertTrue(self.m.num_fevals == 10)
+
class TestNeedsRecompile(unittest.TestCase):
def setUp(self):
