ASL: lagscale, write_sol and duals' signs

Hello,

I’m using the following Lagrangian definition in my solver: \mathcal{L}(x, y, z) = f(x) - y^T c(x) - z, while the ASL Hessian is defined as \nabla^2 \mathcal{L}(x, y) = \nabla^2 f(x) + \sum_{j=1}^m y_j \nabla^2 c_j(x).

Therefore I call ASL’s lagscale with scaling coefficient -1, but this also flips the signs of the dual solution when I call write_sol. I would like to avoid that and write my dual solution as is.

A call to lagscale with scaling coefficient 1 just before calling write_sol has no effect (it terminates immediately). What are my options here?

Thank you,
Charlie

As you have seen, calling lagscale again after solving does not have any effect on write_sol.

In this case, you’ll need to add a line of code — after calling your solver but before calling write_sol — to flip the signs of all the dual values that the solver returned. Then write_sol will automatically flip them again, and thus will write the solver’s actual dual values.

Got it, thank you for your feedback!