File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 7
7
8
8
//! * [Hager-Zhang line search](struct.HagerZhangLineSearch.html)
9
9
//!
10
- //! TODO: Not all stopping criteria implemented
11
- //!
12
10
//! # Reference
13
11
//!
14
12
//! William W. Hager and Hongchao Zhang. "A new conjugate gradient method with guaranteed descent
@@ -533,10 +531,9 @@ where
533
531
}
534
532
535
533
fn terminate ( & mut self , _state : & IterState < O > ) -> TerminationReason {
536
- if self . best_f - self . finit <= self . delta * self . best_x * self . dginit {
537
- return TerminationReason :: LineSearchConditionMet ;
538
- }
539
- if self . best_g >= self . sigma * self . dginit {
534
+ if self . best_f - self . finit <= self . delta * self . best_x * self . dginit
535
+ && self . best_g >= self . sigma * self . dginit
536
+ {
540
537
return TerminationReason :: LineSearchConditionMet ;
541
538
}
542
539
if ( F :: from_f64 ( 2.0 ) . unwrap ( ) * self . delta - F :: from_f64 ( 1.0 ) . unwrap ( ) ) * self . dginit
You can’t perform that action at this time.
0 commit comments