@@ -149,7 +149,7 @@ function unit_box_bfgs(
149149 Hi = V' * Hi * V + r * (du * du' )
150150 end
151151 else
152- print_msg (" Hessian not updated during iteration $it " , :red )
152+ print_msg (" Hessian not updated during iteration $it " , :yellow )
153153 end
154154 end
155155 # Update history
@@ -560,7 +560,17 @@ function update_history!(hst::Union{OptimizationHistory, Vector}, val, u, pg, al
560560end
561561
562562function printInfo (history, it)
563- return @printf (" It: %3d | val: %.3e | ls-its: %d | pgrad: %.3e\n " , it, abs (history. val[end ]), history. lsit[end ], history. pg[end ][end ])
563+ lsit = history. lsit[end ]
564+ if it == 0
565+ println (" It. | Objective | Proj. grad | Linesearch-its" )
566+ println (" -----------------------------------------------" )
567+ end
568+ if isnan (lsit)
569+ lsit = " -"
570+ else
571+ lsit = " $(lsit) "
572+ end
573+ return @printf (" %4d | %.4e | %.4e | %s\n " , it, abs (history. val[end ]), history. pg[end ][end ], lsit)
564574end
565575
566576function line_search (
@@ -637,15 +647,15 @@ function line_search(
637647 a = min (a, p2. a - sgf * (p2. a - p1. a))
638648 else
639649 a = (p1. a + p2. a) / 2
640- print_msg (" Cubic interpolation failed, cutting interval in half ..." , :red )
650+ print_msg (" Cubic interpolation failed, cutting interval in half ..." , :yellow )
641651 end
642652 end
643653 end
644654 end
645655 # Check if line search succeeded
646656 if ! line_search_done
647657 flag = - 2
648- print_msg (" Line search unable to succeed in $max_it iterations ..." , :red )
658+ print_msg (" Line search unable to succeed in $max_it iterations ..." , :yellow )
649659 # Although line search did not succeed in max_it iterations, we ensure
650660 # to return the greater of p1 and p2's objective value none the less.
651661 if p1. v < p2. v
0 commit comments