Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #148 the ability of the user to specify x0 from the C interface was removed. This PR fixes that. I noted this at the time in a comment in 488abda but I suppose you missed it.
In the issue you objected to setting result->x to x0, but there is no other reasonable way to provide x0 to the Fortran code. In the issue you mentioned that result->x was set to a reasonable value even though no solver was selected, but the correct solution to that would be to have
prima_check_problem
return a non-zero exit code when it doesn't select a solver, as I mentioned in the issue.Separately, I discuss this in my comment on the commit linked above as well, the modifications from that issue led to a possible memory leak. If
prima_init_result
returned 0 butprima_check_problem
did not, we would return to the user with a non-zero exit code and also with allocated memory that the user would be expected to free. Of course it's not appropriate to both return a non-zero exit code and expect the user to clean up after us. The easiest way to solve this problem is to just check the problem before initializing the result.