Permalink
Browse files

uncommented the test that checks whether the two solutions in the pyi…

…popt example coincide
  • Loading branch information...
1 parent 84ac239 commit f41dc155e7cbdb4bbc9f3ecfc7578829977a61ed @b45ch1 committed Apr 14, 2011
Showing with 6 additions and 8 deletions.
  1. +6 −8 examples/using_pyadolc_with_pyipopt.py
@@ -187,7 +187,6 @@ def __call__(self, x, lagrange, obj_factor, flag, user_data = None):
return result[3][self.mask]
-
# create callable instance of the classes
eval_jac_g_adolc = Eval_jac_g_adolc(x0)
eval_h_adolc = Eval_h_adolc(x0)
@@ -244,18 +243,17 @@ def __call__(self, x, lagrange, obj_factor, flag, user_data = None):
adolc_optimization_time = end_time - start_time
print 'optimization time with derivatives computed by adolc = ', adolc_optimization_time
print 'optimization time with derivatives computed by hand = ',pure_python_optimization_time
-# assert adolc_optimization_time / pure_python_optimization_time < 10
# # this works with the pyipopt version from code.google.com
# assert_array_almost_equal(result[0], result_adolc[0])
# assert_array_almost_equal(result[1], result_adolc[1])
# assert_array_almost_equal(result[2], result_adolc[2])
# assert_array_almost_equal(result[3], result_adolc[3])
-# ##this works with the pyipopt version from github by alanfalloon
-# #assert_array_almost_equal(result['x'],result_adolc['x'])
-# #assert_array_almost_equal(result['mult_xL'],result_adolc['mult_xL'])
-# #assert_array_almost_equal(result['mult_xU'],result_adolc['mult_xU'])
-# #assert_array_almost_equal(result['mult_g'],result_adolc['mult_g'])
-# #assert_array_almost_equal(result['f'],result_adolc['f'])
+#this works with the pyipopt version from github by alanfalloon
+assert_array_almost_equal(result['x'],result_adolc['x'])
+assert_array_almost_equal(result['mult_xL'],result_adolc['mult_xL'])
+assert_array_almost_equal(result['mult_xU'],result_adolc['mult_xU'])
+assert_array_almost_equal(result['mult_g'],result_adolc['mult_g'])
+assert_array_almost_equal(result['f'],result_adolc['f'])

0 comments on commit f41dc15

Please sign in to comment.