|
Gecode 6.4.0
|
Optional sparse optimization models, backends and owning results. More...
Namespaces | |
| namespace | Detail |
Typedefs | |
| using | LpSensitivityParameter = std::variant<LpObjectiveParameter,LpEqualityRhsParameter> |
| using | LpSensitivityEntity = std::variant<Variable,Constraint> |
| using | GlobalPayload |
| using | ModelId = std::uint64_t |
| using | Revision = std::uint64_t |
Functions | |
| IndicatorFormulation | add_indicator (Model &model, Variable activator, bool active_value, const std::vector< Term > &terms, double lower, double upper, std::string name={}) |
| void | remove_indicator (Model &model, Indicator indicator) |
| std::vector< Constraint > | add_boolean_and (Model &model, Variable result, const std::vector< Variable > &inputs, std::string name={}) |
| std::vector< Constraint > | add_boolean_or (Model &model, Variable result, const std::vector< Variable > &inputs, std::string name={}) |
| ConflictResult | analyze_conflict (const ModelSnapshot &model, const ConflictOptions &options={}) |
| ConflictResult | analyze_conflict (const Model &model, const ConflictOptions &options={}) |
| FlatZincCompileResult | compile_flatzinc (const FlatZinc::Capture::Records &source, const FlatZincCompileOptions &options={}) |
| FlatZincValidation | validate_flatzinc (const CompiledFlatZinc &, const SolveResult &, double integrality_tolerance=1e-6) |
| std::string | format_flatzinc_solution (const CompiledFlatZinc &, const SolveResult &, double integrality_tolerance=1e-6) |
| GlobalConstraint | add_all_different (Model &, const std::vector< Variable > &, std::string name={}) |
| Retain pairwise inequality of the supplied integer-variable slots. | |
| GlobalConstraint | add_element (Model &, Variable index, const std::vector< Variable > &elements, Variable result, std::int64_t index_base=0, std::string name={}) |
| Retain result == elements[index-index_base], including repeated handles. | |
| GlobalConstraint | add_table (Model &, const std::vector< Variable > &, const std::vector< std::vector< std::int64_t > > &, std::string name={}) |
| GlobalConstraint | add_cumulative (Model &, const std::vector< Variable > &starts, const std::vector< std::int64_t > &durations, const std::vector< std::int64_t > &heights, std::int64_t capacity, std::string name={}) |
| GlobalConstraint | add_circuit (Model &, const std::vector< Variable > &successors, std::int64_t index_base=0, std::string name={}) |
| GlobalConstraint | add_regular (Model &, const std::vector< Variable > &variables, std::uint64_t state_count, std::uint64_t initial_state, const std::vector< RegularTransition > &transitions, const std::vector< std::uint64_t > &final_states, std::string name={}) |
| std::shared_ptr< const LpBasis > | make_lp_basis (const LpBasisData &) |
| std::shared_ptr< const LpBasis > | make_lp_basis (const LpObservations &) |
| LpBasisSolveResult | solve_lp_with_basis (const ModelSnapshot &, const LpBasisSolveOptions &) |
| LpBasisSolveResult | solve_lp_with_basis (const Model &, const LpBasisSolveOptions &) |
| LpEvidenceResult | analyze_lp_evidence (const ModelSnapshot &, const LpEvidenceOptions &={}) |
| LpEvidenceResult | analyze_lp_evidence (const Model &, const LpEvidenceOptions &={}) |
| LpObservationCapabilities | lp_observation_capabilities () |
| LpObservedResult | solve_lp_observed (const ModelSnapshot &, const LpObservationOptions &={}) |
| LpObservedResult | solve_lp_observed (const Model &, const LpObservationOptions &={}) |
| LpSensitivityResult | analyze_lp_sensitivity (const LpObservedResult &, const LpSensitivityOptions &) |
| BackendCapabilities | native_capabilities () |
| SolveResult | solve_native (const ModelSnapshot &model, const SolveOptions &options={}) |
| SolveResult | solve_native (const Model &model, const SolveOptions &options={}) |
| BackendCapabilities | native_lp_capabilities () |
| NativeLpResult | solve_native_lp (const ModelSnapshot &model, const NativeLpOptions &options={}) |
| NativeLpResult | solve_native_lp (const Model &model, const NativeLpOptions &options={}) |
| NativeNeighborhoodResult | solve_native_neighborhoods (const ModelSnapshot &, const NativeNeighborhoodOptions &={}) |
| NativeNeighborhoodResult | solve_native_neighborhoods (const Model &, const NativeNeighborhoodOptions &={}) |
| NativeSearchResult | solve_native_search (const ModelSnapshot &model, const NativeSearchOptions &options={}) |
| NativeSearchResult | solve_native_search (const Model &model, const NativeSearchOptions &options={}) |
| PoolResult | solve_pool (const ModelSnapshot &model, const PoolOptions &options={}) |
| PoolResult | solve_pool (const Model &model, const PoolOptions &options={}) |
| PresolveResult | presolve_integer (const ModelSnapshot &model, const PresolveOptions &options={}) |
| PresolveResult | presolve_integer (const Model &model, const PresolveOptions &options={}) |
| QuadraticValidation | validate_quadratic (const QuadraticSnapshot &, const std::vector< double > &, double feasibility_tolerance=1e-7) |
| QuadraticResult | solve_quadratic (const QuadraticSnapshot &, const QuadraticOptions &={}) |
| QuadraticResult | solve_quadratic (const QuadraticModel &, const QuadraticOptions &={}) |
| BackendCapabilities | quadratic_capabilities () |
| RelaxationResult | relax_feasibility (const ModelSnapshot &model, const RelaxationOptions &options={}) |
| RelaxationResult | relax_feasibility (const Model &model, const RelaxationOptions &options={}) |
| const char * | to_string (Termination termination) noexcept |
| ScenarioBatchResult | solve_scenarios (const ModelSnapshot &, const std::vector< ScenarioDefinition > &, const ScenarioBatchOptions &={}) |
| ScenarioBatchResult | solve_scenarios (const Model &, const std::vector< ScenarioDefinition > &, const ScenarioBatchOptions &={}) |
| BackendCapabilities | capabilities (Backend backend=Backend::Auto) |
| SolveResult | solve (const ModelSnapshot &model, const SolveOptions &options={}) |
| SolveResult | solve (const Model &model, const SolveOptions &options={}) |
| Model | read_model (const std::string &filename) |
| void | write_model (const ModelSnapshot &model, const std::string &filename) |
| void | write_model (const Model &model, const std::string &filename) |
| void | validate_structure (const ModelSnapshot &model) |
| ValidationReport | validate (const ModelSnapshot &model, const std::vector< double > &slot_values, double feasibility_tolerance=1e-7, double integrality_tolerance=1e-6) |
| LexicographicResult | solve_lexicographic (const ModelSnapshot &model, const std::vector< LexicographicObjective > &objectives, const SolveOptions &options={}) |
| LexicographicResult | solve_lexicographic (const Model &model, const std::vector< LexicographicObjective > &objectives, const SolveOptions &options={}) |
Optional sparse optimization models, backends and owning results.
See Optimize: sparse optimization and native integer search for backend scope and Model ownership, logical constraints and results for model ownership, result guarantees and validation.
| using Gecode::Optimize::LpSensitivityParameter = std::variant<LpObjectiveParameter,LpEqualityRhsParameter> |
| using Gecode::Optimize::LpSensitivityEntity = std::variant<Variable,Constraint> |
| using Gecode::Optimize::ModelId = std::uint64_t |
| using Gecode::Optimize::Revision = std::uint64_t |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
| IndicatorFormulation Gecode::Optimize::add_indicator | ( | Model & | model, |
| Variable | activator, | ||
| bool | active_value, | ||
| const std::vector< Term > & | terms, | ||
| double | lower, | ||
| double | upper, | ||
| std::string | name = {} ) |
Add activator == active_value => lower <= sum(terms) <= upper. The activator must have Binary type. Every required inactive activity bound must be finite. M is derived conservatively; no guessed constant is used. The returned gate keeps original coefficients and row bounds unchanged. Original logical metadata is retained for independent solution validation. Successful posting is one revision; errors leave the model unchanged.
Remove logical metadata and all its generated rows in one revision. The auxiliary gate remains a model variable and can be removed once unused.
| std::vector< Constraint > Gecode::Optimize::add_boolean_and | ( | Model & | model, |
| Variable | result, | ||
| const std::vector< Variable > & | inputs, | ||
| std::string | name = {} ) |
result == AND(inputs); AND(empty) is true. All variables must be Binary.
| std::vector< Constraint > Gecode::Optimize::add_boolean_or | ( | Model & | model, |
| Variable | result, | ||
| const std::vector< Variable > & | inputs, | ||
| std::string | name = {} ) |
result == OR(inputs); OR(empty) is false. All variables must be Binary.
| ConflictResult Gecode::Optimize::analyze_conflict | ( | const ModelSnapshot & | model, |
| const ConflictOptions & | options = {} ) |
Deterministic deletion filtering with numerical LP/MILP feasibility oracles. The original objective is replaced privately by zero. All calls share one end-to-end time/cancellation budget. Starts are ignored and gaps forced zero. Any node limit, Exact or Certified request is explicitly Unsupported. See DIAGNOSTICS.md for group granularity and indicator domain ownership. Irreducible means deletion-minimal at that granularity, not minimum size or an exact infeasibility certificate. Interrupted or ambiguous oracles never establish infeasibility or irreducibility.
| ConflictResult Gecode::Optimize::analyze_conflict | ( | const Model & | model, |
| const ConflictOptions & | options = {} ) |
| FlatZincCompileResult Gecode::Optimize::compile_flatzinc | ( | const FlatZinc::Capture::Records & | source, |
| const FlatZincCompileOptions & | options = {} ) |
Compiles authoritative raw_variables/raw_domains/raw_constraints. Normalized parser records are audit data, never a replacement for an original predicate. Only a fully admitted model is published. No backend is called here. Admits bounded integer/Boolean linear/Boolean relations, <= reification and implication, integer equality implication, AllDifferent, 1-based integer Element, positive-arity gecode_table_int and bounded finite integer domains with holes; explicit-offset nonempty Circuit, fixed four-argument Cumulative, and six-argument Regular with literal automaton parameters are also admitted. Equality reification, other global/signature forms, floats/sets and unknown controls remain Unsupported. Invalid literal schemas are InvalidInput. Private gates and fixed literal slots are not source outputs.
| FlatZincValidation Gecode::Optimize::validate_flatzinc | ( | const CompiledFlatZinc & | , |
| const SolveResult & | , | ||
| double | integrality_tolerance = 1e-6 ) |
Recheck identity, all model slots and every original source relation exactly after tolerance-qualified integer rounding. Does not certify the solve bound.
| std::string Gecode::Optimize::format_flatzinc_solution | ( | const CompiledFlatZinc & | , |
| const SolveResult & | , | ||
| double | integrality_tolerance = 1e-6 ) |
Buffered assignments and a solution separator; never an optimality or enumeration-completion marker. Rejects invalid full-model witnesses.
| GlobalConstraint Gecode::Optimize::add_all_different | ( | Model & | , |
| const std::vector< Variable > & | , | ||
| std::string | name = {} ) |
Retain pairwise inequality of the supplied integer-variable slots.
| GlobalConstraint Gecode::Optimize::add_element | ( | Model & | , |
| Variable | index, | ||
| const std::vector< Variable > & | elements, | ||
| Variable | result, | ||
| std::int64_t | index_base = 0, | ||
| std::string | name = {} ) |
Retain result == elements[index-index_base], including repeated handles.
| GlobalConstraint Gecode::Optimize::add_table | ( | Model & | , |
| const std::vector< Variable > & | , | ||
| const std::vector< std::vector< std::int64_t > > & | , | ||
| std::string | name = {} ) |
Retain membership in a positive integer tuple table with matching arity. An empty tuple list is false. A zero-variable table containing an empty tuple is true; the separate FlatZinc compiler requires positive arity.
| GlobalConstraint Gecode::Optimize::add_cumulative | ( | Model & | , |
| const std::vector< Variable > & | starts, | ||
| const std::vector< std::int64_t > & | durations, | ||
| const std::vector< std::int64_t > & | heights, | ||
| std::int64_t | capacity, | ||
| std::string | name = {} ) |
Mandatory fixed-duration tasks, half-open intervals; zero duration/height uses no resource.
| GlobalConstraint Gecode::Optimize::add_circuit | ( | Model & | , |
| const std::vector< Variable > & | successors, | ||
| std::int64_t | index_base = 0, | ||
| std::string | name = {} ) |
One cycle through a nonempty successor array, with explicit index base.
| GlobalConstraint Gecode::Optimize::add_regular | ( | Model & | , |
| const std::vector< Variable > & | variables, | ||
| std::uint64_t | state_count, | ||
| std::uint64_t | initial_state, | ||
| const std::vector< RegularTransition > & | transitions, | ||
| const std::vector< std::uint64_t > & | final_states, | ||
| std::string | name = {} ) |
Retain membership in a deterministic finite automaton's language. States are in [0,state_count); missing transitions reject. Transition keys (from,symbol) must be unique; repeated final states have set semantics. Empty words accept exactly when initial_state is final. No epsilon edges. Posting validates original metadata; native solving applies additional integer, array-size and automaton-storage limits before compilation.
| std::shared_ptr< const LpBasis > Gecode::Optimize::make_lp_basis | ( | const LpBasisData & | ) |
Throw ModelError for malformed/unsupported source or status data.
| std::shared_ptr< const LpBasis > Gecode::Optimize::make_lp_basis | ( | const LpObservations & | ) |
Requires an Available complete original basis; copies historical source.
| LpBasisSolveResult Gecode::Optimize::solve_lp_with_basis | ( | const ModelSnapshot & | , |
| const LpBasisSolveOptions & | ) |
Numerical HiGHS ordinary continuous LP only; active constant rows unsupported. Accepted/Repaired describe setBasis before optimization, not final status. Repaired means statuses changed during submission. No faster-solve, checkpoint, independent nonsingularity, or certificate claim. A rejected backend submission returns without cold fallback, invalidating the session for a clean next load. Factorization/repair is cooperatively budgeted and may be uninterruptible.
| LpBasisSolveResult Gecode::Optimize::solve_lp_with_basis | ( | const Model & | , |
| const LpBasisSolveOptions & | ) |
| LpEvidenceResult Gecode::Optimize::analyze_lp_evidence | ( | const ModelSnapshot & | , |
| const LpEvidenceOptions & | = {} ) |
Fresh private auxiliary solves; no input model, session or historical result is changed. Numerical continuous LPs only, Auto/HiGHS. Unsupported source is never relaxed. Explicit Farkas needs one call; Automatic at most two; Both at most three. All share one time/cancel allowance and deterministic work caps. Complete describes requested analysis, not source-model optimality/status. A checked source base point is required with a primal direction. A feasible point plus accepted contradiction rejects both as inconsistent evidence. Cleanup/factorization is cooperative; a final expired budget clears evidence availability, retaining diagnostics and private-stage provenance only.
| LpEvidenceResult Gecode::Optimize::analyze_lp_evidence | ( | const Model & | , |
| const LpEvidenceOptions & | = {} ) |
| LpObservationCapabilities Gecode::Optimize::lp_observation_capabilities | ( | ) |
| LpObservedResult Gecode::Optimize::solve_lp_observed | ( | const ModelSnapshot & | , |
| const LpObservationOptions & | = {} ) |
HiGHS Numerical only, on original Continuous linear models without active indicators or globals. No automatic relaxation or fallback. The whole-call cooperative budget includes snapshot copying, conversion and checking. Duals require a timely optimal primal/dual point; basis absence does not invalidate a validated primal solution. No ray/ranging work occurs.
| LpObservedResult Gecode::Optimize::solve_lp_observed | ( | const Model & | , |
| const LpObservationOptions & | = {} ) |
| LpSensitivityResult Gecode::Optimize::analyze_lp_sensitivity | ( | const LpObservedResult & | , |
| const LpSensitivityOptions & | ) |
Additional private factorization/linear algebra, zero optimization runs. HiGHS/Auto only; a timely optimal solve_lp_observed() result on a Continuous linear source with checked duals and complete basis. Empty row/column systems, active indicators/globals, elided constant rows, automatic relaxation, replacement bases and stale-revision transplants are unsupported. Only objective coefficients and equality common RHS are supported parameter kinds. Factorization/triangular solves are cooperatively budgeted. A final whole-call limit, cancellation, resource or cleanup failure clears every availability; original solve provenance and completed diagnostics remain historical data.
| BackendCapabilities Gecode::Optimize::native_capabilities | ( | ) |
| SolveResult Gecode::Optimize::solve_native | ( | const ModelSnapshot & | model, |
| const SolveOptions & | options = {} ) |
Solve the supported finite integer subset with native Gecode propagation/BAB. Original indicators use native reification, not their numerical big-M rows. Exact requests use integer arithmetic checks; Certified is unsupported. Interrupted results have no global bound. See NATIVE.md for numeric limits. This explicit entry point accepts backend Auto or Native. Complete exact starts are supported, including deterministic completion of omitted live indicator inactivity gates. Unresolved partial starts, multiple workers and nonzero random seeds are unsupported. The Model overload includes snapshotting in its deadline and translates moved-from model errors to InvalidModel.
| SolveResult Gecode::Optimize::solve_native | ( | const Model & | model, |
| const SolveOptions & | options = {} ) |
| BackendCapabilities Gecode::Optimize::native_lp_capabilities | ( | ) |
| NativeLpResult Gecode::Optimize::solve_native_lp | ( | const ModelSnapshot & | model, |
| const NativeLpOptions & | options = {} ) |
Explicit opt-in: ordinary solve()/Auto/Native defaults are unchanged. Native propagation enforces every original constraint. Only ordinary linear rows enter the sparse relaxation; semivariables use their convex-hull box. LP bounds and interval cuts require checked integer certificates. This is exact discrete solving, not a complete independently checkable solve proof. Missing native/HiGHS/checked-wide-integer support is Unsupported, never a fallback. Original identities, limits and native arithmetic guards apply. Deadlines are cooperative: an LP attempt has a 0.2-second/10,000-iteration backend limit, but neither that limit nor native propagation is preemptive. See NATIVE-LP.md for scope, scheduling and interrupted-bound semantics.
| NativeLpResult Gecode::Optimize::solve_native_lp | ( | const Model & | model, |
| const NativeLpOptions & | options = {} ) |
| NativeNeighborhoodResult Gecode::Optimize::solve_native_neighborhoods | ( | const ModelSnapshot & | , |
| const NativeNeighborhoodOptions & | = {} ) |
Run at most one global BinaryHamming improvement attempt after a checked incumbent, at a stable main-parent boundary. Distance counts active nonfixed original Binary slots without indicator_origin; all other original variables and native constraints remain in the isolated subproblem. There is no partial start repair, current-node LP suggestion, local proof sharing or recursive heuristic. Only a timely exact original-model-validated improvement is shared.
Shared node attempts = ordinary frontier admissions + reliability probe attempts + neighborhood status attempts. Optional admissions reserve two ordinary child slots. Local caps end only the heuristic; global limits stop the solve. Main queued/active regions continue to define any interrupted global bound. Native propagation/posting/checking is cooperative, not hard-preemptible. Existing NativeSearch option/result layouts and existing APIs are unchanged.
| NativeNeighborhoodResult Gecode::Optimize::solve_native_neighborhoods | ( | const Model & | , |
| const NativeNeighborhoodOptions & | = {} ) |
| NativeSearchResult Gecode::Optimize::solve_native_search | ( | const ModelSnapshot & | model, |
| const NativeSearchOptions & | options = {} ) |
Explicit opt-in; solve(), solve_native() and solve_native_lp() are unchanged. Existing finite native integer/global/indicator semantics and limits apply. Stable propagated nodes use normalized minimization bounds. Every unfinished region remains represented, including a parent during partial expansion. Interrupted global bounds aggregate all unresolved regions and an incumbent; they are absent if compilation did not establish the initial objective box. max_open_nodes exhaustion returns MemoryLimit; this is not a byte guarantee. Node quotas restrict admission, allowing the final admitted node to finish when time/cancellation permits. Complete exact starts are supported; no partial starts, parallel workers or gap stopping. An optional relaxation requires native checked LP capability explicitly. BinaryReliability charges probe status attempts to the shared node quota, separately reported from admitted frontier nodes. Probes select a split; they never publish incumbents or pruning evidence. Limits are cooperative around native propagation, which itself runs to fixpoint or failure.
| NativeSearchResult Gecode::Optimize::solve_native_search | ( | const Model & | model, |
| const NativeSearchOptions & | options = {} ) |
| PoolResult Gecode::Optimize::solve_pool | ( | const ModelSnapshot & | model, |
| const PoolOptions & | options = {} ) |
Repeated optimization plus safe no-good exclusions. Returns one representative per finite Integer/Binary projection assignment, ranked by its best original objective when each remaining-model solve completes. Continuous and unbounded non-projected Integer recourse are allowed by the HiGHS backend. Real-valued completions of a projection are not enumerated. Ties have unspecified order. An interrupted timely candidate may be a final unranked entry. Only definite infeasibility of the remaining model establishes projection exhaustion. Exhaustion is a workflow Optimal status; the last oracle attempt is Infeasible. RequestedLimit uses SolutionLimit and never asserts exhaustion. Numerical completion is tolerance-qualified; Exact requires explicit Native support. Semis, active indicators/globals, Certified, and multistage node budgets are explicitly Unsupported. No original model edits occur. See POOLS.md.
| PoolResult Gecode::Optimize::solve_pool | ( | const Model & | model, |
| const PoolOptions & | options = {} ) |
| PresolveResult Gecode::Optimize::presolve_integer | ( | const ModelSnapshot & | model, |
| const PresolveOptions & | options = {} ) |
| PresolveResult Gecode::Optimize::presolve_integer | ( | const Model & | model, |
| const PresolveOptions & | options = {} ) |
| QuadraticValidation Gecode::Optimize::validate_quadratic | ( | const QuadraticSnapshot & | , |
| const std::vector< double > & | , | ||
| double | feasibility_tolerance = 1e-7 ) |
Independent original primal/objective/gradient check; no optimality claim.
| QuadraticResult Gecode::Optimize::solve_quadratic | ( | const QuadraticSnapshot & | , |
| const QuadraticOptions & | = {} ) |
| QuadraticResult Gecode::Optimize::solve_quadratic | ( | const QuadraticModel & | , |
| const QuadraticOptions & | = {} ) |
| BackendCapabilities Gecode::Optimize::quadratic_capabilities | ( | ) |
| RelaxationResult Gecode::Optimize::relax_feasibility | ( | const ModelSnapshot & | model, |
| const RelaxationOptions & | options = {} ) |
Minimize the sum of positive finite penalties times selected side violations. Unselected sides, integrality and intrinsic binary/semi domains remain hard. Binary bound selection relaxes a narrower stored bound only as far as [0,1]. Selected semi bounds, generated indicator rows, indicator-participating variable bounds, active globals and primal starts are explicitly Unsupported. Optional phase two optimizes the original objective with zero requested degradation of minimum weighted violation. All completion is numerical and tolerance-qualified; no original feasible SolveResult is manufactured. The original model is not mutated. See RELAXATION.md for support/limits.
| RelaxationResult Gecode::Optimize::relax_feasibility | ( | const Model & | model, |
| const RelaxationOptions & | options = {} ) |
|
noexcept |
| ScenarioBatchResult Gecode::Optimize::solve_scenarios | ( | const ModelSnapshot & | , |
| const std::vector< ScenarioDefinition > & | , | ||
| const ScenarioBatchOptions & | = {} ) |
Ordinary Continuous/Integer/Binary linear models only. All patches are admitted before any solve; nonempty indicator/global metadata and primal starts are Unsupported. Auto/HiGHS use private session reuse or Cold solves; explicit Native uses its ordinary one-shot route and exact admission. One whole-batch time/cancel allowance. Positive node limits with >1 scenario are Unsupported until consumed-node accounting exists. Zero stops before any solve; one scenario preserves the ordinary backend node-limit contract. No caller model/session is changed. Materializations and results own history.
| ScenarioBatchResult Gecode::Optimize::solve_scenarios | ( | const Model & | , |
| const std::vector< ScenarioDefinition > & | , | ||
| const ScenarioBatchOptions & | = {} ) |
| BackendCapabilities Gecode::Optimize::capabilities | ( | Backend | backend = Backend::Auto | ) |
Query one backend without inspecting a model. Auto reports HiGHS here; solve() separately routes models with active native globals to Native. Other explicit operations have their own capability queries and contracts.
| SolveResult Gecode::Optimize::solve | ( | const ModelSnapshot & | model, |
| const SolveOptions & | options = {} ) |
Solve an owning original-model snapshot. HiGHS is explicitly a numerical backend, not the legacy certified Gecode binary-LP propagation engine. Auto selects Native for models with active native globals, HiGHS otherwise. HiGHS cannot meet Exact/Certified requests. Explicit Native selects the bounded exact-integer Gecode bridge; see native.hpp for its subset and guarantee contract. Returned incumbents pass the independent original-model numerical checker. Time/cancel limits are cooperative; elapsed_seconds includes compilation and checking. A late candidate is excluded unless captured by an internal HiGHS observation callback before the deadline. This does not expose a user callback API.
| SolveResult Gecode::Optimize::solve | ( | const Model & | model, |
| const SolveOptions & | options = {} ) |
| Model Gecode::Optimize::read_model | ( | const std::string & | filename | ) |
Backend-independent, strict numerical LP/free-MPS I/O. Unsupported dialects, quadratic models, and exporting active original indicators/globals are rejected. Writes preserve double values and atomically replace only after a checked semantic round trip. See docs/solver-parity/IO.md for the supported syntax.
| void Gecode::Optimize::write_model | ( | const ModelSnapshot & | model, |
| const std::string & | filename ) |
|
inline |
| void Gecode::Optimize::validate_structure | ( | const ModelSnapshot & | model | ) |
Check a complete original snapshot before a backend or workflow uses it. Throws ModelError for malformed IDs, domains, expressions or references. Expression terms must have ascending unique slot IDs and finite nonzero coefficients, matching the canonical form produced by Model. Semi-variable domains are {0} union [lower, upper], with finite lower > 0. A mathematically infeasible integer interval is not a structural error. Active original indicators require complete lowerings, safe M values, intact generated rows/gates and valid captured-domain dependencies. Typed global payloads and their referenced variable domains are checked too; backend-specific numerical/native admission remains a separate operation.
| ValidationReport Gecode::Optimize::validate | ( | const ModelSnapshot & | model, |
| const std::vector< double > & | slot_values, | ||
| double | feasibility_tolerance = 1e-7, | ||
| double | integrality_tolerance = 1e-6 ) |
Independently evaluate original domains, rows, indicators, globals and cost. Values use original slot indexing: exactly one entry per variable slot; unreferenced deleted slots may contain NaN and are ignored. Tolerances must be finite and nonnegative, in absolute original-model units. Linear arithmetic uses compensated long double accumulation. This is numerical validation, not a proof of optimality or infeasibility. Original indicators are checked after rounding their binary activator; passing their big-M rows alone never establishes logical feasibility. Globals check tolerance-qualified integer values against original payloads. Malformed models, options and assignments return an invalid report rather than throwing ModelError. Allocation failures may still propagate.
| LexicographicResult Gecode::Optimize::solve_lexicographic | ( | const ModelSnapshot & | model, |
| const std::vector< LexicographicObjective > & | objectives, | ||
| const SolveOptions & | options = {} ) |
Optimize ordered linear objectives on private snapshot copies. Degradation after stage i is absolute_degradation + relative_degradation * abs(value_i). Both native MIP gap targets are forced to zero. Completion is numerical and tolerance-qualified, never an exact certificate of lexicographic optimality. All candidates are independently checked against original constraints, accumulated lock rows and original objective retention thresholds.
A shared outer clock/token covers copying, validation and every solve. Time/cancellation remains cooperative; a stage returned after the outer deadline is not promoted. Node-limited multi-stage requests are Unsupported. Terms must use the canonical ascending unique slots of ModelSnapshot.
| LexicographicResult Gecode::Optimize::solve_lexicographic | ( | const Model & | model, |
| const std::vector< LexicographicObjective > & | objectives, | ||
| const SolveOptions & | options = {} ) |