PANOC-ALM  quadratic-penalty
Nonconvex constrained optimization
CUTEst/Rosenbrock/main.cpp

This example shows how to load and solve CUTEst problems using PANOC-ALM.

#include <iostream>
int main() {
using pa::vec;
// Paths to the files generated by CUTEst
const char *so_fname = "CUTEst/ROSENBR/libcutest-problem-ROSENBR.so";
const char *outsdif_fname = "CUTEst/ROSENBR/OUTSDIF.d";
// Load the problem
CUTEstProblem cutest_p(so_fname, outsdif_fname);
const pa::Problem &p = cutest_p.problem;
// Settings for the outer augmented Lagrangian method
almparam.ε = 1e-8; // tolerance
almparam.δ = 1e-8;
almparam.Δ = 10;
almparam.max_iter = 20;
almparam.print_interval = 1;
// Settings for the inner PANOC solver
panocparam.max_iter = 500;
panocparam.print_interval = 10;
// Settings for the L-BFGS algorithm used by PANOC
lbfgsparam.memory = 10;
// Create an ALM solver using PANOC as inner solver
almparam, // params for outer solver
{panocparam, lbfgsparam}, // inner solver
};
// Initial guess
vec x = cutest_p.x0;
vec y = cutest_p.y0;
// Solve the problem
auto stats = solver(p, y, x);
// Print the results
std::cout << "status: " << stats.status << std::endl;
std::cout << "x = " << x.transpose() << std::endl;
std::cout << "y = " << y.transpose() << std::endl;
vec g(p.m);
p.g(x, g);
std::cout << "g = " << g.transpose() << std::endl;
std::cout << "f = " << p.f(x) << std::endl;
std::cout << "inner: " << stats.inner.iterations << std::endl;
std::cout << "outer: " << stats.outer_iterations << std::endl;
}
main
int main()
Definition: CUTEst/Rosenbrock/main.cpp:15
panocpy.test.stats
stats
Definition: test.py:76
lbfgs.hpp
panocpy.test.y
y
Definition: test.py:76
CUTEstProblem::y0
pa::vec y0
Initial value of Lagrange multipliers.
Definition: CUTEstLoader.hpp:87
main.panocparam
panocparam
Definition: main.py:33
alm.hpp
pa::vec
realvec vec
Default type for vectors.
Definition: vec.hpp:14
CUTEstLoader.hpp
CUTEstProblem::problem
pa::Problem problem
Problem statement (bounds, objective, constraints)
Definition: CUTEstLoader.hpp:83
main.lbfgsparam
lbfgsparam
Definition: main.py:38
pa::ALMSolver
Augmented Lagrangian Method solver.
Definition: decl/alm.hpp:82
pa::PANOCParams
Tuning parameters for the PANOC algorithm.
Definition: inner/decl/panoc.hpp:20
panocpy.test.x
x
Definition: test.py:40
pa::ALMParams
Parameters for the Augmented Lagrangian solver.
Definition: decl/alm.hpp:13
main.almparam
almparam
Definition: main.py:25
pa::LBFGSParams
Parameters for the LBFGS and SpecializedLBFGS classes.
Definition: decl/lbfgs.hpp:12
panoc.hpp
CUTEstProblem
Wrapper for CUTEst problems loaded from an external shared library.
Definition: CUTEstLoader.hpp:16
CUTEstProblem::x0
pa::vec x0
Initial value of decision variables.
Definition: CUTEstLoader.hpp:86
panocpy.test.solver
solver
Definition: test.py:8
panocpy.test.g
g
Definition: test.py:51
panocpy.test.p
p
Definition: test.py:57
pa::Problem
Problem description for minimization problems.
Definition: include/panoc-alm/util/problem.hpp:24