@@ -89,7 +89,7 @@ def runTest(self):
89
89
# self.assertAlmostEqual(est_min, true_min, 'Wrong min value')
90
90
s_cauchy , red_cauchy , crvmin_cauchy = cauchy_pt (g , H , Delta )
91
91
self .assertTrue (est_min <= red_cauchy , 'Cauchy reduction not achieved' )
92
- self .assertTrue (np .all (gnew == g + H .dot (d )), 'Wrong gnew' )
92
+ self .assertTrue (np .allclose (gnew , g + H .dot (d )), 'Wrong gnew' )
93
93
# print(crvmin)
94
94
self .assertAlmostEqual (crvmin , 1.2 , 'Wrong crvmin' )
95
95
@@ -112,7 +112,7 @@ def runTest(self):
112
112
# self.assertAlmostEqual(est_min, true_min, 'Wrong min value')
113
113
s_cauchy , red_cauchy , crvmin_cauchy = cauchy_pt (g , H , Delta )
114
114
self .assertTrue (est_min <= red_cauchy , 'Cauchy reduction not achieved' )
115
- self .assertTrue (np .all (gnew == g + H .dot (d )), 'Wrong gnew' )
115
+ self .assertTrue (np .allclose (gnew , g + H .dot (d )), 'Wrong gnew' )
116
116
self .assertAlmostEqual (crvmin , 0.0 , 'Wrong crvmin' )
117
117
118
118
@@ -134,7 +134,7 @@ def runTest(self):
134
134
# self.assertAlmostEqual(est_min, true_min, 'Wrong min value')
135
135
s_cauchy , red_cauchy , crvmin_cauchy = cauchy_pt (g , H , Delta )
136
136
self .assertTrue (est_min <= red_cauchy , 'Cauchy reduction not achieved' )
137
- self .assertTrue (np .all (gnew == g + H .dot (d )), 'Wrong gnew' )
137
+ self .assertTrue (np .allclose (gnew , g + H .dot (d )), 'Wrong gnew' )
138
138
self .assertAlmostEqual (crvmin , 0.0 , 'Wrong crvmin' )
139
139
140
140
@@ -156,7 +156,7 @@ def runTest(self):
156
156
# self.assertAlmostEqual(est_min, true_min, 'Wrong min value')
157
157
s_cauchy , red_cauchy , crvmin_cauchy = cauchy_pt (g , H , Delta )
158
158
self .assertTrue (est_min <= red_cauchy , 'Cauchy reduction not achieved' )
159
- self .assertTrue (np .all (gnew == g + H .dot (d )), 'Wrong gnew' )
159
+ self .assertTrue (np .allclose (gnew , g + H .dot (d )), 'Wrong gnew' )
160
160
self .assertAlmostEqual (crvmin , 0.0 , 'Wrong crvmin' )
161
161
# self.assertAlmostEqual(crvmin, crvmin_cauchy, 'Wrong crvmin')
162
162
@@ -179,7 +179,7 @@ def runTest(self):
179
179
# self.assertAlmostEqual(est_min, true_min, 'Wrong min value')
180
180
s_cauchy , red_cauchy , crvmin_cauchy = cauchy_pt (g , H , Delta )
181
181
self .assertTrue (est_min <= red_cauchy , 'Cauchy reduction not achieved' )
182
- self .assertTrue (np .all (gnew == g + H .dot (d )), 'Wrong gnew' )
182
+ self .assertTrue (np .allclose (gnew , g + H .dot (d )), 'Wrong gnew' )
183
183
self .assertAlmostEqual (crvmin , 0.0 , 'Wrong crvmin' )
184
184
185
185
@@ -203,7 +203,7 @@ def runTest(self):
203
203
# print(s_cauchy)
204
204
# print(d)
205
205
self .assertTrue (est_min <= red_cauchy , 'Cauchy reduction not achieved' )
206
- self .assertTrue (np .all (gnew == g + H .dot (d )), 'Wrong gnew' )
206
+ self .assertTrue (np .allclose (gnew , g + H .dot (d )), 'Wrong gnew' )
207
207
# print(crvmin)
208
208
self .assertAlmostEqual (crvmin , - 1.0 , 'Wrong crvmin' )
209
209
0 commit comments