Solver Configuration¶
Reference for solver configuration methods.
Configuration Methods¶
POGS solvers are configured using setter methods on the solver instance. All parameters have sensible defaults.
SetRho¶
Default: 1.0
Range: (0, infinity)
The ADMM penalty parameter. Controls the weight of the augmented Lagrangian term.
Guidelines: - Larger rho (5.0-100.0): Faster convergence, potentially less accurate - Smaller rho (0.01-0.5): Slower convergence, more accurate - Default (1.0): Good starting point for most problems
SetAbsTol¶
Default: 1e-4
Range: (0, 1)
Absolute tolerance for convergence.
Solver stops when: $$ |r|2 \leq \epsilon \cdot \max(|Ax|_2, |y|_2) $$}} + \epsilon_{\text{rel}
Guidelines:
- High accuracy: 1e-6 or smaller
- Medium accuracy: 1e-4 (default)
- Low accuracy: 1e-2
SetRelTol¶
Default: 1e-3
Range: (0, 1)
Relative tolerance for convergence.
SetMaxIter¶
Default: 2500
Range: [1, infinity)
Maximum number of ADMM iterations.
Guidelines: - Easy problems: 100-500 iterations sufficient - Medium problems: 1000-2000 iterations - Hard problems: 5000-10000 iterations
SetVerbose¶
Default: 2
Range: 0-4
Verbosity level:
- 0: Silent
- 1: Summary only
- 2: Progress every 10 iterations
- 3: Progress every iteration
- 4: Debug output
Output format:
Iter Primal Res Dual Res Gap rho
10 1.23e-02 4.56e-03 8.90e-02 1.00
20 3.45e-03 1.23e-03 2.34e-02 1.00
...
SetAdaptiveRho¶
Default: true
Enable adaptive adjustment of rho based on residual balance.
When enabled, rho is automatically adjusted: - Increase rho if primal residual >> dual residual - Decrease rho if dual residual >> primal residual
Guidelines: - Enable (recommended): Better convergence for most problems - Disable: When you want fixed rho or manual control
SetGapStop¶
Default: false
Enable duality gap stopping criterion.
Stops when both residuals are small AND duality gap is small.
SetUseAnderson¶
Default: false
Enable Anderson acceleration for faster convergence.
Anderson acceleration can provide up to 2x speedup on well-conditioned problems.
SetAndersonMem¶
Default: 5
Range: [1, 20]
Number of past iterates to store for Anderson acceleration.
Only used when SetUseAnderson(true).
SetAndersonStart¶
Default: 10
Range: [0, max_iter)
Iteration number to start applying Anderson acceleration.
Only used when SetUseAnderson(true).
SetInitX¶
Provide an initial guess for the primal variable x (warm start).
Usage:
SetInitLambda¶
Provide an initial guess for the dual variable lambda (warm start).
Default Values Summary¶
| Parameter | Default | Description |
|---|---|---|
rho |
1.0 | ADMM penalty parameter |
abs_tol |
1e-4 | Absolute tolerance |
rel_tol |
1e-3 | Relative tolerance |
max_iter |
2500 | Maximum iterations |
verbose |
2 | Verbosity level |
adaptive_rho |
true | Enable adaptive penalty |
gap_stop |
false | Stop on duality gap |
use_anderson |
false | Anderson acceleration |
anderson_mem |
5 | Anderson memory depth |
anderson_start |
10 | Anderson start iteration |
Usage Examples¶
Basic Configuration¶
#include "pogs.h"
#include "matrix/matrix_dense.h"
pogs::MatrixDense<double> A('r', m, n, A_data);
pogs::PogsDirect<double, pogs::MatrixDense<double>> solver(A);
// Configure
solver.SetAbsTol(1e-4);
solver.SetRelTol(1e-3);
solver.SetMaxIter(1000);
solver.SetVerbose(2);
// Solve
PogsStatus status = solver.Solve(f, g);
High Accuracy¶
solver.SetAbsTol(1e-6);
solver.SetRelTol(1e-5);
solver.SetMaxIter(5000);
solver.SetRho(0.1);
solver.SetAdaptiveRho(true);
Fast Approximate Solution¶
With Anderson Acceleration¶
solver.SetUseAnderson(true);
solver.SetAndersonMem(10);
solver.SetAndersonStart(20);
solver.SetMaxIter(1000);
Warm Starting¶
// First solve
solver.Solve(f, g);
const double* x_solution = solver.GetX();
const double* lambda_solution = solver.GetLambda();
// Modify problem slightly...
// Warm start second solve
double x_init[n], lambda_init[m];
memcpy(x_init, x_solution, n * sizeof(double));
memcpy(lambda_init, lambda_solution, m * sizeof(double));
solver.SetInitX(x_init);
solver.SetInitLambda(lambda_init);
solver.Solve(f_modified, g_modified);
Performance Tuning¶
Well-Conditioned Problems¶
Ill-Conditioned Problems¶
Large-Scale Problems¶
solver.SetAbsTol(1e-3);
solver.SetRelTol(1e-2);
solver.SetMaxIter(2000);
solver.SetVerbose(1); // Less output
See Also¶
- Solver API - Main solver interface
- Basic Usage - Usage guide
- Advanced Features - Parameter tuning