[solvers] Port solver back-ends to use SpecificOptions #21345
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.
Towards #20967.
In the near future, we anticipate changing the SolverOptions API in support of loading and saving (i.e., serialization). That's especially troublesome for our solver back-ends that consume its information, given the low-level and hodge-podge ways in which they hunt for and apply their specific options.
This commit introduces a higher-level intermediary between solver back-ends and the program's options. Now SolverOptions are solely a user-facing aspect of defining a program; the solver back-ends never touch SolverOptions anymore. The new SolverBase::DoSolve2 virtual provides the mechanism for back-ends to take advantage of the new API. All solvers have been ported to use it. The old API remains intact for any out-of-tree solvers.
The new API is also designed to improve uniformity of common errors, such as unknown names or wrongly-typed values.
The new API also lays the groundwork for more efficient processing, as future work. It removes the need for the "Merge" (copy) operation in the hot path -- since it only provides a view of the options, it can easily keep track of several dictionaries and query them in order, with no copying.
This change is