Skip to content

Commit

Permalink
Increase testing precision for COBYLA
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom M. Ragonneau committed Aug 23, 2021
1 parent 58104ed commit 61b1e84
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/interfaces/pdfo/tests/test_pdfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ def runTest(self):

sys.stdout = default_stdout

# the precision for cobyla is lower
tol = self.PRECISION
if solver == 'cobyla' or struct.calcsize('P') != 8:
# the precision for cobyla and 32-bit platforms is lower
if solver == 'cobyla' and struct.calcsize('P') == 8:
tol = max(1e3 * tol, 1e-2)
elif solver == 'cobyla':
tol = max(1e4 * tol, 1e-1)

if not self.QUIET and not self.RELEASE:
print('solver = {},\tfun = {}'.format(solver, fun_name), end='\t\t')
Expand Down

0 comments on commit 61b1e84

Please sign in to comment.