I don't want to be nitpicking too much but maybe with the introduction of solver_pm_t we can also use some more descriptive parameter names for the members? I think it will avoid headaches in the future if we stick to a good variable naming scheme.

f,g,N and esp_sq are not very insightful. Seeing the types here makes things clearer but I would have rather seen in the code why setting "g" to "&Q_nd..." makes sense..