Follow-up from review of #556.
Currently sequant::OptimizeOptions::objective_function selects the single-term/top-level optimization cost model from a fixed enum class ObjectiveFunction { DenseFLOPs, DenseSize }. @Krzmbrzl suggested making the objective a passed-in function object instead, with named default implementations corresponding to today's enum values. That would let downstream users supply custom cost models without modifying SeQuant source.
Scope (separate from the #556 terminology rename):
- Replace the enum dispatch in
single_term.hpp / optimize.cpp with a callable cost interface.
- Provide named default objective objects for the current
DenseFLOPs / DenseSize models.
- Decide how the volatile/footprint weighting (currently gated on
objective_function == DenseFLOPs) composes with a custom objective.
- Keep the enum as a convenience or remove it.
Follow-up from review of #556.
Currently
sequant::OptimizeOptions::objective_functionselects the single-term/top-level optimization cost model from a fixedenum class ObjectiveFunction { DenseFLOPs, DenseSize }. @Krzmbrzl suggested making the objective a passed-in function object instead, with named default implementations corresponding to today's enum values. That would let downstream users supply custom cost models without modifying SeQuant source.Scope (separate from the #556 terminology rename):
single_term.hpp/optimize.cppwith a callable cost interface.DenseFLOPs/DenseSizemodels.objective_function == DenseFLOPs) composes with a custom objective.