29 using std::chrono::nanoseconds;
30 auto start_time = std::chrono::steady_clock::now();
31 auto os =
opts.os ?
opts.os : this->os;
32 auto max_time = nanoseconds::max();
34 max_time = std::min(max_time, *
opts.max_time);
37 const auto n = problem.get_n();
38 const auto m = problem.get_m();
39 const auto &C = problem.get_box_C();
41 vec work_n(n), work_m(m);
56 if (stop_signal.stop_requested()) {
64 if (
opts.always_overwrite_results)
67 s.
final_ψ = problem.eval_ψ(xk, y, Σ, work_m);
71 const auto ψx = problem.eval_ψ_grad_ψ(xk, y, Σ,
grad, work_n, work_m);
73 if (!std::isfinite(
ψx)) {
74 if (
opts.always_overwrite_results)
85 C.lowerbound, C.upperbound);
91 }
catch (
const std::exception &e) {
93 *os <<
"[LBFGSB] Exception: " << e.what() << std::endl;
99 s.
ε = solver.final_grad_norm();
103 opts.always_overwrite_results) {
106 if (
err_z.size() > 0)
107 err_z = Σ.asDiagonal().inverse() * (
ŷ - y);