|
Gecode 6.4.0
|
#include < -- improving gecode/implementation/gecode/gecode/optimize/model.hpp>
Public Member Functions | |
| Model () | |
| Model (const Model &)=delete | |
| Model & | operator= (const Model &)=delete |
| Model (Model &&other) noexcept | |
| Model & | operator= (Model &&other) noexcept |
| ModelId | id () const noexcept |
| Revision | revision () const noexcept |
| ModelSnapshot | snapshot () const |
| Variable | add_variable (VariableType type, double lower, double upper, std::string name={}) |
| Variable | add_continuous (double lower=0.0, double upper=std::numeric_limits< double >::infinity(), std::string name={}) |
| Variable | add_integer (double lower=0.0, double upper=std::numeric_limits< double >::infinity(), std::string name={}) |
| Variable | add_binary (std::string name={}) |
| Constraint | add_row (const std::vector< Term > &terms, double lower, double upper, std::string name={}) |
| std::vector< Variable > | add_variables (const std::vector< VariableSpec > &variables) |
| std::vector< Constraint > | add_rows (const std::vector< RowSpec > &rows) |
| std::vector< Constraint > | add_rows_sparse (const SparseRowBatch &rows) |
| void | set_objective (const std::vector< Term > &terms, ObjectiveSense sense, double offset=0.0) |
| void | minimize (const std::vector< Term > &terms, double offset=0.0) |
| void | maximize (const std::vector< Term > &terms, double offset=0.0) |
| void | set_bounds (Variable variable, double lower, double upper) |
| void | set_bounds (Constraint constraint, double lower, double upper) |
| void | set_coefficient (Constraint constraint, Variable variable, double coefficient) |
| void | set_objective_coefficient (Variable variable, double coefficient) |
| void | set_objective_offset (double offset) |
| void | set_name (Variable variable, std::string name) |
| void | set_name (Constraint constraint, std::string name) |
| void | remove (Variable variable) |
| void | remove (Constraint constraint) |
| const VariableData & | variable (Variable variable) const |
| const RowData & | row (Constraint constraint) const |
| GlobalConstraint | add_global (GlobalPayload payload, std::string name={}) |
| const GlobalData & | global (GlobalConstraint constraint) const |
| void | remove (GlobalConstraint constraint) |
| void | set_name (GlobalConstraint constraint, std::string name) |
An owning sparse model with a linear objective and retained logical and global constraints.
Handles identify a model and a never-reused slot. Successful mutations advance the revision, including assignments of unchanged values. Failed mutations leave the model unchanged. Snapshots own their data and remain usable after edits.
Copying is disabled. Moving preserves the identity and all existing handles; a moved-from model can only be destroyed, assigned another model, or queried for its zero id/revision. Mutations and snapshot() reject a moved-from object. Mutation is not thread-safe; independent models can be created concurrently.
| Gecode::Optimize::Model::Model | ( | ) |
|
delete |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
| ModelSnapshot Gecode::Optimize::Model::snapshot | ( | ) | const |
| Variable Gecode::Optimize::Model::add_variable | ( | VariableType | type, |
| double | lower, | ||
| double | upper, | ||
| std::string | name = {} ) |
| Variable Gecode::Optimize::Model::add_continuous | ( | double | lower = 0.0, |
| double | upper = std::numeric_limits< double >::infinity(), | ||
| std::string | name = {} ) |
| Variable Gecode::Optimize::Model::add_integer | ( | double | lower = 0.0, |
| double | upper = std::numeric_limits< double >::infinity(), | ||
| std::string | name = {} ) |
| Variable Gecode::Optimize::Model::add_binary | ( | std::string | name = {} | ) |
| Constraint Gecode::Optimize::Model::add_row | ( | const std::vector< Term > & | terms, |
| double | lower, | ||
| double | upper, | ||
| std::string | name = {} ) |
| std::vector< Variable > Gecode::Optimize::Model::add_variables | ( | const std::vector< VariableSpec > & | variables | ) |
Atomic bulk additions; one revision per nonempty batch, no reused slots. Validation/allocation failure leaves entities, revision and existing views unchanged. Empty valid batches are no-ops. Rows refer to existing variables.
| std::vector< Constraint > Gecode::Optimize::Model::add_rows | ( | const std::vector< RowSpec > & | rows | ) |
| std::vector< Constraint > Gecode::Optimize::Model::add_rows_sparse | ( | const SparseRowBatch & | rows | ) |
| void Gecode::Optimize::Model::set_objective | ( | const std::vector< Term > & | terms, |
| ObjectiveSense | sense, | ||
| double | offset = 0.0 ) |
| void Gecode::Optimize::Model::minimize | ( | const std::vector< Term > & | terms, |
| double | offset = 0.0 ) |
| void Gecode::Optimize::Model::maximize | ( | const std::vector< Term > & | terms, |
| double | offset = 0.0 ) |
| void Gecode::Optimize::Model::set_bounds | ( | Variable | variable, |
| double | lower, | ||
| double | upper ) |
| void Gecode::Optimize::Model::set_bounds | ( | Constraint | constraint, |
| double | lower, | ||
| double | upper ) |
| void Gecode::Optimize::Model::set_coefficient | ( | Constraint | constraint, |
| Variable | variable, | ||
| double | coefficient ) |
| void Gecode::Optimize::Model::set_objective_coefficient | ( | Variable | variable, |
| double | coefficient ) |
| void Gecode::Optimize::Model::set_objective_offset | ( | double | offset | ) |
| void Gecode::Optimize::Model::set_name | ( | Variable | variable, |
| std::string | name ) |
| void Gecode::Optimize::Model::set_name | ( | Constraint | constraint, |
| std::string | name ) |
| void Gecode::Optimize::Model::remove | ( | Variable | variable | ) |
Reject removal while an active row or the objective references variable.
| void Gecode::Optimize::Model::remove | ( | Constraint | constraint | ) |
Remove a row, retaining its slot as a tombstone.
| const VariableData & Gecode::Optimize::Model::variable | ( | Variable | variable | ) | const |
| const RowData & Gecode::Optimize::Model::row | ( | Constraint | constraint | ) | const |
| GlobalConstraint Gecode::Optimize::Model::add_global | ( | GlobalPayload | payload, |
| std::string | name = {} ) |
| const GlobalData & Gecode::Optimize::Model::global | ( | GlobalConstraint | constraint | ) | const |
| void Gecode::Optimize::Model::remove | ( | GlobalConstraint | constraint | ) |
| void Gecode::Optimize::Model::set_name | ( | GlobalConstraint | constraint, |
| std::string | name ) |