Skip to content

Commit

Permalink
Retrofit to match changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pafonine committed Nov 21, 2024
1 parent b178f40 commit db7488c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scitbx/tests/tst_minimizer_lbfgs_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class rosenbrock(object):
def __init__(self, a, b, x, # lbfgs and lbfgsb minimizer
n_bounds = None, # only lbfgsb
bound_flags = None, # only lbfgsb
lower_bound = None, # only lbfgsb
upper_bound = None, # only lbfgsb
initial_values = None # only lbfgsb
Expand Down Expand Up @@ -49,11 +49,11 @@ def run():

# Run L-BFGS (no boundaries)
calculator = rosenbrock(a = 20, b = 10, x = flex.double([0,0]),
n_bounds = 2,
bound_flags = flex.int(2,2),
lower_bound = flex.double([-10000,-10000]),
upper_bound = flex.double([10000,10000]),
initial_values = flex.double([0,0]))
m_unbound = scitbx.minimizers.minimizer_lbfgs_general(
m_unbound = scitbx.minimizers.lbfgs(
mode='lbfgs', max_iterations=100, calculator=calculator)
#print('\tMinimum: ', list(m_unbound.x))
res = (19.99999855596629, 399.99994289914525)
Expand All @@ -62,11 +62,11 @@ def run():

# Run L-BFGS-B with boundaries
calculator = rosenbrock(a = 20, b = 10, x = flex.double([0,0]),
n_bounds = 2,
bound_flags = flex.int(2,2),
lower_bound = flex.double([-10000,-10000]),
upper_bound = flex.double([10000,10000]),
initial_values = flex.double([0,0]))
m_bound = scitbx.minimizers.minimizer_lbfgs_general(
m_bound = scitbx.minimizers.lbfgs(
mode='lbfgsb', calculator=calculator)
#print('\tMinimum: ', list(m_bound.x))
res = (19.999999988074844, 399.99999950735986)
Expand All @@ -75,7 +75,7 @@ def run():

# Run L-BFGS (no curvatures)
calculator = rosenbrock(a = 1, b = 100, x = flex.double([-3,-4]))
m_unbound = scitbx.minimizers.minimizer_lbfgs_general(
m_unbound = scitbx.minimizers.lbfgs(
mode='lbfgs', calculator=calculator)
#print('\tMinimum: ', list(m_unbound.x))
res = (0.9999998308201578, 0.9999996829964546)
Expand All @@ -85,7 +85,7 @@ def run():

# Run L-BFGS (with curvatures)
calculator = rosenbrock(a = 1, b = 100, x = flex.double([-3,-4]))
m_unbound2 = scitbx.minimizers.minimizer_lbfgs_general(
m_unbound2 = scitbx.minimizers.lbfgs(
mode='lbfgs', calculator=calculator, diag_mode='always')
#print('\tMinimum: ', list(m_unbound2.x))
res = (1.0000002135019004, 1.000000406037043)
Expand Down

0 comments on commit db7488c

Please sign in to comment.