Skip to content

Commit 237f2a4

Browse files
committed
Revert "[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1"
This reverts commit 97846a6.
1 parent 30573a7 commit 237f2a4

2 files changed

Lines changed: 12 additions & 15 deletions

File tree

stan/math/mix/functor/laplace_marginal_density_estimator.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -970,11 +970,10 @@ inline auto run_newton_loop(SolverPolicy& solver, NewtonStateT& state,
970970
* Stop when objective change is small, or when a rejected Wolfe step
971971
* fails to improve; finish_update then exits the Newton loop.
972972
*/
973-
const bool obj_below_tol
974-
= std::abs(state.curr().obj() - state.prev().obj())
975-
< options.tolerance;
973+
const bool obj_below_tol = std::abs(state.curr().obj() - state.prev().obj()) <
974+
options.tolerance;
976975
const bool wolfe_failed = !state.wolfe_status.accept_
977-
&& state.curr().obj() <= state.prev().obj();
976+
&& state.curr().obj() <= state.prev().obj();
978977
finish_update = force_finish || obj_below_tol || wolfe_failed;
979978
}
980979
if (finish_update) {

stan/math/mix/functor/wolfe_line_search.hpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -940,11 +940,10 @@ inline WolfeStatus wolfe_line_search(Info& wolfe_info, UpdateFun&& update_fun,
940940
* | [3] T | F | < 0 | Bracket found: stop
941941
* | [4] F | T | | Bracket found: stop
942942
* | [5] F | F | | Bracket found: stop
943-
* NOTE: In an ideal case we would end up with a positive low directional
944-
*gradient and negative high directional gradient. Cubic interpolation
945-
*requires a bracket with directional shape like /\. This scheme does not
946-
*gurantee a bracket with that shape will be found. So in the zoom we will
947-
*have to check if we can do cubic or have to fallback to bisection.
943+
* NOTE: In an ideal case we would end up with a positive low directional gradient and
944+
* negative high directional gradient. Cubic interpolation requires a bracket with directional
945+
* shape like /\. This scheme does not gurantee a bracket with that shape will be found.
946+
* So in the zoom we will have to check if we can do cubic or have to fallback to bisection.
948947
**/
949948
while (high.alpha() < opt.max_alpha) {
950949
num_backtracks++;
@@ -1025,12 +1024,11 @@ inline WolfeStatus wolfe_line_search(Info& wolfe_info, UpdateFun&& update_fun,
10251024
* Exit/update table (evaluated at `mid`, with `low` = best Armijo endpoint):
10261025
* | Armijo? | obj(mid) >= obj(low)? | Wolfe? | dir(mid) >= 0? | Action
10271026
* |---------|-----------------------|--------|----------------|--------------------------|
1028-
* | T | F | T | * | accept mid
1029-
*[1] | | T | T | * | * | high
1030-
*= mid [2] | | T | F | F | T
1031-
*| high = low; low = mid [3]| | T | F | F | F
1032-
*| low = mid [4] | | F | * | * | *
1033-
*| high = mid [5] |
1027+
* | T | F | T | * | accept mid [1] |
1028+
* | T | T | * | * | high = mid [2] |
1029+
* | T | F | F | T | high = low; low = mid [3]|
1030+
* | T | F | F | F | low = mid [4] |
1031+
* | F | * | * | * | high = mid [5] |
10341032
* ----------------------------------------------------------------------------------------
10351033
**/
10361034
while ((high.alpha() - low.alpha() > opt.min_alpha)

0 commit comments

Comments
 (0)