PANOC-ALM  quadratic-penalty
Nonconvex constrained optimization
CUTEst/Rosenbrock/main.cpp
Go to the documentation of this file.
1 
7 #include <panoc-alm/decl/alm.hpp>
10 
12 
13 #include <iostream>
14 
15 int main() {
16  using pa::vec;
17 
18  // Paths to the files generated by CUTEst
19  const char *so_fname = "CUTEst/ROSENBR/libcutest-problem-ROSENBR.so";
20  const char *outsdif_fname = "CUTEst/ROSENBR/OUTSDIF.d";
21 
22  // Load the problem
23  CUTEstProblem cutest_p(so_fname, outsdif_fname);
24  const pa::Problem &p = cutest_p.problem;
25 
26  // Settings for the outer augmented Lagrangian method
28  almparam.ε = 1e-8; // tolerance
29  almparam.δ = 1e-8;
30  almparam.Δ = 10;
31  almparam.max_iter = 20;
32  almparam.print_interval = 1;
33 
34  // Settings for the inner PANOC solver
36  panocparam.max_iter = 500;
37  panocparam.print_interval = 10;
38  // Settings for the L-BFGS algorithm used by PANOC
40  lbfgsparam.memory = 10;
41 
42  // Create an ALM solver using PANOC as inner solver
44  almparam, // params for outer solver
45  {panocparam, lbfgsparam}, // inner solver
46  };
47 
48  // Initial guess
49  vec x = cutest_p.x0;
50  vec y = cutest_p.y0;
51 
52  // Solve the problem
53  auto stats = solver(p, y, x);
54 
55  // Print the results
56  std::cout << "status: " << stats.status << std::endl;
57  std::cout << "x = " << x.transpose() << std::endl;
58  std::cout << "y = " << y.transpose() << std::endl;
59  vec g(p.m);
60  p.g(x, g);
61  std::cout << "g = " << g.transpose() << std::endl;
62  std::cout << "f = " << p.f(x) << std::endl;
63  std::cout << "inner: " << stats.inner.iterations << std::endl;
64  std::cout << "outer: " << stats.outer_iterations << std::endl;
65 }
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