@@ -157,9 +157,9 @@ namespace internal {
157157 */
158158template <typename Scalar>
159159[[nodiscard]] inline Scalar cubic_spline (Scalar x_left, Scalar f_left,
160- Scalar df_left, Scalar x_right,
161- Scalar f_right,
162- Scalar df_right) noexcept {
160+ Scalar df_left, Scalar x_right,
161+ Scalar f_right,
162+ Scalar df_right) noexcept {
163163 const Scalar midpoint = (x_left + x_right) / Scalar (2 );
164164
165165 // Basic validation: ordering + finiteness.
@@ -284,8 +284,8 @@ template <typename Scalar>
284284
285285template <typename Eval, typename Options>
286286inline auto cubic_spline (Eval&& low, Eval&& high, Options&& opt) {
287- auto alpha = cubic_spline (low.alpha (), low.obj (), low.dir (),
288- high. alpha (), high.obj (), high.dir ());
287+ auto alpha = cubic_spline (low.alpha (), low.obj (), low.dir (), high. alpha (),
288+ high.obj (), high.dir ());
289289 const double width = high.alpha () - low.alpha ();
290290 const double guard = 1e-3 * width; // or make this an option
291291 alpha = std::clamp (alpha, low.alpha () + guard, high.alpha () - guard);
@@ -608,13 +608,13 @@ inline auto retry_evaluate(Update&& update, Proposal&& proposal, Curr&& curr,
608608 * The search maintains a left endpoint `low`, a right endpoint `high`,
609609 * and a fallback `best` (best Armijo-satisfying point seen so far).
610610 * Non-finite evaluations are contracted by factor `opt.tau` automatically.
611- *
611+ *
612612 * ## Phase 1: Aggresive Expansion
613613 * The user given initial step size is expanded by `opt.scale_up` until
614614 * either Wolfe conditions are violated or `opt.max_alpha` is reached.
615615 * If the first evaluation satisfies both conditions, the search expands
616616 * further ("zoom-up") to find the largest such step before accepting.
617- *
617+ *
618618 * ## Phase 2: Expansion / Bracketing
619619 *
620620 * Starting from $\alpha_0 = \text{clamp}(\text{curr.alpha} \cdot
@@ -632,9 +632,9 @@ inline auto retry_evaluate(Update&& update, Proposal&& proposal, Curr&& curr,
632632 * | T | F | <= 0 | Bracket found, go to zoom |
633633 * | F | - | - | Bracket found, go to zoom |
634634 * ```
635- *
635+ *
636636 * The goal of this phase is to find a valid bracket `[low, high]`
637- * Ideally such that the low endpoint satisfies Armijo and has
637+ * Ideally such that the low endpoint satisfies Armijo and has
638638 * a positive derivative, while the high endpoint has a negative
639639 * derivative. This gives us a shape like /\ to search through
640640 * in the zoom phase. If such a bracket cannot be found
@@ -790,10 +790,10 @@ inline WolfeStatus wolfe_line_search(Info& wolfe_info, UpdateFun&& update_fun,
790790 return wolfe_check;
791791 }
792792 if (check_armijo (high, prev, opt)) {
793- if (check_wolfe (high, prev, opt)) { // [1]
793+ if (check_wolfe (high, prev, opt)) { // [1]
794794 curr.update (scratch, high);
795795 return WolfeStatus{WolfeReturn::Wolfe, total_updates, num_backtracks,
796- true };
796+ true };
797797 }
798798 if (best.obj () < high.obj ()) {
799799 best = high;
@@ -887,7 +887,7 @@ inline WolfeStatus wolfe_line_search(Info& wolfe_info, UpdateFun&& update_fun,
887887 num_backtracks, false };
888888 }
889889 if (check_armijo (mid, prev, opt)) {
890- if (check_wolfe (mid, prev, opt)) { // [1]
890+ if (check_wolfe (mid, prev, opt)) { // [1]
891891 curr.update (scratch, mid);
892892 return WolfeStatus{WolfeReturn::Wolfe, total_updates, num_backtracks,
893893 true };
@@ -897,16 +897,16 @@ inline WolfeStatus wolfe_line_search(Info& wolfe_info, UpdateFun&& update_fun,
897897 best = mid;
898898 }
899899 if (mid.obj () > low.obj ()) {
900- if (mid.dir () > 0 ) { // [2]
900+ if (mid.dir () > 0 ) { // [2]
901901 low = mid;
902- } else { // [3]
902+ } else { // [3]
903903 high = mid;
904904 }
905905 }
906906 // [4]
907- high = mid;
908- } else {
909- // [5]
907+ high = mid;
908+ } else {
909+ // [5]
910910 high = mid;
911911 }
912912 // Convergence/guard-rail checks (uses prev/grad_tol/obj_tol etc.)
0 commit comments