Skip to content

Commit a2e9266

Browse files
committed
wip
1 parent 13f8444 commit a2e9266

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

highs/pdlp/hipdlp/pdhg.cc

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,12 @@ void PDLPSolver::Solve(HighsLp& original_lp, const PrimalDualParams& params,
322322
const double fixed_eta = 0.99 / sqrt(op_norm_sq);
323323
PrimalDualParams working_params = params;
324324

325-
working_params.omega = step_size.dual_step;
326-
working_params.eta = step_size.primal_step;
325+
working_params.omega = std::sqrt(step_size.dual_step / step_size.primal_step);
326+
working_params.eta = std::sqrt(step_size.primal_step * step_size.dual_step);
327327
current_eta_ =
328-
step_size.primal_step; // Initial step size for adaptive strategy
329-
std::cout << "Using power method step sizes: eta = " << step_size.primal_step
330-
<< ", omega = " << step_size.dual_step << std::endl;
328+
working_params.eta; // Initial step size for adaptive strategy
329+
std::cout << "Using power method step sizes: eta = " << working_params.eta
330+
<< ", omega = " << working_params.omega << std::endl;
331331

332332
printf(
333333
"Initial step sizes from power method lambda = %g: primal = %g; dual = "
@@ -714,6 +714,7 @@ std::pair<double, double> PDLPSolver::ComputeDualFeasibility(
714714
// constraints.
715715
dual_residual[i] =
716716
lp.col_cost_[i] - ATy_vector[i] - (dSlackPos_[i] - dSlackNeg_[i]);
717+
717718
dual_feasibility_squared += dual_residual[i] * dual_residual[i];
718719
}
719720

@@ -792,6 +793,11 @@ bool PDLPSolver::CheckConvergence(const HighsLp& lp,
792793
ComputeDualityGap(lp, x, y, lambda);
793794
results.duality_gap = duality_gap;
794795

796+
results.relative_obj_gap = std::abs(duality_gap) / (1.0 + std::abs(cTx) +
797+
std::abs(qTy) +
798+
std::abs(lTlambda_plus) +
799+
std::abs(uTlambda_minus));
800+
795801
bool primal_feasible = primal_feasibility <= epsilon * (1 + q_norm);
796802
bool dual_feasible = dual_feasibility <= epsilon * (1 + c_norm);
797803

highs/pdlp/hipdlp/step.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ void UpdateIteratesFixed(const HighsLp& lp, const PrimalDualParams& params,
138138
const std::vector<double>& x_current,
139139
const std::vector<double>& y_current,
140140
const std::vector<double>& ax_current) {
141-
UpdateX(x_new, x_current, lp, y_current, fixed_eta, params.omega);
141+
UpdateX(x_new, x_current, lp, y_current, params.eta, params.omega);
142142
linalg::Ax(lp, x_new, ax_new);
143-
UpdateY(y_new, y_current, lp, ax_new, ax_current, fixed_eta, params.omega);
143+
UpdateY(y_new, y_current, lp, ax_new, ax_current, params.eta, params.omega);
144144
}
145145

146146
void UpdateIteratesAdaptive(const HighsLp& lp, const PrimalDualParams& params,

0 commit comments

Comments
 (0)