+
+-
+
- Main Page +
- Namespaces +
- Classes +
diff --git a/docs/cpp_algorithms/boot.js b/docs/cpp_algorithms/boot.js new file mode 100644 index 0000000000..b503db7894 --- /dev/null +++ b/docs/cpp_algorithms/boot.js @@ -0,0 +1,271 @@ +$( document ).ready(function() { + + $("div.headertitle").addClass("page-header"); + $("div.title").addClass("h1"); + + $('li > a[href="index.html"] > span').before(" "); + $('li > a[href="modules.html"] > span').before(" "); + $('li > a[href="namespaces.html"] > span').before(" "); + $('li > a[href="annotated.html"] > span').before(" "); + $('li > a[href="classes.html"] > span').before(" "); + $('li > a[href="inherits.html"] > span').before(" "); + $('li > a[href="functions.html"] > span').before(" "); + $('li > a[href="functions_func.html"] > span').before(" "); + $('li > a[href="functions_vars.html"] > span').before(" "); + $('li > a[href="functions_enum.html"] > span').before(" "); + $('li > a[href="functions_eval.html"] > span').before(" "); + $('img[src="ftv2ns.png"]').replaceWith('N '); + $('img[src="ftv2cl.png"]').replaceWith('C '); + + $("ul.tablist").addClass("nav nav-pills nav-justified"); + $("ul.tablist").css("margin-top", "0.5em"); + $("ul.tablist").css("margin-bottom", "0.5em"); + $("li.current").addClass("active"); + $("iframe").attr("scrolling", "yes"); + + $("#nav-path > ul").addClass("breadcrumb"); + + $("table.params").addClass("table"); + $("div.ingroups").wrapInner(""); + $("div.levels").css("margin", "0.5em"); + $("div.levels > span").addClass("btn btn-default btn-xs"); + $("div.levels > span").css("margin-right", "0.25em"); + + $("table.directory").addClass("table table-striped"); + $("div.summary > a").addClass("btn btn-default btn-xs"); + $("table.fieldtable").addClass("table"); + $(".fragment").addClass("well"); + $(".memitem").addClass("panel panel-default"); + $(".memproto").addClass("panel-heading"); + $(".memdoc").addClass("panel-body"); + $("span.mlabel").addClass("label label-info"); + + $("table.memberdecls").addClass("table"); + $("[class^=memitem]").addClass("active"); + + $("div.ah").addClass("btn btn-default"); + $("span.mlabels").addClass("pull-right"); + $("table.mlabels").css("width", "100%") + $("td.mlabels-right").addClass("pull-right"); + + $("div.ttc").addClass("panel panel-primary"); + $("div.ttname").addClass("panel-heading"); + $("div.ttname a").css("color", 'white'); + $("div.ttdef,div.ttdoc,div.ttdeci").addClass("panel-body"); + + $('div.fragment.well div.line:first').css('margin-top', '2px'); + $('div.fragment.well div.line:last').css('margin-bottom', '2px'); + + $('table.doxtable').removeClass('doxtable').addClass('table table-striped table-bordered').each(function(){ + $(this).prepend(''); + $(this).find('tbody > tr:first').prependTo($(this).find('thead')); + + $(this).find('td > span.success').parent().addClass('success'); + $(this).find('td > span.warning').parent().addClass('warning'); + $(this).find('td > span.danger').parent().addClass('danger'); + }); + + + + if($('div.fragment.well div.ttc').length > 0) + { + $('div.fragment.well div.line:first').parent().removeClass('fragment well'); + } + + $('table.memberdecls').find('.memItemRight').each(function(){ + $(this).contents().appendTo($(this).siblings('.memItemLeft')); + $(this).siblings('.memItemLeft').attr('align', 'left'); + }); + + $('table.memberdecls').find('.memTemplItemRight').each(function(){ + $(this).contents().appendTo($(this).siblings('.memTemplItemLeft')); + $(this).siblings('.memTemplItemLeft').attr('align', 'left'); + }); + + function getOriginalWidthOfImg(img_element) { + var t = new Image(); + t.src = (img_element.getAttribute ? img_element.getAttribute("src") : false) || img_element.src; + return t.width; + } + + $('div.dyncontent').find('img').each(function(){ + if(getOriginalWidthOfImg($(this)[0]) > $('#content>div.container').width()) + $(this).css('width', '100%'); + }); + + + /* responsive search box */ + $('#MSearchBox').parent().remove(); + + var nav_container = $('
'); + $('#navrow1').parent().prepend(nav_container); + + var left_nav = $(''); + for (i = 0; i < 6; i++) { + var navrow = $('#navrow' + i + ' > ul.tablist').detach(); + left_nav.append(navrow); + $('#navrow' + i).remove(); + } + var right_nav = $('').append('\ +This is the complete list of members for operations_research::MPConstraint, including all inherited members.
+| basis_status() const | operations_research::MPConstraint | |
| BopInterface class | operations_research::MPConstraint | friend |
| CBCInterface class | operations_research::MPConstraint | friend |
| Clear() | operations_research::MPConstraint | |
| CLPInterface class | operations_research::MPConstraint | friend |
| CplexInterface class | operations_research::MPConstraint | friend |
| dual_value() const | operations_research::MPConstraint | |
| GetCoefficient(const MPVariable *const var) const | operations_research::MPConstraint | |
| GLOPInterface class | operations_research::MPConstraint | friend |
| GLPKInterface class | operations_research::MPConstraint | friend |
| GurobiInterface class | operations_research::MPConstraint | friend |
| index() const | operations_research::MPConstraint | inline |
| indicator_value() const | operations_research::MPConstraint | inline |
| indicator_variable() const | operations_research::MPConstraint | inline |
| is_lazy() const | operations_research::MPConstraint | inline |
| KnapsackInterface class | operations_research::MPConstraint | friend |
| lb() const | operations_research::MPConstraint | inline |
| MPConstraint(int index, double lb, double ub, const std::string &name, MPSolverInterface *const interface_in) | operations_research::MPConstraint | inlineprotected |
| MPSolver class | operations_research::MPConstraint | friend |
| MPSolverInterface class | operations_research::MPConstraint | friend |
| name() const | operations_research::MPConstraint | inline |
| SatInterface class | operations_research::MPConstraint | friend |
| SCIPInterface class | operations_research::MPConstraint | friend |
| set_dual_value(double dual_value) | operations_research::MPConstraint | inlineprotected |
| set_is_lazy(bool laziness) | operations_research::MPConstraint | inline |
| SetBounds(double lb, double ub) | operations_research::MPConstraint | |
| SetCoefficient(const MPVariable *const var, double coeff) | operations_research::MPConstraint | |
| SetLB(double lb) | operations_research::MPConstraint | inline |
| SetUB(double ub) | operations_research::MPConstraint | inline |
| SLMInterface class | operations_research::MPConstraint | friend |
| terms() const | operations_research::MPConstraint | inline |
| ub() const | operations_research::MPConstraint | inline |
The class for constraints of a Mathematical Programming (MP) model.
+A constraint is represented as a linear equation or inequality.
+ +Definition at line 1206 of file linear_solver.h.
++Public Member Functions | |
| const std::string & | name () const |
| Returns the name of the constraint. More... | |
| void | Clear () |
| Clears all variables and coefficients. More... | |
| void | SetCoefficient (const MPVariable *const var, double coeff) |
| Sets the coefficient of the variable on the constraint. More... | |
| double | GetCoefficient (const MPVariable *const var) const |
| Gets the coefficient of a given variable on the constraint (which is 0 if the variable does not appear in the constraint). More... | |
| const absl::flat_hash_map< const MPVariable *, double > & | terms () const |
| Returns a map from variables to their coefficients in the constraint. More... | |
| double | lb () const |
| Returns the lower bound. More... | |
| double | ub () const |
| Returns the upper bound. More... | |
| void | SetLB (double lb) |
| Sets the lower bound. More... | |
| void | SetUB (double ub) |
| Sets the upper bound. More... | |
| void | SetBounds (double lb, double ub) |
| Sets both the lower and upper bounds. More... | |
| bool | is_lazy () const |
| Advanced usage: returns true if the constraint is "lazy" (see below). More... | |
| void | set_is_lazy (bool laziness) |
| Advanced usage: sets the constraint "laziness". More... | |
| const MPVariable * | indicator_variable () const |
| bool | indicator_value () const |
| int | index () const |
| Returns the index of the constraint in the MPSolver::constraints_. More... | |
| double | dual_value () const |
| Advanced usage: returns the dual value of the constraint in the current solution (only available for continuous problems). More... | |
| MPSolver::BasisStatus | basis_status () const |
| Advanced usage: returns the basis status of the constraint. More... | |
+Protected Member Functions | |
| MPConstraint (int index, double lb, double ub, const std::string &name, MPSolverInterface *const interface_in) | |
| void | set_dual_value (double dual_value) |
+Friends | |
| class | MPSolver |
| class | MPSolverInterface |
| class | CBCInterface |
| class | CLPInterface |
| class | GLPKInterface |
| class | SCIPInterface |
| class | SLMInterface |
| class | GurobiInterface |
| class | CplexInterface |
| class | GLOPInterface |
| class | BopInterface |
| class | SatInterface |
| class | KnapsackInterface |
+
|
+ +inlineprotected | +
Definition at line 1331 of file linear_solver.h.
+ +| MPSolver::BasisStatus operations_research::MPConstraint::basis_status | +( | +) | +const | +
Advanced usage: returns the basis status of the constraint.
+It is only available for continuous problems).
+Note that if a constraint "linear_expression in [lb, ub]" is transformed into "linear_expression + slack = 0" with slack in [-ub, -lb], then this status is the same as the status of the slack variable with AT_UPPER_BOUND and AT_LOWER_BOUND swapped.
+| void operations_research::MPConstraint::Clear | +( | +) | ++ |
Clears all variables and coefficients.
+Does not clear the bounds.
+ +| double operations_research::MPConstraint::dual_value | +( | +) | +const | +
Advanced usage: returns the dual value of the constraint in the current solution (only available for continuous problems).
+ +| double operations_research::MPConstraint::GetCoefficient | +( | +const MPVariable *const | +var | ) | +const | +
Gets the coefficient of a given variable on the constraint (which is 0 if the variable does not appear in the constraint).
+ +
+
|
+ +inline | +
Returns the index of the constraint in the MPSolver::constraints_.
+ +Definition at line 1291 of file linear_solver.h.
+ +
+
|
+ +inline | +
Definition at line 1286 of file linear_solver.h.
+ +
+
|
+ +inline | +
Definition at line 1285 of file linear_solver.h.
+ +
+
|
+ +inline | +
Advanced usage: returns true if the constraint is "lazy" (see below).
+ +Definition at line 1269 of file linear_solver.h.
+ +
+
|
+ +inline | +
Returns the lower bound.
+ +Definition at line 1244 of file linear_solver.h.
+ +
+
|
+ +inline | +
Returns the name of the constraint.
+ +Definition at line 1211 of file linear_solver.h.
+ +
+
|
+ +inlineprotected | +
Definition at line 1343 of file linear_solver.h.
+ +
+
|
+ +inline | +
Advanced usage: sets the constraint "laziness".
+This is only supported for SCIP and has no effect on other solvers.
+When laziness is true, the constraint is only considered by the Linear Programming solver if its current solution violates the constraint. In this case, the constraint is definitively added to the problem. This may be useful in some MIP problems, and may have a dramatic impact on performance.
+For more info see: http://tinyurl.com/lazy-constraints.
+ +Definition at line 1283 of file linear_solver.h.
+ +| void operations_research::MPConstraint::SetBounds | +( | +double | +lb, | +
| + | + | double | +ub | +
| + | ) | ++ |
Sets both the lower and upper bounds.
+ +| void operations_research::MPConstraint::SetCoefficient | +( | +const MPVariable *const | +var, | +
| + | + | double | +coeff | +
| + | ) | ++ |
Sets the coefficient of the variable on the constraint.
+If the variable does not belong to the solver, the function just returns, or crashes in non-opt mode.
+ +
+
|
+ +inline | +
Sets the lower bound.
+ +Definition at line 1254 of file linear_solver.h.
+ +
+
|
+ +inline | +
Sets the upper bound.
+ +Definition at line 1259 of file linear_solver.h.
+ +
+
|
+ +inline | +
Returns a map from variables to their coefficients in the constraint.
+If a variable is not present in the map, then its coefficient is zero.
+ +Definition at line 1237 of file linear_solver.h.
+ +
+
|
+ +inline | +
Returns the upper bound.
+ +Definition at line 1249 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1324 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1316 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1317 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1322 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1323 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1318 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1321 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1326 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1314 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1315 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1325 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1319 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1320 of file linear_solver.h.
+ +Definition at line 409 of file linear_solver.pb.h.
+Definition at line 407 of file linear_solver.pb.h.
Public Member Functions | |
| void | Swap (MPConstraintProto *other) |
| MPConstraintProto * | New () const final |
| implements Message -------------------------------------------— More... | |
| MPConstraintProto * | New (::PROTOBUF_NAMESPACE_ID::Arena *arena) const final |
| ::PROTOBUF_NAMESPACE_ID::Metadata | GetMetadata () const final |
| int | var_index_size () const |
| nested types -------------------------------------------------— More... | |
| void | clear_var_index () |
| ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int32 > * | mutable_var_index () |
| int | coefficient_size () const |
| repeated double coefficient = 7 [packed = true]; More... | |
| void | clear_coefficient () |
| ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > * | mutable_coefficient () |
| bool | has_name () const |
| optional string name = 4 [default = ""]; More... | |
| void | clear_name () |
| void | set_allocated_name (std::string *name) |
| bool | has_is_lazy () const |
| optional bool is_lazy = 5 [default = false]; More... | |
| void | clear_is_lazy () |
| void | set_is_lazy (bool value) |
| bool | has_lower_bound () const |
| optional double lower_bound = 2 [default = -inf]; More... | |
| void | clear_lower_bound () |
| void | set_lower_bound (double value) |
| bool | has_upper_bound () const |
| optional double upper_bound = 3 [default = inf]; More... | |
| void | clear_upper_bound () |
Definition at line 416 of file linear_solver.pb.h.
+Definition at line 414 of file linear_solver.pb.h.
@protoc_insertion_point(field_add:operations_research.MPConstraintProto.coefficient)
-Definition at line 2474 of file linear_solver.pb.h.
+Definition at line 2460 of file linear_solver.pb.h.
@protoc_insertion_point(field_add:operations_research.MPConstraintProto.var_index)
-Definition at line 2444 of file linear_solver.pb.h.
+Definition at line 2430 of file linear_solver.pb.h.
Definition at line 2463 of file linear_solver.pb.h.
+Definition at line 2449 of file linear_solver.pb.h.
Definition at line 2587 of file linear_solver.pb.h.
+Definition at line 2573 of file linear_solver.pb.h.
Definition at line 2493 of file linear_solver.pb.h.
+Definition at line 2479 of file linear_solver.pb.h.
Definition at line 2529 of file linear_solver.pb.h.
+Definition at line 2515 of file linear_solver.pb.h.
Definition at line 2511 of file linear_solver.pb.h.
+Definition at line 2497 of file linear_solver.pb.h.
Definition at line 2433 of file linear_solver.pb.h.
+Definition at line 2419 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPConstraintProto.coefficient)
-Definition at line 2466 of file linear_solver.pb.h.
+Definition at line 2452 of file linear_solver.pb.h.
@protoc_insertion_point(field_list:operations_research.MPConstraintProto.coefficient)
-Definition at line 2479 of file linear_solver.pb.h.
+Definition at line 2465 of file linear_solver.pb.h.
repeated double coefficient = 7 [packed = true];
- -Definition at line 2460 of file linear_solver.pb.h.
+Definition at line 2446 of file linear_solver.pb.h.
Definition at line 441 of file linear_solver.pb.h.
+Definition at line 439 of file linear_solver.pb.h.
Definition at line 492 of file linear_solver.pb.h.
+Definition at line 490 of file linear_solver.pb.h.
Definition at line 444 of file linear_solver.pb.h.
+Definition at line 442 of file linear_solver.pb.h.
Definition at line 447 of file linear_solver.pb.h.
+Definition at line 445 of file linear_solver.pb.h.
optional bool is_lazy = 5 [default = false];
- -Definition at line 2584 of file linear_solver.pb.h.
+Definition at line 2570 of file linear_solver.pb.h.
optional double lower_bound = 2 [default = -inf];
- -Definition at line 2490 of file linear_solver.pb.h.
+Definition at line 2476 of file linear_solver.pb.h.
optional string name = 4 [default = ""];
- -Definition at line 2526 of file linear_solver.pb.h.
+Definition at line 2512 of file linear_solver.pb.h.
optional double upper_bound = 3 [default = inf];
- -Definition at line 2508 of file linear_solver.pb.h.
+Definition at line 2494 of file linear_solver.pb.h.
Definition at line 453 of file linear_solver.pb.h.
+Definition at line 451 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPConstraintProto.is_lazy)
-Definition at line 2591 of file linear_solver.pb.h.
+Definition at line 2577 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPConstraintProto.lower_bound)
-Definition at line 2497 of file linear_solver.pb.h.
+Definition at line 2483 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable_list:operations_research.MPConstraintProto.coefficient)
-Definition at line 2484 of file linear_solver.pb.h.
+Definition at line 2470 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPConstraintProto.name)
-Definition at line 2560 of file linear_solver.pb.h.
+Definition at line 2546 of file linear_solver.pb.h.
Definition at line 437 of file linear_solver.pb.h.
+Definition at line 435 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable_list:operations_research.MPConstraintProto.var_index)
-Definition at line 2454 of file linear_solver.pb.h.
+Definition at line 2440 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPConstraintProto.name)
-Definition at line 2533 of file linear_solver.pb.h.
+Definition at line 2519 of file linear_solver.pb.h.
implements Message -------------------------------------------—
- -Definition at line 467 of file linear_solver.pb.h.
+Definition at line 465 of file linear_solver.pb.h.
Definition at line 471 of file linear_solver.pb.h.
+Definition at line 469 of file linear_solver.pb.h.
Definition at line 421 of file linear_solver.pb.h.
+Definition at line 419 of file linear_solver.pb.h.
Definition at line 425 of file linear_solver.pb.h.
+Definition at line 423 of file linear_solver.pb.h.
@protoc_insertion_point(field_release:operations_research.MPConstraintProto.name)
-Definition at line 2565 of file linear_solver.pb.h.
+Definition at line 2551 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_allocated:operations_research.MPConstraintProto.name)
-Definition at line 2573 of file linear_solver.pb.h.
+Definition at line 2559 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPConstraintProto.coefficient)
-Definition at line 2470 of file linear_solver.pb.h.
+Definition at line 2456 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPConstraintProto.is_lazy)
-Definition at line 2595 of file linear_solver.pb.h.
+Definition at line 2581 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPConstraintProto.lower_bound)
-Definition at line 2501 of file linear_solver.pb.h.
+Definition at line 2487 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPConstraintProto.name)
-Definition at line 2537 of file linear_solver.pb.h.
+Definition at line 2523 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_rvalue:operations_research.MPConstraintProto.name)
-Definition at line 2542 of file linear_solver.pb.h.
+Definition at line 2528 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_char:operations_research.MPConstraintProto.name)
-Definition at line 2548 of file linear_solver.pb.h.
+Definition at line 2534 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_pointer:operations_research.MPConstraintProto.name)
-Definition at line 2554 of file linear_solver.pb.h.
+Definition at line 2540 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPConstraintProto.upper_bound)
-Definition at line 2519 of file linear_solver.pb.h.
+Definition at line 2505 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPConstraintProto.var_index)
-Definition at line 2440 of file linear_solver.pb.h.
+Definition at line 2426 of file linear_solver.pb.h.
Definition at line 434 of file linear_solver.pb.h.
+Definition at line 432 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPConstraintProto.upper_bound)
-Definition at line 2515 of file linear_solver.pb.h.
+Definition at line 2501 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPConstraintProto.var_index)
-Definition at line 2436 of file linear_solver.pb.h.
+Definition at line 2422 of file linear_solver.pb.h.
@protoc_insertion_point(field_list:operations_research.MPConstraintProto.var_index)
-Definition at line 2449 of file linear_solver.pb.h.
+Definition at line 2435 of file linear_solver.pb.h.
nested types -------------------------------------------------—
- -accessors ----------------------------------------------------— repeated int32 var_index = 6 [packed = true];
-repeated int32 var_index = 6 [packed = true];
- -Definition at line 2430 of file linear_solver.pb.h.
+Definition at line 2416 of file linear_solver.pb.h.
Definition at line 499 of file linear_solver.pb.h.
+Definition at line 497 of file linear_solver.pb.h.
Definition at line 598 of file linear_solver.pb.h.
+Definition at line 596 of file linear_solver.pb.h.
Definition at line 461 of file linear_solver.pb.h.
+Definition at line 459 of file linear_solver.pb.h.
Definition at line 540 of file linear_solver.pb.h.
+Definition at line 538 of file linear_solver.pb.h.
Definition at line 457 of file linear_solver.pb.h.
+Definition at line 455 of file linear_solver.pb.h.
Definition at line 565 of file linear_solver.pb.h.
+Definition at line 563 of file linear_solver.pb.h.
Definition at line 572 of file linear_solver.pb.h.
+Definition at line 570 of file linear_solver.pb.h.
Definition at line 552 of file linear_solver.pb.h.
+Definition at line 550 of file linear_solver.pb.h.
Definition at line 579 of file linear_solver.pb.h.
+Definition at line 577 of file linear_solver.pb.h.
Definition at line 528 of file linear_solver.pb.h.
+Definition at line 526 of file linear_solver.pb.h.
Definition at line 603 of file linear_solver.pb.h.
+Definition at line 600 of file linear_solver.pb.h.
Public Types | |
| void | Swap (MPGeneralConstraintProto *other) |
| MPGeneralConstraintProto * | New () const final |
| implements Message -------------------------------------------— More... | |
| MPGeneralConstraintProto * | New (::PROTOBUF_NAMESPACE_ID::Arena *arena) const final |
| ::PROTOBUF_NAMESPACE_ID::Metadata | GetMetadata () const final |
| bool | has_name () const |
| nested types -------------------------------------------------— More... | |
| void | clear_name () |
| void | set_allocated_name (std::string *name) |
| bool | has_indicator_constraint () const |
| optional .operations_research.MPIndicatorConstraint indicator_constraint = 2; More... | |
| void | clear_indicator_constraint () |
| void | set_allocated_indicator_constraint (::operations_research::MPIndicatorConstraint *indicator_constraint) |
| bool | has_sos_constraint () const |
| optional .operations_research.MPSosConstraint sos_constraint = 3; More... | |
| void | clear_sos_constraint () |
| GENERAL_CONSTRAINT_NOT_SET | |
Definition at line 646 of file linear_solver.pb.h.
+Definition at line 643 of file linear_solver.pb.h.
Definition at line 610 of file linear_solver.pb.h.
+Definition at line 607 of file linear_solver.pb.h.
Definition at line 2671 of file linear_solver.pb.h.
+Definition at line 2656 of file linear_solver.pb.h.
Definition at line 2610 of file linear_solver.pb.h.
+Definition at line 2595 of file linear_solver.pb.h.
Definition at line 2712 of file linear_solver.pb.h.
+Definition at line 2697 of file linear_solver.pb.h.
Definition at line 635 of file linear_solver.pb.h.
+Definition at line 632 of file linear_solver.pb.h.
Definition at line 2752 of file linear_solver.pb.h.
+Definition at line 2737 of file linear_solver.pb.h.
Definition at line 692 of file linear_solver.pb.h.
+Definition at line 689 of file linear_solver.pb.h.
Definition at line 638 of file linear_solver.pb.h.
+Definition at line 635 of file linear_solver.pb.h.
Definition at line 641 of file linear_solver.pb.h.
+Definition at line 638 of file linear_solver.pb.h.
optional .operations_research.MPIndicatorConstraint indicator_constraint = 2;
- -Definition at line 2665 of file linear_solver.pb.h.
+Definition at line 2650 of file linear_solver.pb.h.
nested types -------------------------------------------------—
- -accessors ----------------------------------------------------— optional string name = 1 [default = ""];
-optional string name = 1 [default = ""];
- -Definition at line 2607 of file linear_solver.pb.h.
+Definition at line 2592 of file linear_solver.pb.h.
optional .operations_research.MPSosConstraint sos_constraint = 3;
- -Definition at line 2706 of file linear_solver.pb.h.
+Definition at line 2691 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPGeneralConstraintProto.indicator_constraint)
-Definition at line 2688 of file linear_solver.pb.h.
+Definition at line 2673 of file linear_solver.pb.h.
Definition at line 653 of file linear_solver.pb.h.
+Definition at line 650 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPGeneralConstraintProto.indicator_constraint)
-Definition at line 2694 of file linear_solver.pb.h.
+Definition at line 2679 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPGeneralConstraintProto.name)
-Definition at line 2641 of file linear_solver.pb.h.
+Definition at line 2626 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPGeneralConstraintProto.sos_constraint)
-Definition at line 2735 of file linear_solver.pb.h.
+Definition at line 2720 of file linear_solver.pb.h.
Definition at line 631 of file linear_solver.pb.h.
+Definition at line 628 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPGeneralConstraintProto.name)
-Definition at line 2614 of file linear_solver.pb.h.
+Definition at line 2599 of file linear_solver.pb.h.
implements Message -------------------------------------------—
- -Definition at line 667 of file linear_solver.pb.h.
+Definition at line 664 of file linear_solver.pb.h.
Definition at line 671 of file linear_solver.pb.h.
+Definition at line 668 of file linear_solver.pb.h.
Definition at line 615 of file linear_solver.pb.h.
+Definition at line 612 of file linear_solver.pb.h.
Definition at line 619 of file linear_solver.pb.h.
+Definition at line 616 of file linear_solver.pb.h.
@protoc_insertion_point(field_release:operations_research.MPGeneralConstraintProto.indicator_constraint)
-Definition at line 2677 of file linear_solver.pb.h.
+Definition at line 2662 of file linear_solver.pb.h.
@protoc_insertion_point(field_release:operations_research.MPGeneralConstraintProto.name)
-Definition at line 2646 of file linear_solver.pb.h.
+Definition at line 2631 of file linear_solver.pb.h.
@protoc_insertion_point(field_release:operations_research.MPGeneralConstraintProto.sos_constraint)
-Definition at line 2718 of file linear_solver.pb.h.
+Definition at line 2703 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_allocated:operations_research.MPGeneralConstraintProto.name)
-Definition at line 2654 of file linear_solver.pb.h.
+Definition at line 2639 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPGeneralConstraintProto.name)
-Definition at line 2618 of file linear_solver.pb.h.
+Definition at line 2603 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_rvalue:operations_research.MPGeneralConstraintProto.name)
-Definition at line 2623 of file linear_solver.pb.h.
+Definition at line 2608 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_char:operations_research.MPGeneralConstraintProto.name)
-Definition at line 2629 of file linear_solver.pb.h.
+Definition at line 2614 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_pointer:operations_research.MPGeneralConstraintProto.name)
-Definition at line 2635 of file linear_solver.pb.h.
+Definition at line 2620 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPGeneralConstraintProto.sos_constraint)
-Definition at line 2729 of file linear_solver.pb.h.
+Definition at line 2714 of file linear_solver.pb.h.
Definition at line 628 of file linear_solver.pb.h.
+Definition at line 625 of file linear_solver.pb.h.
Definition at line 699 of file linear_solver.pb.h.
+Definition at line 696 of file linear_solver.pb.h.
Definition at line 778 of file linear_solver.pb.h.
+Definition at line 775 of file linear_solver.pb.h.
Definition at line 661 of file linear_solver.pb.h.
+Definition at line 658 of file linear_solver.pb.h.
Definition at line 657 of file linear_solver.pb.h.
+Definition at line 654 of file linear_solver.pb.h.
Definition at line 741 of file linear_solver.pb.h.
+Definition at line 738 of file linear_solver.pb.h.
Definition at line 728 of file linear_solver.pb.h.
+Definition at line 725 of file linear_solver.pb.h.
Definition at line 750 of file linear_solver.pb.h.
+Definition at line 747 of file linear_solver.pb.h.
Definition at line 783 of file linear_solver.pb.h.
+Definition at line 779 of file linear_solver.pb.h.
Public Member Functions | |
| void | Swap (MPIndicatorConstraint *other) |
| MPIndicatorConstraint * | New () const final |
| implements Message -------------------------------------------— More... | |
| MPIndicatorConstraint * | New (::PROTOBUF_NAMESPACE_ID::Arena *arena) const final |
| ::PROTOBUF_NAMESPACE_ID::Metadata | GetMetadata () const final |
| bool | has_constraint () const |
| nested types -------------------------------------------------— More... | |
| void | clear_constraint () |
| void | set_allocated_constraint (::operations_research::MPConstraintProto *constraint) |
| bool | has_var_index () const |
| optional int32 var_index = 1; More... | |
| void | clear_var_index () |
| void | set_var_index (::PROTOBUF_NAMESPACE_ID::int32 value) |
| bool | has_var_value () const |
| optional int32 var_value = 2; More... | |
| void | clear_var_value () |
Definition at line 790 of file linear_solver.pb.h.
+Definition at line 786 of file linear_solver.pb.h.
Definition at line 2800 of file linear_solver.pb.h.
+Definition at line 2784 of file linear_solver.pb.h.
Definition at line 2764 of file linear_solver.pb.h.
+Definition at line 2748 of file linear_solver.pb.h.
Definition at line 2782 of file linear_solver.pb.h.
+Definition at line 2766 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPIndicatorConstraint.constraint)
-Definition at line 2804 of file linear_solver.pb.h.
+Definition at line 2788 of file linear_solver.pb.h.
Definition at line 815 of file linear_solver.pb.h.
+Definition at line 811 of file linear_solver.pb.h.
Definition at line 866 of file linear_solver.pb.h.
+Definition at line 862 of file linear_solver.pb.h.
Definition at line 818 of file linear_solver.pb.h.
+Definition at line 814 of file linear_solver.pb.h.
Definition at line 821 of file linear_solver.pb.h.
+Definition at line 817 of file linear_solver.pb.h.
nested types -------------------------------------------------—
-optional .operations_research.MPConstraintProto constraint = 3;
-accessors ----------------------------------------------------— optional .operations_research.MPConstraintProto constraint = 3;
- -Definition at line 2797 of file linear_solver.pb.h.
+Definition at line 2781 of file linear_solver.pb.h.
optional int32 var_index = 1;
- -optional int32 var_index = 1;
- -Definition at line 2761 of file linear_solver.pb.h.
+Definition at line 2745 of file linear_solver.pb.h.
optional int32 var_value = 2;
- -Definition at line 2779 of file linear_solver.pb.h.
+Definition at line 2763 of file linear_solver.pb.h.
Definition at line 827 of file linear_solver.pb.h.
+Definition at line 823 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPIndicatorConstraint.constraint)
-Definition at line 2817 of file linear_solver.pb.h.
+Definition at line 2801 of file linear_solver.pb.h.
Definition at line 811 of file linear_solver.pb.h.
+Definition at line 807 of file linear_solver.pb.h.
implements Message -------------------------------------------—
- -Definition at line 841 of file linear_solver.pb.h.
+Definition at line 837 of file linear_solver.pb.h.
Definition at line 845 of file linear_solver.pb.h.
+Definition at line 841 of file linear_solver.pb.h.
Definition at line 795 of file linear_solver.pb.h.
+Definition at line 791 of file linear_solver.pb.h.
Definition at line 799 of file linear_solver.pb.h.
+Definition at line 795 of file linear_solver.pb.h.
@protoc_insertion_point(field_release:operations_research.MPIndicatorConstraint.constraint)
-Definition at line 2810 of file linear_solver.pb.h.
+Definition at line 2794 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_allocated:operations_research.MPIndicatorConstraint.constraint)
-Definition at line 2826 of file linear_solver.pb.h.
+Definition at line 2810 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPIndicatorConstraint.var_index)
-Definition at line 2772 of file linear_solver.pb.h.
+Definition at line 2756 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPIndicatorConstraint.var_value)
-Definition at line 2790 of file linear_solver.pb.h.
+Definition at line 2774 of file linear_solver.pb.h.
Definition at line 808 of file linear_solver.pb.h.
+Definition at line 804 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPIndicatorConstraint.var_index)
-Definition at line 2768 of file linear_solver.pb.h.
+Definition at line 2752 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPIndicatorConstraint.var_value)
-Definition at line 2786 of file linear_solver.pb.h.
+Definition at line 2770 of file linear_solver.pb.h.
Definition at line 873 of file linear_solver.pb.h.
+Definition at line 869 of file linear_solver.pb.h.
Definition at line 932 of file linear_solver.pb.h.
+Definition at line 928 of file linear_solver.pb.h.
Definition at line 835 of file linear_solver.pb.h.
+Definition at line 831 of file linear_solver.pb.h.
Definition at line 902 of file linear_solver.pb.h.
+Definition at line 898 of file linear_solver.pb.h.
Definition at line 831 of file linear_solver.pb.h.
+Definition at line 827 of file linear_solver.pb.h.
Definition at line 911 of file linear_solver.pb.h.
+Definition at line 907 of file linear_solver.pb.h.
Definition at line 918 of file linear_solver.pb.h.
+Definition at line 914 of file linear_solver.pb.h.
Definition at line 1285 of file linear_solver.pb.h.
+Definition at line 1278 of file linear_solver.pb.h.
Public Member Functions | |
| void | Swap (MPModelProto *other) |
| MPModelProto * | New () const final |
| implements Message -------------------------------------------— More... | |
| MPModelProto * | New (::PROTOBUF_NAMESPACE_ID::Arena *arena) const final |
| ::PROTOBUF_NAMESPACE_ID::Metadata | GetMetadata () const final |
| int | variable_size () const |
| nested types -------------------------------------------------— More... | |
| void | clear_variable () |
| const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::operations_research::MPVariableProto > & | variable () const |
| int | constraint_size () const |
| repeated .operations_research.MPConstraintProto constraint = 4; More... | |
| void | clear_constraint () |
| const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::operations_research::MPConstraintProto > & | constraint () const |
| int | general_constraint_size () const |
| repeated .operations_research.MPGeneralConstraintProto general_constraint = 7; More... | |
| void | clear_general_constraint () |
| const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::operations_research::MPGeneralConstraintProto > & | general_constraint () const |
| bool | has_name () const |
| optional string name = 5 [default = ""]; More... | |
| void | clear_name () |
| void | set_allocated_name (std::string *name) |
| bool | has_solution_hint () const |
| optional .operations_research.PartialVariableAssignment solution_hint = 6; More... | |
| void | clear_solution_hint () |
| void | set_allocated_solution_hint (::operations_research::PartialVariableAssignment *solution_hint) |
| bool | has_objective_offset () const |
| optional double objective_offset = 2 [default = 0]; More... | |
| void | clear_objective_offset () |
| void | set_objective_offset (double value) |
| bool | has_maximize () const |
| optional bool maximize = 1 [default = false]; More... | |
| void | clear_maximize () |
Definition at line 1292 of file linear_solver.pb.h.
+Definition at line 1285 of file linear_solver.pb.h.
@protoc_insertion_point(field_add:operations_research.MPModelProto.constraint)
-Definition at line 3085 of file linear_solver.pb.h.
+Definition at line 3066 of file linear_solver.pb.h.
@protoc_insertion_point(field_add:operations_research.MPModelProto.general_constraint)
-Definition at line 3115 of file linear_solver.pb.h.
+Definition at line 3096 of file linear_solver.pb.h.
@protoc_insertion_point(field_add:operations_research.MPModelProto.variable)
-Definition at line 3055 of file linear_solver.pb.h.
+Definition at line 3036 of file linear_solver.pb.h.
Definition at line 3069 of file linear_solver.pb.h.
+Definition at line 3050 of file linear_solver.pb.h.
Definition at line 3099 of file linear_solver.pb.h.
+Definition at line 3080 of file linear_solver.pb.h.
Definition at line 3003 of file linear_solver.pb.h.
+Definition at line 2984 of file linear_solver.pb.h.
Definition at line 3129 of file linear_solver.pb.h.
+Definition at line 3110 of file linear_solver.pb.h.
Definition at line 3021 of file linear_solver.pb.h.
+Definition at line 3002 of file linear_solver.pb.h.
Definition at line 3187 of file linear_solver.pb.h.
+Definition at line 3168 of file linear_solver.pb.h.
Definition at line 3039 of file linear_solver.pb.h.
+Definition at line 3020 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPModelProto.constraint)
-Definition at line 3081 of file linear_solver.pb.h.
+Definition at line 3062 of file linear_solver.pb.h.
@protoc_insertion_point(field_list:operations_research.MPModelProto.constraint)
-Definition at line 3090 of file linear_solver.pb.h.
+Definition at line 3071 of file linear_solver.pb.h.
repeated .operations_research.MPConstraintProto constraint = 4;
- -Definition at line 3066 of file linear_solver.pb.h.
+Definition at line 3047 of file linear_solver.pb.h.
Definition at line 1317 of file linear_solver.pb.h.
+Definition at line 1310 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPModelProto.general_constraint)
-Definition at line 3111 of file linear_solver.pb.h.
+Definition at line 3092 of file linear_solver.pb.h.
@protoc_insertion_point(field_list:operations_research.MPModelProto.general_constraint)
-Definition at line 3120 of file linear_solver.pb.h.
+Definition at line 3101 of file linear_solver.pb.h.
repeated .operations_research.MPGeneralConstraintProto general_constraint = 7;
- -Definition at line 3096 of file linear_solver.pb.h.
+Definition at line 3077 of file linear_solver.pb.h.
Definition at line 1368 of file linear_solver.pb.h.
+Definition at line 1361 of file linear_solver.pb.h.
Definition at line 1320 of file linear_solver.pb.h.
+Definition at line 1313 of file linear_solver.pb.h.
Definition at line 1323 of file linear_solver.pb.h.
+Definition at line 1316 of file linear_solver.pb.h.
optional bool maximize = 1 [default = false];
- -optional bool maximize = 1 [default = false];
- -Definition at line 3000 of file linear_solver.pb.h.
+Definition at line 2981 of file linear_solver.pb.h.
optional string name = 5 [default = ""];
- -Definition at line 3126 of file linear_solver.pb.h.
+Definition at line 3107 of file linear_solver.pb.h.
optional double objective_offset = 2 [default = 0];
- -Definition at line 3018 of file linear_solver.pb.h.
+Definition at line 2999 of file linear_solver.pb.h.
optional .operations_research.PartialVariableAssignment solution_hint = 6;
- -Definition at line 3184 of file linear_solver.pb.h.
+Definition at line 3165 of file linear_solver.pb.h.
Definition at line 1329 of file linear_solver.pb.h.
+Definition at line 1322 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPModelProto.maximize)
-Definition at line 3007 of file linear_solver.pb.h.
+Definition at line 2988 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPModelProto.constraint)
-Definition at line 3072 of file linear_solver.pb.h.
+Definition at line 3053 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable_list:operations_research.MPModelProto.constraint)
-Definition at line 3077 of file linear_solver.pb.h.
+Definition at line 3058 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPModelProto.general_constraint)
-Definition at line 3102 of file linear_solver.pb.h.
+Definition at line 3083 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable_list:operations_research.MPModelProto.general_constraint)
-Definition at line 3107 of file linear_solver.pb.h.
+Definition at line 3088 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPModelProto.name)
-Definition at line 3160 of file linear_solver.pb.h.
+Definition at line 3141 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPModelProto.solution_hint)
-Definition at line 3204 of file linear_solver.pb.h.
+Definition at line 3185 of file linear_solver.pb.h.
Definition at line 1313 of file linear_solver.pb.h.
+Definition at line 1306 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPModelProto.variable)
-Definition at line 3042 of file linear_solver.pb.h.
+Definition at line 3023 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable_list:operations_research.MPModelProto.variable)
-Definition at line 3047 of file linear_solver.pb.h.
+Definition at line 3028 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPModelProto.name)
-Definition at line 3133 of file linear_solver.pb.h.
+Definition at line 3114 of file linear_solver.pb.h.
implements Message -------------------------------------------—
- -Definition at line 1343 of file linear_solver.pb.h.
+Definition at line 1336 of file linear_solver.pb.h.
Definition at line 1347 of file linear_solver.pb.h.
+Definition at line 1340 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPModelProto.objective_offset)
-Definition at line 3025 of file linear_solver.pb.h.
+Definition at line 3006 of file linear_solver.pb.h.
Definition at line 1297 of file linear_solver.pb.h.
+Definition at line 1290 of file linear_solver.pb.h.
Definition at line 1301 of file linear_solver.pb.h.
+Definition at line 1294 of file linear_solver.pb.h.
@protoc_insertion_point(field_release:operations_research.MPModelProto.name)
-Definition at line 3165 of file linear_solver.pb.h.
+Definition at line 3146 of file linear_solver.pb.h.
@protoc_insertion_point(field_release:operations_research.MPModelProto.solution_hint)
-Definition at line 3197 of file linear_solver.pb.h.
+Definition at line 3178 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_allocated:operations_research.MPModelProto.name)
-Definition at line 3173 of file linear_solver.pb.h.
+Definition at line 3154 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_allocated:operations_research.MPModelProto.solution_hint)
-Definition at line 3213 of file linear_solver.pb.h.
+Definition at line 3194 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPModelProto.maximize)
-Definition at line 3011 of file linear_solver.pb.h.
+Definition at line 2992 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPModelProto.name)
-Definition at line 3137 of file linear_solver.pb.h.
+Definition at line 3118 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_rvalue:operations_research.MPModelProto.name)
-Definition at line 3142 of file linear_solver.pb.h.
+Definition at line 3123 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_char:operations_research.MPModelProto.name)
-Definition at line 3148 of file linear_solver.pb.h.
+Definition at line 3129 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_pointer:operations_research.MPModelProto.name)
-Definition at line 3154 of file linear_solver.pb.h.
+Definition at line 3135 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPModelProto.objective_offset)
-Definition at line 3029 of file linear_solver.pb.h.
+Definition at line 3010 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPModelProto.solution_hint)
-Definition at line 3191 of file linear_solver.pb.h.
+Definition at line 3172 of file linear_solver.pb.h.
Definition at line 1310 of file linear_solver.pb.h.
+Definition at line 1303 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPModelProto.variable)
-Definition at line 3051 of file linear_solver.pb.h.
+Definition at line 3032 of file linear_solver.pb.h.
@protoc_insertion_point(field_list:operations_research.MPModelProto.variable)
-Definition at line 3060 of file linear_solver.pb.h.
+Definition at line 3041 of file linear_solver.pb.h.
nested types -------------------------------------------------—
-repeated .operations_research.MPVariableProto variable = 3;
-accessors ----------------------------------------------------— repeated .operations_research.MPVariableProto variable = 3;
- -Definition at line 3036 of file linear_solver.pb.h.
+Definition at line 3017 of file linear_solver.pb.h.
Definition at line 1375 of file linear_solver.pb.h.
+Definition at line 1368 of file linear_solver.pb.h.
Definition at line 1487 of file linear_solver.pb.h.
+Definition at line 1480 of file linear_solver.pb.h.
Definition at line 1337 of file linear_solver.pb.h.
+Definition at line 1330 of file linear_solver.pb.h.
Definition at line 1416 of file linear_solver.pb.h.
+Definition at line 1409 of file linear_solver.pb.h.
Definition at line 1428 of file linear_solver.pb.h.
+Definition at line 1421 of file linear_solver.pb.h.
Definition at line 1333 of file linear_solver.pb.h.
+Definition at line 1326 of file linear_solver.pb.h.
Definition at line 1469 of file linear_solver.pb.h.
+Definition at line 1462 of file linear_solver.pb.h.
Definition at line 1440 of file linear_solver.pb.h.
+Definition at line 1433 of file linear_solver.pb.h.
Definition at line 1462 of file linear_solver.pb.h.
+Definition at line 1455 of file linear_solver.pb.h.
Definition at line 1453 of file linear_solver.pb.h.
+Definition at line 1446 of file linear_solver.pb.h.
Definition at line 1404 of file linear_solver.pb.h.
+Definition at line 1397 of file linear_solver.pb.h.
Definition at line 1844 of file linear_solver.pb.h.
+Definition at line 1834 of file linear_solver.pb.h.
Public Types | |
| typedef MPModelRequest_SolverType | SolverType |
| nested types -------------------------------------------------— More... | |
@@ -85,7 +84,6 @@ Public Member Functions | |
| void | Swap (MPModelRequest *other) |
| MPModelRequest * | New () const final |
| implements Message -------------------------------------------— More... | |
| MPModelRequest * | New (::PROTOBUF_NAMESPACE_ID::Arena *arena) const final |
| ::PROTOBUF_NAMESPACE_ID::Metadata | GetMetadata () const final |
| bool | has_solver_specific_parameters () const |
| accessors ----------------------------------------------------— More... | |
| void | clear_solver_specific_parameters () |
| void | set_allocated_solver_specific_parameters (std::string *solver_specific_parameters) |
| bool | has_model () const |
| optional .operations_research.MPModelProto model = 1; More... | |
| void | clear_model () |
| void | set_allocated_model (::operations_research::MPModelProto *model) |
| bool | has_solver_time_limit_seconds () const |
| optional double solver_time_limit_seconds = 3; More... | |
| void | clear_solver_time_limit_seconds () |
| void | set_solver_time_limit_seconds (double value) |
| bool | has_enable_internal_solver_output () const |
| optional bool enable_internal_solver_output = 4 [default = false]; More... | |
| void | clear_enable_internal_solver_output () |
| void | set_enable_internal_solver_output (bool value) |
| bool | has_solver_type () const |
| optional .operations_research.MPModelRequest.SolverType solver_type = 2; More... | |
| void | clear_solver_type () |
nested types -------------------------------------------------—
- -Definition at line 1958 of file linear_solver.pb.h.
+Definition at line 1948 of file linear_solver.pb.h.
Definition at line 1851 of file linear_solver.pb.h.
+Definition at line 1841 of file linear_solver.pb.h.
Definition at line 3559 of file linear_solver.pb.h.
+Definition at line 3537 of file linear_solver.pb.h.
Definition at line 3473 of file linear_solver.pb.h.
+Definition at line 3451 of file linear_solver.pb.h.
Definition at line 3577 of file linear_solver.pb.h.
+Definition at line 3555 of file linear_solver.pb.h.
Definition at line 3541 of file linear_solver.pb.h.
+Definition at line 3519 of file linear_solver.pb.h.
Definition at line 3522 of file linear_solver.pb.h.
+Definition at line 3500 of file linear_solver.pb.h.
Definition at line 1876 of file linear_solver.pb.h.
+Definition at line 1866 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPModelRequest.enable_internal_solver_output)
-Definition at line 3563 of file linear_solver.pb.h.
+Definition at line 3541 of file linear_solver.pb.h.
Definition at line 1927 of file linear_solver.pb.h.
+Definition at line 1917 of file linear_solver.pb.h.
Definition at line 1879 of file linear_solver.pb.h.
+Definition at line 1869 of file linear_solver.pb.h.
Definition at line 1882 of file linear_solver.pb.h.
+Definition at line 1872 of file linear_solver.pb.h.
optional bool enable_internal_solver_output = 4 [default = false];
- -Definition at line 3556 of file linear_solver.pb.h.
+Definition at line 3534 of file linear_solver.pb.h.
optional .operations_research.MPModelProto model = 1;
- -optional .operations_research.MPModelProto model = 1;
- -Definition at line 3470 of file linear_solver.pb.h.
+Definition at line 3448 of file linear_solver.pb.h.
accessors ----------------------------------------------------—
-optional string solver_specific_parameters = 5;
- -Definition at line 3574 of file linear_solver.pb.h.
+Definition at line 3552 of file linear_solver.pb.h.
optional double solver_time_limit_seconds = 3;
- -Definition at line 3538 of file linear_solver.pb.h.
+Definition at line 3516 of file linear_solver.pb.h.
optional .operations_research.MPModelRequest.SolverType solver_type = 2;
- -Definition at line 3519 of file linear_solver.pb.h.
+Definition at line 3497 of file linear_solver.pb.h.
Definition at line 1888 of file linear_solver.pb.h.
+Definition at line 1878 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPModelRequest.model)
-Definition at line 3477 of file linear_solver.pb.h.
+Definition at line 3455 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPModelRequest.model)
-Definition at line 3490 of file linear_solver.pb.h.
+Definition at line 3468 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPModelRequest.solver_specific_parameters)
-Definition at line 3608 of file linear_solver.pb.h.
+Definition at line 3586 of file linear_solver.pb.h.
Definition at line 1872 of file linear_solver.pb.h.
+Definition at line 1862 of file linear_solver.pb.h.
implements Message -------------------------------------------—
- -Definition at line 1902 of file linear_solver.pb.h.
+Definition at line 1892 of file linear_solver.pb.h.
Definition at line 1906 of file linear_solver.pb.h.
+Definition at line 1896 of file linear_solver.pb.h.
Definition at line 1856 of file linear_solver.pb.h.
+Definition at line 1846 of file linear_solver.pb.h.
Definition at line 1860 of file linear_solver.pb.h.
+Definition at line 1850 of file linear_solver.pb.h.
@protoc_insertion_point(field_release:operations_research.MPModelRequest.model)
-Definition at line 3483 of file linear_solver.pb.h.
+Definition at line 3461 of file linear_solver.pb.h.
@protoc_insertion_point(field_release:operations_research.MPModelRequest.solver_specific_parameters)
-Definition at line 3613 of file linear_solver.pb.h.
+Definition at line 3591 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_allocated:operations_research.MPModelRequest.model)
-Definition at line 3499 of file linear_solver.pb.h.
+Definition at line 3477 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_allocated:operations_research.MPModelRequest.solver_specific_parameters)
-Definition at line 3621 of file linear_solver.pb.h.
+Definition at line 3599 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPModelRequest.enable_internal_solver_output)
-Definition at line 3567 of file linear_solver.pb.h.
+Definition at line 3545 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPModelRequest.solver_specific_parameters)
-Definition at line 3585 of file linear_solver.pb.h.
+Definition at line 3563 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_rvalue:operations_research.MPModelRequest.solver_specific_parameters)
-Definition at line 3590 of file linear_solver.pb.h.
+Definition at line 3568 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_char:operations_research.MPModelRequest.solver_specific_parameters)
-Definition at line 3596 of file linear_solver.pb.h.
+Definition at line 3574 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_pointer:operations_research.MPModelRequest.solver_specific_parameters)
-Definition at line 3602 of file linear_solver.pb.h.
+Definition at line 3580 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPModelRequest.solver_time_limit_seconds)
-Definition at line 3549 of file linear_solver.pb.h.
+Definition at line 3527 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPModelRequest.solver_type)
-Definition at line 3530 of file linear_solver.pb.h.
+Definition at line 3508 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPModelRequest.solver_specific_parameters)
-Definition at line 3581 of file linear_solver.pb.h.
+Definition at line 3559 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPModelRequest.solver_time_limit_seconds)
-Definition at line 3545 of file linear_solver.pb.h.
+Definition at line 3523 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPModelRequest.solver_type)
-Definition at line 3526 of file linear_solver.pb.h.
+Definition at line 3504 of file linear_solver.pb.h.
Definition at line 1995 of file linear_solver.pb.h.
+Definition at line 1985 of file linear_solver.pb.h.
Definition at line 1985 of file linear_solver.pb.h.
+Definition at line 1975 of file linear_solver.pb.h.
Definition at line 1999 of file linear_solver.pb.h.
+Definition at line 1989 of file linear_solver.pb.h.
Definition at line 2005 of file linear_solver.pb.h.
+Definition at line 1995 of file linear_solver.pb.h.
Definition at line 1869 of file linear_solver.pb.h.
+Definition at line 1859 of file linear_solver.pb.h.
Definition at line 1934 of file linear_solver.pb.h.
+Definition at line 1924 of file linear_solver.pb.h.
Definition at line 2067 of file linear_solver.pb.h.
+Definition at line 2057 of file linear_solver.pb.h.
Definition at line 1896 of file linear_solver.pb.h.
+Definition at line 1886 of file linear_solver.pb.h.
Definition at line 1979 of file linear_solver.pb.h.
+Definition at line 1969 of file linear_solver.pb.h.
Definition at line 1973 of file linear_solver.pb.h.
+Definition at line 1963 of file linear_solver.pb.h.
Definition at line 1961 of file linear_solver.pb.h.
+Definition at line 1951 of file linear_solver.pb.h.
Definition at line 1967 of file linear_solver.pb.h.
+Definition at line 1957 of file linear_solver.pb.h.
Definition at line 1977 of file linear_solver.pb.h.
+Definition at line 1967 of file linear_solver.pb.h.
Definition at line 1959 of file linear_solver.pb.h.
+Definition at line 1949 of file linear_solver.pb.h.
Definition at line 1963 of file linear_solver.pb.h.
+Definition at line 1953 of file linear_solver.pb.h.
Definition at line 1971 of file linear_solver.pb.h.
+Definition at line 1961 of file linear_solver.pb.h.
Definition at line 1965 of file linear_solver.pb.h.
+Definition at line 1955 of file linear_solver.pb.h.
Definition at line 1975 of file linear_solver.pb.h.
+Definition at line 1965 of file linear_solver.pb.h.
Definition at line 2044 of file linear_solver.pb.h.
+Definition at line 2034 of file linear_solver.pb.h.
Definition at line 1892 of file linear_solver.pb.h.
+Definition at line 1882 of file linear_solver.pb.h.
Definition at line 2028 of file linear_solver.pb.h.
+Definition at line 2018 of file linear_solver.pb.h.
Definition at line 1983 of file linear_solver.pb.h.
+Definition at line 1973 of file linear_solver.pb.h.
Definition at line 2015 of file linear_solver.pb.h.
+Definition at line 2005 of file linear_solver.pb.h.
Definition at line 2037 of file linear_solver.pb.h.
+Definition at line 2027 of file linear_solver.pb.h.
Definition at line 2051 of file linear_solver.pb.h.
+Definition at line 2041 of file linear_solver.pb.h.
Definition at line 1981 of file linear_solver.pb.h.
+Definition at line 1971 of file linear_solver.pb.h.
Definition at line 1969 of file linear_solver.pb.h.
+Definition at line 1959 of file linear_solver.pb.h.
Definition at line 1992 of file linear_solver.pb.h.
+Definition at line 1982 of file linear_solver.pb.h.
Definition at line 1990 of file linear_solver.pb.h.
+Definition at line 1980 of file linear_solver.pb.h.
Definition at line 1988 of file linear_solver.pb.h.
+Definition at line 1978 of file linear_solver.pb.h.
This is the complete list of members for operations_research::MPObjective, including all inherited members.
+| AddLinearExpr(const LinearExpr &linear_expr) | operations_research::MPObjective | |
| BestBound() const | operations_research::MPObjective | |
| BopInterface class | operations_research::MPObjective | friend |
| CBCInterface class | operations_research::MPObjective | friend |
| Clear() | operations_research::MPObjective | |
| CLPInterface class | operations_research::MPObjective | friend |
| CplexInterface class | operations_research::MPObjective | friend |
| GetCoefficient(const MPVariable *const var) const | operations_research::MPObjective | |
| GLOPInterface class | operations_research::MPObjective | friend |
| GLPKInterface class | operations_research::MPObjective | friend |
| GurobiInterface class | operations_research::MPObjective | friend |
| KnapsackInterface class | operations_research::MPObjective | friend |
| maximization() const | operations_research::MPObjective | |
| MaximizeLinearExpr(const LinearExpr &linear_expr) | operations_research::MPObjective | inline |
| minimization() const | operations_research::MPObjective | |
| MinimizeLinearExpr(const LinearExpr &linear_expr) | operations_research::MPObjective | inline |
| MPSolver class | operations_research::MPObjective | friend |
| MPSolverInterface class | operations_research::MPObjective | friend |
| offset() const | operations_research::MPObjective | inline |
| OptimizeLinearExpr(const LinearExpr &linear_expr, bool is_maximization) | operations_research::MPObjective | |
| SatInterface class | operations_research::MPObjective | friend |
| SCIPInterface class | operations_research::MPObjective | friend |
| SetCoefficient(const MPVariable *const var, double coeff) | operations_research::MPObjective | |
| SetMaximization() | operations_research::MPObjective | inline |
| SetMinimization() | operations_research::MPObjective | inline |
| SetOffset(double value) | operations_research::MPObjective | |
| SetOptimizationDirection(bool maximize) | operations_research::MPObjective | |
| SLMInterface class | operations_research::MPObjective | friend |
| terms() const | operations_research::MPObjective | inline |
| Value() const | operations_research::MPObjective |
A class to express a linear objective.
+ +Definition at line 919 of file linear_solver.h.
++Public Member Functions | |
| void | Clear () |
| Clears the offset, all variables and coefficients, and the optimization direction. More... | |
| void | SetCoefficient (const MPVariable *const var, double coeff) |
| Sets the coefficient of the variable in the objective. More... | |
| double | GetCoefficient (const MPVariable *const var) const |
| Gets the coefficient of a given variable in the objective. More... | |
| const absl::flat_hash_map< const MPVariable *, double > & | terms () const |
| Returns a map from variables to their coefficients in the objective. More... | |
| void | SetOffset (double value) |
| Sets the constant term in the objective. More... | |
| double | offset () const |
| Gets the constant term in the objective. More... | |
| void | OptimizeLinearExpr (const LinearExpr &linear_expr, bool is_maximization) |
| Resets the current objective to take the value of linear_expr, and sets the objective direction to maximize if "is_maximize", otherwise minimizes. More... | |
| void | MaximizeLinearExpr (const LinearExpr &linear_expr) |
| Resets the current objective to maximize linear_expr. More... | |
| void | MinimizeLinearExpr (const LinearExpr &linear_expr) |
| Resets the current objective to minimize linear_expr. More... | |
| void | AddLinearExpr (const LinearExpr &linear_expr) |
| Adds linear_expr to the current objective, does not change the direction. More... | |
| void | SetOptimizationDirection (bool maximize) |
| Sets the optimization direction (maximize: true or minimize: false). More... | |
| void | SetMinimization () |
| Sets the optimization direction to minimize. More... | |
| void | SetMaximization () |
| Sets the optimization direction to maximize. More... | |
| bool | maximization () const |
| Is the optimization direction set to maximize? More... | |
| bool | minimization () const |
| Is the optimization direction set to minimize? More... | |
| double | Value () const |
| Returns the objective value of the best solution found so far. More... | |
| double | BestBound () const |
| Returns the best objective bound. More... | |
+Friends | |
| class | MPSolver |
| class | MPSolverInterface |
| class | CBCInterface |
| class | CLPInterface |
| class | GLPKInterface |
| class | SCIPInterface |
| class | SLMInterface |
| class | GurobiInterface |
| class | CplexInterface |
| class | GLOPInterface |
| class | BopInterface |
| class | SatInterface |
| class | KnapsackInterface |
| void operations_research::MPObjective::AddLinearExpr | +( | +const LinearExpr & | +linear_expr | ) | ++ |
Adds linear_expr to the current objective, does not change the direction.
+ +| double operations_research::MPObjective::BestBound | +( | +) | +const | +
Returns the best objective bound.
+In case of minimization, it is a lower bound on the objective value of the optimal integer solution. Only available for discrete problems.
+ +| void operations_research::MPObjective::Clear | +( | +) | ++ |
Clears the offset, all variables and coefficients, and the optimization direction.
+ +| double operations_research::MPObjective::GetCoefficient | +( | +const MPVariable *const | +var | ) | +const | +
Gets the coefficient of a given variable in the objective.
+It returns 0 if the variable does not appear in the objective).
+ +| bool operations_research::MPObjective::maximization | +( | +) | +const | +
Is the optimization direction set to maximize?
+ +
+
|
+ +inline | +
Resets the current objective to maximize linear_expr.
+ +Definition at line 970 of file linear_solver.h.
+ +| bool operations_research::MPObjective::minimization | +( | +) | +const | +
Is the optimization direction set to minimize?
+ +
+
|
+ +inline | +
Resets the current objective to minimize linear_expr.
+ +Definition at line 976 of file linear_solver.h.
+ +
+
|
+ +inline | +
Gets the constant term in the objective.
+ +Definition at line 959 of file linear_solver.h.
+ +| void operations_research::MPObjective::OptimizeLinearExpr | +( | +const LinearExpr & | +linear_expr, | +
| + | + | bool | +is_maximization | +
| + | ) | ++ |
Resets the current objective to take the value of linear_expr, and sets the objective direction to maximize if "is_maximize", otherwise minimizes.
+ +| void operations_research::MPObjective::SetCoefficient | +( | +const MPVariable *const | +var, | +
| + | + | double | +coeff | +
| + | ) | ++ |
Sets the coefficient of the variable in the objective.
+If the variable does not belong to the solver, the function just returns, or crashes in non-opt mode.
+ +
+
|
+ +inline | +
Sets the optimization direction to maximize.
+ +Definition at line 998 of file linear_solver.h.
+ +
+
|
+ +inline | +
Sets the optimization direction to minimize.
+ +Definition at line 993 of file linear_solver.h.
+ +| void operations_research::MPObjective::SetOffset | +( | +double | +value | ) | ++ |
Sets the constant term in the objective.
+ +| void operations_research::MPObjective::SetOptimizationDirection | +( | +bool | +maximize | ) | ++ |
Sets the optimization direction (maximize: true or minimize: false).
+ +
+
|
+ +inline | +
Returns a map from variables to their coefficients in the objective.
+If a variable is not present in the map, then its coefficient is zero.
+ +Definition at line 947 of file linear_solver.h.
+ +| double operations_research::MPObjective::Value | +( | +) | +const | +
Returns the objective value of the best solution found so far.
+It is the optimal objective value if the problem has been solved to optimality.
+Note: the objective value may be slightly different than what you could compute yourself using MPVariable::solution_value(); please use the –verify_solution flag to gain confidence about the numerical stability of your solution.
+
|
+ +friend | +
Definition at line 1041 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1033 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1034 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1039 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1040 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1035 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1038 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1043 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1031 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1032 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1042 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1036 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1037 of file linear_solver.h.
+ +Definition at line 2072 of file linear_solver.pb.h.
+Definition at line 2061 of file linear_solver.pb.h.
Public Member Functions | |
| void | Swap (MPSolutionResponse *other) |
| MPSolutionResponse * | New () const final |
| implements Message -------------------------------------------— More... | |
| MPSolutionResponse * | New (::PROTOBUF_NAMESPACE_ID::Arena *arena) const final |
| ::PROTOBUF_NAMESPACE_ID::Metadata | GetMetadata () const final |
| int | variable_value_size () const |
| nested types -------------------------------------------------— More... | |
| void | clear_variable_value () |
| ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > * | mutable_variable_value () |
| int | dual_value_size () const |
| repeated double dual_value = 4 [packed = true]; More... | |
| void | clear_dual_value () |
| ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > * | mutable_dual_value () |
| int | reduced_cost_size () const |
| repeated double reduced_cost = 6 [packed = true]; More... | |
| void | clear_reduced_cost () |
| ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > * | mutable_reduced_cost () |
| bool | has_objective_value () const |
| optional double objective_value = 2; More... | |
| void | clear_objective_value () |
| void | set_objective_value (double value) |
| bool | has_best_objective_bound () const |
| optional double best_objective_bound = 5; More... | |
| void | clear_best_objective_bound () |
| void | set_best_objective_bound (double value) |
| bool | has_status () const |
| optional .operations_research.MPSolverResponseStatus status = 1 [default = MPSOLVER_UNKNOWN_STATUS]; More... | |
| void | clear_status () |
Definition at line 2079 of file linear_solver.pb.h.
+Definition at line 2068 of file linear_solver.pb.h.
@protoc_insertion_point(field_add:operations_research.MPSolutionResponse.dual_value)
-Definition at line 3736 of file linear_solver.pb.h.
+Definition at line 3713 of file linear_solver.pb.h.
@protoc_insertion_point(field_add:operations_research.MPSolutionResponse.reduced_cost)
-Definition at line 3766 of file linear_solver.pb.h.
+Definition at line 3743 of file linear_solver.pb.h.
@protoc_insertion_point(field_add:operations_research.MPSolutionResponse.variable_value)
-Definition at line 3706 of file linear_solver.pb.h.
+Definition at line 3683 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSolutionResponse.best_objective_bound)
-Definition at line 3681 of file linear_solver.pb.h.
+Definition at line 3658 of file linear_solver.pb.h.
Definition at line 3677 of file linear_solver.pb.h.
+Definition at line 3654 of file linear_solver.pb.h.
Definition at line 3725 of file linear_solver.pb.h.
+Definition at line 3702 of file linear_solver.pb.h.
Definition at line 3659 of file linear_solver.pb.h.
+Definition at line 3636 of file linear_solver.pb.h.
Definition at line 3755 of file linear_solver.pb.h.
+Definition at line 3732 of file linear_solver.pb.h.
Definition at line 3640 of file linear_solver.pb.h.
+Definition at line 3617 of file linear_solver.pb.h.
Definition at line 3695 of file linear_solver.pb.h.
+Definition at line 3672 of file linear_solver.pb.h.
Definition at line 2104 of file linear_solver.pb.h.
+Definition at line 2093 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSolutionResponse.dual_value)
-Definition at line 3728 of file linear_solver.pb.h.
+Definition at line 3705 of file linear_solver.pb.h.
@protoc_insertion_point(field_list:operations_research.MPSolutionResponse.dual_value)
-Definition at line 3741 of file linear_solver.pb.h.
+Definition at line 3718 of file linear_solver.pb.h.
repeated double dual_value = 4 [packed = true];
- -Definition at line 3722 of file linear_solver.pb.h.
+Definition at line 3699 of file linear_solver.pb.h.
Definition at line 2155 of file linear_solver.pb.h.
+Definition at line 2144 of file linear_solver.pb.h.
Definition at line 2107 of file linear_solver.pb.h.
+Definition at line 2096 of file linear_solver.pb.h.
Definition at line 2110 of file linear_solver.pb.h.
+Definition at line 2099 of file linear_solver.pb.h.
optional double best_objective_bound = 5;
- -Definition at line 3674 of file linear_solver.pb.h.
+Definition at line 3651 of file linear_solver.pb.h.
optional double objective_value = 2;
- -Definition at line 3656 of file linear_solver.pb.h.
+Definition at line 3633 of file linear_solver.pb.h.
optional .operations_research.MPSolverResponseStatus status = 1 [default = MPSOLVER_UNKNOWN_STATUS];
- -optional .operations_research.MPSolverResponseStatus status = 1 [default = MPSOLVER_UNKNOWN_STATUS];
- -Definition at line 3637 of file linear_solver.pb.h.
+Definition at line 3614 of file linear_solver.pb.h.
Definition at line 2116 of file linear_solver.pb.h.
+Definition at line 2105 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable_list:operations_research.MPSolutionResponse.dual_value)
-Definition at line 3746 of file linear_solver.pb.h.
+Definition at line 3723 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable_list:operations_research.MPSolutionResponse.reduced_cost)
-Definition at line 3776 of file linear_solver.pb.h.
+Definition at line 3753 of file linear_solver.pb.h.
Definition at line 2100 of file linear_solver.pb.h.
+Definition at line 2089 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable_list:operations_research.MPSolutionResponse.variable_value)
-Definition at line 3716 of file linear_solver.pb.h.
+Definition at line 3693 of file linear_solver.pb.h.
implements Message -------------------------------------------—
- -Definition at line 2130 of file linear_solver.pb.h.
+Definition at line 2119 of file linear_solver.pb.h.
Definition at line 2134 of file linear_solver.pb.h.
+Definition at line 2123 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSolutionResponse.objective_value)
-Definition at line 3663 of file linear_solver.pb.h.
+Definition at line 3640 of file linear_solver.pb.h.
Definition at line 2084 of file linear_solver.pb.h.
+Definition at line 2073 of file linear_solver.pb.h.
Definition at line 2088 of file linear_solver.pb.h.
+Definition at line 2077 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSolutionResponse.reduced_cost)
-Definition at line 3758 of file linear_solver.pb.h.
+Definition at line 3735 of file linear_solver.pb.h.
@protoc_insertion_point(field_list:operations_research.MPSolutionResponse.reduced_cost)
-Definition at line 3771 of file linear_solver.pb.h.
+Definition at line 3748 of file linear_solver.pb.h.
repeated double reduced_cost = 6 [packed = true];
- -Definition at line 3752 of file linear_solver.pb.h.
+Definition at line 3729 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPSolutionResponse.best_objective_bound)
-Definition at line 3685 of file linear_solver.pb.h.
+Definition at line 3662 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPSolutionResponse.dual_value)
-Definition at line 3732 of file linear_solver.pb.h.
+Definition at line 3709 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPSolutionResponse.objective_value)
-Definition at line 3667 of file linear_solver.pb.h.
+Definition at line 3644 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPSolutionResponse.reduced_cost)
-Definition at line 3762 of file linear_solver.pb.h.
+Definition at line 3739 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPSolutionResponse.status)
-Definition at line 3648 of file linear_solver.pb.h.
+Definition at line 3625 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPSolutionResponse.variable_value)
-Definition at line 3702 of file linear_solver.pb.h.
+Definition at line 3679 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSolutionResponse.status)
-Definition at line 3644 of file linear_solver.pb.h.
+Definition at line 3621 of file linear_solver.pb.h.
Definition at line 2097 of file linear_solver.pb.h.
+Definition at line 2086 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSolutionResponse.variable_value)
-Definition at line 3698 of file linear_solver.pb.h.
+Definition at line 3675 of file linear_solver.pb.h.
@protoc_insertion_point(field_list:operations_research.MPSolutionResponse.variable_value)
-Definition at line 3711 of file linear_solver.pb.h.
+Definition at line 3688 of file linear_solver.pb.h.
nested types -------------------------------------------------—
-repeated double variable_value = 3 [packed = true];
-accessors ----------------------------------------------------— repeated double variable_value = 3 [packed = true];
- -Definition at line 3692 of file linear_solver.pb.h.
+Definition at line 3669 of file linear_solver.pb.h.
Definition at line 2162 of file linear_solver.pb.h.
+Definition at line 2151 of file linear_solver.pb.h.
Definition at line 2261 of file linear_solver.pb.h.
+Definition at line 2250 of file linear_solver.pb.h.
Definition at line 2124 of file linear_solver.pb.h.
+Definition at line 2113 of file linear_solver.pb.h.
Definition at line 2234 of file linear_solver.pb.h.
+Definition at line 2223 of file linear_solver.pb.h.
Definition at line 2203 of file linear_solver.pb.h.
+Definition at line 2192 of file linear_solver.pb.h.
Definition at line 2120 of file linear_solver.pb.h.
+Definition at line 2109 of file linear_solver.pb.h.
Definition at line 2227 of file linear_solver.pb.h.
+Definition at line 2216 of file linear_solver.pb.h.
Definition at line 2215 of file linear_solver.pb.h.
+Definition at line 2204 of file linear_solver.pb.h.
Definition at line 2241 of file linear_solver.pb.h.
+Definition at line 2230 of file linear_solver.pb.h.
Definition at line 2191 of file linear_solver.pb.h.
+Definition at line 2180 of file linear_solver.pb.h.
This is the complete list of members for operations_research::MPSolver, including all inherited members.
+| ABNORMAL enum value | operations_research::MPSolver | |
| AT_LOWER_BOUND enum value | operations_research::MPSolver | |
| AT_UPPER_BOUND enum value | operations_research::MPSolver | |
| BASIC enum value | operations_research::MPSolver | |
| BasisStatus enum name | operations_research::MPSolver | |
| BOP_INTEGER_PROGRAMMING enum value | operations_research::MPSolver | |
| BopInterface class | operations_research::MPSolver | friend |
| CBC_MIXED_INTEGER_PROGRAMMING enum value | operations_research::MPSolver | |
| CBCInterface class | operations_research::MPSolver | friend |
| ClampSolutionWithinBounds() | operations_research::MPSolver | |
| Clear() | operations_research::MPSolver | |
| CLP_LINEAR_PROGRAMMING enum value | operations_research::MPSolver | |
| CLPInterface class | operations_research::MPSolver | friend |
| ComputeConstraintActivities() const | operations_research::MPSolver | |
| ComputeExactConditionNumber() const | operations_research::MPSolver | |
| constraints() const | operations_research::MPSolver | inline |
| CplexInterface class | operations_research::MPSolver | friend |
| DurationSinceConstruction() const | operations_research::MPSolver | inline |
| EnableOutput() | operations_research::MPSolver | |
| ExportModelAsLpFormat(bool obfuscate, std::string *model_str) const | operations_research::MPSolver | |
| ExportModelAsMpsFormat(bool fixed_format, bool obfuscate, std::string *model_str) const | operations_research::MPSolver | |
| ExportModelToProto(MPModelProto *output_model) const | operations_research::MPSolver | |
| FEASIBLE enum value | operations_research::MPSolver | |
| FillSolutionResponseProto(MPSolutionResponse *response) const | operations_research::MPSolver | |
| FIXED_VALUE enum value | operations_research::MPSolver | |
| FREE enum value | operations_research::MPSolver | |
| GetNumThreads() const | operations_research::MPSolver | inline |
| GetSolverSpecificParametersAsString() const | operations_research::MPSolver | inline |
| GLOP_LINEAR_PROGRAMMING enum value | operations_research::MPSolver | |
| GLOPInterface class | operations_research::MPSolver | friend |
| GLPKInterface class | operations_research::MPSolver | friend |
| GurobiInterface class | operations_research::MPSolver | friend |
| INFEASIBLE enum value | operations_research::MPSolver | |
| infinity() | operations_research::MPSolver | inlinestatic |
| InterruptSolve() | operations_research::MPSolver | |
| IsMIP() const | operations_research::MPSolver | |
| iterations() const | operations_research::MPSolver | |
| KnapsackInterface class | operations_research::MPSolver | friend |
| LoadModelFromProto(const MPModelProto &input_model, std::string *error_message) | operations_research::MPSolver | |
| LoadModelFromProtoWithUniqueNamesOrDie(const MPModelProto &input_model, std::string *error_message) | operations_research::MPSolver | |
| LoadSolutionFromProto(const MPSolutionResponse &response, double tolerance=kDefaultPrimalTolerance) | operations_research::MPSolver | |
| LookupConstraintOrNull(const std::string &constraint_name) const | operations_research::MPSolver | |
| LookupVariableOrNull(const std::string &var_name) const | operations_research::MPSolver | |
| MakeBoolVar(const std::string &name) | operations_research::MPSolver | |
| MakeBoolVarArray(int nb, const std::string &name, std::vector< MPVariable * > *vars) | operations_research::MPSolver | |
| MakeIntVar(double lb, double ub, const std::string &name) | operations_research::MPSolver | |
| MakeIntVarArray(int nb, double lb, double ub, const std::string &name, std::vector< MPVariable * > *vars) | operations_research::MPSolver | |
| MakeNumVar(double lb, double ub, const std::string &name) | operations_research::MPSolver | |
| MakeNumVarArray(int nb, double lb, double ub, const std::string &name, std::vector< MPVariable * > *vars) | operations_research::MPSolver | |
| MakeRowConstraint(double lb, double ub) | operations_research::MPSolver | |
| MakeRowConstraint() | operations_research::MPSolver | |
| MakeRowConstraint(double lb, double ub, const std::string &name) | operations_research::MPSolver | |
| MakeRowConstraint(const std::string &name) | operations_research::MPSolver | |
| MakeRowConstraint(const LinearRange &range) | operations_research::MPSolver | |
| MakeRowConstraint(const LinearRange &range, const std::string &name) | operations_research::MPSolver | |
| MakeVar(double lb, double ub, bool integer, const std::string &name) | operations_research::MPSolver | |
| MakeVarArray(int nb, double lb, double ub, bool integer, const std::string &name_prefix, std::vector< MPVariable * > *vars) | operations_research::MPSolver | |
| MODEL_INVALID enum value | operations_research::MPSolver | |
| MPSolver(const std::string &name, OptimizationProblemType problem_type) | operations_research::MPSolver | |
| MPSolverInterface class | operations_research::MPSolver | friend |
| MutableObjective() | operations_research::MPSolver | inline |
| Name() const | operations_research::MPSolver | inline |
| NextSolution() | operations_research::MPSolver | |
| nodes() const | operations_research::MPSolver | |
| NOT_SOLVED enum value | operations_research::MPSolver | |
| NumConstraints() const | operations_research::MPSolver | inline |
| NumVariables() const | operations_research::MPSolver | inline |
| Objective() const | operations_research::MPSolver | inline |
| OPTIMAL enum value | operations_research::MPSolver | |
| OptimizationProblemType enum name | operations_research::MPSolver | |
| OutputIsEnabled() const | operations_research::MPSolver | |
| OwnsVariable(const MPVariable *var) const | operations_research::MPSolver | |
| ParseSolverType(absl::string_view solver, OptimizationProblemType *type) | operations_research::MPSolver | static |
| ProblemType() const | operations_research::MPSolver | inlinevirtual |
| Reset() | operations_research::MPSolver | |
| ResultStatus enum name | operations_research::MPSolver | |
| SatInterface class | operations_research::MPSolver | friend |
| SCIP_MIXED_INTEGER_PROGRAMMING enum value | operations_research::MPSolver | |
| SCIPInterface class | operations_research::MPSolver | friend |
| set_time_limit(int64 time_limit_milliseconds) | operations_research::MPSolver | inline |
| SetHint(std::vector< std::pair< const MPVariable *, double > > hint) | operations_research::MPSolver | |
| SetNumThreads(int num_threads) | operations_research::MPSolver | |
| SetSolverSpecificParametersAsString(const std::string ¶meters) | operations_research::MPSolver | |
| SetStartingLpBasis(const std::vector< MPSolver::BasisStatus > &variable_statuses, const std::vector< MPSolver::BasisStatus > &constraint_statuses) | operations_research::MPSolver | |
| SetTimeLimit(absl::Duration time_limit) | operations_research::MPSolver | inline |
| SLMInterface class | operations_research::MPSolver | friend |
| Solve() | operations_research::MPSolver | |
| Solve(const MPSolverParameters ¶m) | operations_research::MPSolver | |
| SolverVersion() const | operations_research::MPSolver | |
| SolveWithProto(const MPModelRequest &model_request, MPSolutionResponse *response) | operations_research::MPSolver | static |
| SupportsProblemType(OptimizationProblemType problem_type) | operations_research::MPSolver | static |
| SuppressOutput() | operations_research::MPSolver | |
| time_limit() const | operations_research::MPSolver | inline |
| time_limit_in_secs() const | operations_research::MPSolver | inline |
| TimeLimit() const | operations_research::MPSolver | inline |
| UNBOUNDED enum value | operations_research::MPSolver | |
| underlying_solver() | operations_research::MPSolver | |
| variables() const | operations_research::MPSolver | inline |
| VerifySolution(double tolerance, bool log_errors) const | operations_research::MPSolver | |
| wall_time() const | operations_research::MPSolver | inline |
| Write(const std::string &file_name) | operations_research::MPSolver | |
| ~MPSolver() | operations_research::MPSolver | virtual |
This mathematical programming (MP) solver class is the main class though which users build and solve problems.
+ +Definition at line 174 of file linear_solver.h.
++Public Types | |
| enum | OptimizationProblemType { + CLP_LINEAR_PROGRAMMING = 0, +GLOP_LINEAR_PROGRAMMING = 2, +SCIP_MIXED_INTEGER_PROGRAMMING = 3, +CBC_MIXED_INTEGER_PROGRAMMING = 5, + + BOP_INTEGER_PROGRAMMING = 12 + + } |
| The type of problems (LP or MIP) that will be solved and the underlying solver (GLOP, GLPK, CLP, CBC or SCIP) that will solve them. More... | |
| enum | ResultStatus { + OPTIMAL, +FEASIBLE, +INFEASIBLE, +UNBOUNDED, + + ABNORMAL, +MODEL_INVALID, +NOT_SOLVED = 6 + + } |
| The status of solving the problem. More... | |
| enum | BasisStatus { + FREE = 0, +AT_LOWER_BOUND, +AT_UPPER_BOUND, +FIXED_VALUE, + + BASIC + + } |
| Advanced usage: possible basis status values for a variable and the slack variable of a linear constraint. More... | |
+Public Member Functions | |
| MPSolver (const std::string &name, OptimizationProblemType problem_type) | |
| Create a solver with the given name and underlying solver backend. More... | |
| virtual | ~MPSolver () |
| bool | IsMIP () const |
| const std::string & | Name () const |
| Returns the name of the model set at construction. More... | |
| virtual OptimizationProblemType | ProblemType () const |
| Returns the optimization problem type set at construction. More... | |
| void | Clear () |
| Clears the objective (including the optimization direction), all variables and constraints. More... | |
| int | NumVariables () const |
| Returns the number of variables. More... | |
| const std::vector< MPVariable * > & | variables () const |
| Returns the array of variables handled by the MPSolver. More... | |
| MPVariable * | LookupVariableOrNull (const std::string &var_name) const |
| Looks up a variable by name, and returns nullptr if it does not exist. More... | |
| MPVariable * | MakeVar (double lb, double ub, bool integer, const std::string &name) |
| Creates a variable with the given bounds, integrality requirement and name. More... | |
| MPVariable * | MakeNumVar (double lb, double ub, const std::string &name) |
| Creates a continuous variable. More... | |
| MPVariable * | MakeIntVar (double lb, double ub, const std::string &name) |
| Creates an integer variable. More... | |
| MPVariable * | MakeBoolVar (const std::string &name) |
| Creates a boolean variable. More... | |
| void | MakeVarArray (int nb, double lb, double ub, bool integer, const std::string &name_prefix, std::vector< MPVariable * > *vars) |
| Creates an array of variables. More... | |
| void | MakeNumVarArray (int nb, double lb, double ub, const std::string &name, std::vector< MPVariable * > *vars) |
| Creates an array of continuous variables. More... | |
| void | MakeIntVarArray (int nb, double lb, double ub, const std::string &name, std::vector< MPVariable * > *vars) |
| Creates an array of integer variables. More... | |
| void | MakeBoolVarArray (int nb, const std::string &name, std::vector< MPVariable * > *vars) |
| Creates an array of boolean variables. More... | |
| int | NumConstraints () const |
| Returns the number of constraints. More... | |
| const std::vector< MPConstraint * > & | constraints () const |
| Returns the array of constraints handled by the MPSolver. More... | |
| MPConstraint * | LookupConstraintOrNull (const std::string &constraint_name) const |
| Looks up a constraint by name, and returns nullptr if it does not exist. More... | |
| MPConstraint * | MakeRowConstraint (double lb, double ub) |
| Creates a linear constraint with given bounds. More... | |
| MPConstraint * | MakeRowConstraint () |
| Creates a constraint with -infinity and +infinity bounds. More... | |
| MPConstraint * | MakeRowConstraint (double lb, double ub, const std::string &name) |
| Creates a named constraint with given bounds. More... | |
| MPConstraint * | MakeRowConstraint (const std::string &name) |
| Creates a named constraint with -infinity and +infinity bounds. More... | |
| MPConstraint * | MakeRowConstraint (const LinearRange &range) |
| Creates a constraint owned by MPSolver enforcing: range.lower_bound() <= range.linear_expr() <= range.upper_bound() More... | |
| MPConstraint * | MakeRowConstraint (const LinearRange &range, const std::string &name) |
| As above, but also names the constraint. More... | |
| const MPObjective & | Objective () const |
| Returns the objective object. More... | |
| MPObjective * | MutableObjective () |
| Returns the mutable objective object. More... | |
| ResultStatus | Solve () |
| Solves the problem using default parameter values. More... | |
| ResultStatus | Solve (const MPSolverParameters ¶m) |
| Solves the problem using the specified parameter values. More... | |
| void | Write (const std::string &file_name) |
| Writes the model using the solver internal write function. More... | |
| std::vector< double > | ComputeConstraintActivities () const |
| Advanced usage: compute the "activities" of all constraints, which are the sums of their linear terms. More... | |
| bool | VerifySolution (double tolerance, bool log_errors) const |
| Advanced usage: Verifies the correctness of the solution. More... | |
| void | Reset () |
| Advanced usage: resets extracted model to solve from scratch. More... | |
| bool | InterruptSolve () |
| Interrupts the Solve() execution to terminate processing if possible. More... | |
| MPSolverResponseStatus | LoadModelFromProto (const MPModelProto &input_model, std::string *error_message) |
| Loads model from protocol buffer. More... | |
| MPSolverResponseStatus | LoadModelFromProtoWithUniqueNamesOrDie (const MPModelProto &input_model, std::string *error_message) |
| Loads model from protocol buffer. More... | |
| void | FillSolutionResponseProto (MPSolutionResponse *response) const |
| Encodes the current solution in a solution response protocol buffer. More... | |
| void | ExportModelToProto (MPModelProto *output_model) const |
| Exports model to protocol buffer. More... | |
| util::Status | LoadSolutionFromProto (const MPSolutionResponse &response, double tolerance=kDefaultPrimalTolerance) |
| Load a solution encoded in a protocol buffer onto this solver for easy access via the MPSolver interface. More... | |
| util::Status | ClampSolutionWithinBounds () |
| Resets values of out of bound variables to the corresponding bound and returns an error if any of the variables have NaN value. More... | |
| bool | ExportModelAsLpFormat (bool obfuscate, std::string *model_str) const |
| Shortcuts to the homonymous MPModelProtoExporter methods, via exporting to a MPModelProto with ExportModelToProto() (see above). More... | |
| bool | ExportModelAsMpsFormat (bool fixed_format, bool obfuscate, std::string *model_str) const |
| util::Status | SetNumThreads (int num_threads) |
| Sets the number of threads to use by the underlying solver. More... | |
| int | GetNumThreads () const |
| Returns the number of threads to be used during solve. More... | |
| bool | SetSolverSpecificParametersAsString (const std::string ¶meters) |
| Advanced usage: pass solver specific parameters in text format. More... | |
| std::string | GetSolverSpecificParametersAsString () const |
| void | SetHint (std::vector< std::pair< const MPVariable *, double > > hint) |
| Set a hint for solution. More... | |
| void | SetStartingLpBasis (const std::vector< MPSolver::BasisStatus > &variable_statuses, const std::vector< MPSolver::BasisStatus > &constraint_statuses) |
| Advanced usage: Incrementality. More... | |
| bool | OutputIsEnabled () const |
| Controls (or queries) the amount of output produced by the underlying solver. More... | |
| void | EnableOutput () |
| Enable output. More... | |
| void | SuppressOutput () |
| Suppress output. More... | |
| absl::Duration | TimeLimit () const |
| void | SetTimeLimit (absl::Duration time_limit) |
| absl::Duration | DurationSinceConstruction () const |
| int64 | iterations () const |
| Returns the number of simplex iterations. More... | |
| int64 | nodes () const |
| Returns the number of branch-and-bound nodes evaluated during the solve. More... | |
| std::string | SolverVersion () const |
| Returns a std::string describing the underlying solver and its version. More... | |
| void * | underlying_solver () |
| Advanced usage: returns the underlying solver. More... | |
| double | ComputeExactConditionNumber () const |
| Advanced usage: computes the exact condition number of the current scaled basis: L1norm(B) * L1norm(inverse(B)), where B is the scaled basis. More... | |
| ABSL_MUST_USE_RESULT bool | NextSolution () |
| Some solvers (MIP only, not LP) can produce multiple solutions to the problem. More... | |
| int64 | time_limit () const |
| void | set_time_limit (int64 time_limit_milliseconds) |
| double | time_limit_in_secs () const |
| int64 | wall_time () const |
| bool | OwnsVariable (const MPVariable *var) const |
+Static Public Member Functions | |
| static bool | SupportsProblemType (OptimizationProblemType problem_type) |
| Whether the given problem type is supported (this will depend on the targets that you linked). More... | |
| static bool | ParseSolverType (absl::string_view solver, OptimizationProblemType *type) |
| Parses the name of the solver. More... | |
| static void | SolveWithProto (const MPModelRequest &model_request, MPSolutionResponse *response) |
| Solves the model encoded by a MPModelRequest protocol buffer and fills the solution encoded as a MPSolutionResponse. More... | |
| static double | infinity () |
| Infinity. More... | |
+Friends | |
| class | GLPKInterface |
| class | CLPInterface |
| class | CBCInterface |
| class | SCIPInterface |
| class | GurobiInterface |
| class | CplexInterface |
| class | SLMInterface |
| class | MPSolverInterface |
| class | GLOPInterface |
| class | BopInterface |
| class | SatInterface |
| class | KnapsackInterface |
| enum operations_research::MPSolver::BasisStatus | +
Advanced usage: possible basis status values for a variable and the slack variable of a linear constraint.
+| Enumerator | |
|---|---|
| FREE | |
| AT_LOWER_BOUND | |
| AT_UPPER_BOUND | |
| FIXED_VALUE | |
| BASIC | |
Definition at line 654 of file linear_solver.h.
+ +| enum operations_research::MPSolver::OptimizationProblemType | +
The type of problems (LP or MIP) that will be solved and the underlying solver (GLOP, GLPK, CLP, CBC or SCIP) that will solve them.
+This must remain consistent with MPModelRequest::OptimizationProblemType (take particular care of the open-source version).
+| Enumerator | |
|---|---|
| CLP_LINEAR_PROGRAMMING | Linear Programming solver using Coin CBC. + |
| GLOP_LINEAR_PROGRAMMING | Linear Programming solver using GLOP (Recommended solver). + |
| SCIP_MIXED_INTEGER_PROGRAMMING | Mixed integer Programming Solver using SCIP. +(Recommended for problems with continous variables) + |
| CBC_MIXED_INTEGER_PROGRAMMING | Mixed integer Programming Solver using Coin CBC. + |
| BOP_INTEGER_PROGRAMMING | Linear Boolean Programming Solver. + |
Definition at line 182 of file linear_solver.h.
+ +| enum operations_research::MPSolver::ResultStatus | +
The status of solving the problem.
+The straightforward translation to homonymous enum values of MPSolverResponseStatus (see ./linear_solver.proto) is guaranteed by ./enum_consistency_test.cc, you may rely on it.
+| Enumerator | |
|---|---|
| OPTIMAL | optimal. + |
| FEASIBLE | feasible, or stopped by limit. + |
| INFEASIBLE | proven infeasible. + |
| UNBOUNDED | proven unbounded. + |
| ABNORMAL | abnormal, i.e., error of some kind. + |
| MODEL_INVALID | the model is trivially invalid (NaN coefficients, etc). + |
| NOT_SOLVED | not been solved yet. + |
Definition at line 431 of file linear_solver.h.
+ +| operations_research::MPSolver::MPSolver | +( | +const std::string & | +name, | +
| + | + | OptimizationProblemType | +problem_type | +
| + | ) | ++ |
Create a solver with the given name and underlying solver backend.
+ +
+
|
+ +virtual | +
| util::Status operations_research::MPSolver::ClampSolutionWithinBounds | +( | +) | ++ |
Resets values of out of bound variables to the corresponding bound and returns an error if any of the variables have NaN value.
+ +| void operations_research::MPSolver::Clear | +( | +) | ++ |
Clears the objective (including the optimization direction), all variables and constraints.
+All the other properties of the MPSolver (like the time limit) are kept untouched.
+ +| std::vector<double> operations_research::MPSolver::ComputeConstraintActivities | +( | +) | +const | +
Advanced usage: compute the "activities" of all constraints, which are the sums of their linear terms.
+The activities are returned in the same order as constraints(), which is the order in which constraints were added; but you can also use MPConstraint::index() to get a constraint's index.
+ +| double operations_research::MPSolver::ComputeExactConditionNumber | +( | +) | +const | +
Advanced usage: computes the exact condition number of the current scaled basis: L1norm(B) * L1norm(inverse(B)), where B is the scaled basis.
+This method requires that a basis exists: it should be called after Solve. It is only available for continuous problems. It is implemented for GLPK but not CLP because CLP does not provide the API for doing it.
+The condition number measures how well the constraint matrix is conditioned and can be used to predict whether numerical issues will arise during the solve: the model is declared infeasible whereas it is feasible (or vice-versa), the solution obtained is not optimal or violates some constraints, the resolution is slow because of repeated singularities.
+The rule of thumb to interpret the condition number kappa is:
The computation of the condition number depends on the quality of the LU decomposition, so it is not very accurate when the matrix is ill conditioned.
+ +
+
|
+ +inline | +
Returns the array of constraints handled by the MPSolver.
+They are listed in the order in which they were created.
+ +Definition at line 363 of file linear_solver.h.
+ +
+
|
+ +inline | +
Definition at line 704 of file linear_solver.h.
+ +| void operations_research::MPSolver::EnableOutput | +( | +) | ++ |
Enable output.
+ +| bool operations_research::MPSolver::ExportModelAsLpFormat | +( | +bool | +obfuscate, | +
| + | + | std::string * | +model_str | +
| + | ) | +const | +
Shortcuts to the homonymous MPModelProtoExporter methods, via exporting to a MPModelProto with ExportModelToProto() (see above).
+Produces empty std::string on portable platforms (e.g. android, ios).
+ +| bool operations_research::MPSolver::ExportModelAsMpsFormat | +( | +bool | +fixed_format, | +
| + | + | bool | +obfuscate, | +
| + | + | std::string * | +model_str | +
| + | ) | +const | +
| void operations_research::MPSolver::ExportModelToProto | +( | +MPModelProto * | +output_model | ) | +const | +
Exports model to protocol buffer.
+ +| void operations_research::MPSolver::FillSolutionResponseProto | +( | +MPSolutionResponse * | +response | ) | +const | +
Encodes the current solution in a solution response protocol buffer.
+ +
+
|
+ +inline | +
Returns the number of threads to be used during solve.
+ +Definition at line 618 of file linear_solver.h.
+ +
+
|
+ +inline | +
Definition at line 631 of file linear_solver.h.
+ +
+
|
+ +inlinestatic | +
Infinity.
+You can use -MPSolver::infinity() for negative infinity.
+ +Definition at line 682 of file linear_solver.h.
+ +| bool operations_research::MPSolver::InterruptSolve | +( | +) | ++ |
Interrupts the Solve() execution to terminate processing if possible.
+If the underlying interface supports interruption; it does that and returns true regardless of whether there's an ongoing Solve() or not. The Solve() call may still linger for a while depending on the conditions. If interruption is not supported; returns false and does nothing.
+ +| bool operations_research::MPSolver::IsMIP | +( | +) | +const | +
| int64 operations_research::MPSolver::iterations | +( | +) | +const | +
Returns the number of simplex iterations.
+ +| MPSolverResponseStatus operations_research::MPSolver::LoadModelFromProto | +( | +const MPModelProto & | +input_model, | +
| + | + | std::string * | +error_message | +
| + | ) | ++ |
Loads model from protocol buffer.
+Returns MPSOLVER_MODEL_IS_VALID if the model is valid, and another status otherwise (currently only MPSOLVER_MODEL_INVALID and MPSOLVER_INFEASIBLE). If the model isn't valid, populates "error_message".
+ +| MPSolverResponseStatus operations_research::MPSolver::LoadModelFromProtoWithUniqueNamesOrDie | +( | +const MPModelProto & | +input_model, | +
| + | + | std::string * | +error_message | +
| + | ) | ++ |
Loads model from protocol buffer.
+The same as above, except that the loading keeps original variable and constraint names. Caller should make sure that all variable names and constraint names are unique, respectively.
+ +| util::Status operations_research::MPSolver::LoadSolutionFromProto | +( | +const MPSolutionResponse & | +response, | +
| + | + | double | +tolerance = kDefaultPrimalTolerance |
+
| + | ) | ++ |
Load a solution encoded in a protocol buffer onto this solver for easy access via the MPSolver interface.
+IMPORTANT: This may only be used in conjunction with ExportModel(), following this example:
+The response must be in OPTIMAL or FEASIBLE status.
+Returns a non-OK status if a problem arised (typically, if it wasn't used like it should be):
Note: the objective value isn't checked. You can use VerifySolution() for that.
+ +| MPConstraint* operations_research::MPSolver::LookupConstraintOrNull | +( | +const std::string & | +constraint_name | ) | +const | +
Looks up a constraint by name, and returns nullptr if it does not exist.
+The first call has a O(n) complexity, as the constraint name index is lazily created upon first use. Will crash if constraint names are not unique.
+ +| MPVariable* operations_research::MPSolver::LookupVariableOrNull | +( | +const std::string & | +var_name | ) | +const | +
Looks up a variable by name, and returns nullptr if it does not exist.
+The first call has a O(n) complexity, as the variable name index is lazily created upon first use. Will crash if variable names are not unique.
+ +| MPVariable* operations_research::MPSolver::MakeBoolVar | +( | +const std::string & | +name | ) | ++ |
Creates a boolean variable.
+ +| void operations_research::MPSolver::MakeBoolVarArray | +( | +int | +nb, | +
| + | + | const std::string & | +name, | +
| + | + | std::vector< MPVariable * > * | +vars | +
| + | ) | ++ |
Creates an array of boolean variables.
+ +| MPVariable* operations_research::MPSolver::MakeIntVar | +( | +double | +lb, | +
| + | + | double | +ub, | +
| + | + | const std::string & | +name | +
| + | ) | ++ |
Creates an integer variable.
+ +| void operations_research::MPSolver::MakeIntVarArray | +( | +int | +nb, | +
| + | + | double | +lb, | +
| + | + | double | +ub, | +
| + | + | const std::string & | +name, | +
| + | + | std::vector< MPVariable * > * | +vars | +
| + | ) | ++ |
Creates an array of integer variables.
+ +| MPVariable* operations_research::MPSolver::MakeNumVar | +( | +double | +lb, | +
| + | + | double | +ub, | +
| + | + | const std::string & | +name | +
| + | ) | ++ |
Creates a continuous variable.
+ +| void operations_research::MPSolver::MakeNumVarArray | +( | +int | +nb, | +
| + | + | double | +lb, | +
| + | + | double | +ub, | +
| + | + | const std::string & | +name, | +
| + | + | std::vector< MPVariable * > * | +vars | +
| + | ) | ++ |
Creates an array of continuous variables.
+ +| MPConstraint* operations_research::MPSolver::MakeRowConstraint | +( | +double | +lb, | +
| + | + | double | +ub | +
| + | ) | ++ |
Creates a linear constraint with given bounds.
+Bounds can be finite or +/- MPSolver::infinity(). The MPSolver class assumes ownership of the constraint.
+| MPConstraint* operations_research::MPSolver::MakeRowConstraint | +( | +) | ++ |
Creates a constraint with -infinity and +infinity bounds.
+ +| MPConstraint* operations_research::MPSolver::MakeRowConstraint | +( | +double | +lb, | +
| + | + | double | +ub, | +
| + | + | const std::string & | +name | +
| + | ) | ++ |
Creates a named constraint with given bounds.
+ +| MPConstraint* operations_research::MPSolver::MakeRowConstraint | +( | +const std::string & | +name | ) | ++ |
Creates a named constraint with -infinity and +infinity bounds.
+ +| MPConstraint* operations_research::MPSolver::MakeRowConstraint | +( | +const LinearRange & | +range | ) | ++ |
Creates a constraint owned by MPSolver enforcing: range.lower_bound() <= range.linear_expr() <= range.upper_bound()
+ +| MPConstraint* operations_research::MPSolver::MakeRowConstraint | +( | +const LinearRange & | +range, | +
| + | + | const std::string & | +name | +
| + | ) | ++ |
As above, but also names the constraint.
+ +| MPVariable* operations_research::MPSolver::MakeVar | +( | +double | +lb, | +
| + | + | double | +ub, | +
| + | + | bool | +integer, | +
| + | + | const std::string & | +name | +
| + | ) | ++ |
Creates a variable with the given bounds, integrality requirement and name.
+Bounds can be finite or +/- MPSolver::infinity(). The MPSolver owns the variable (i.e. the returned pointer is borrowed). Variable names are optional. If you give an empty name, name() will auto-generate one for you upon request.
+ +| void operations_research::MPSolver::MakeVarArray | +( | +int | +nb, | +
| + | + | double | +lb, | +
| + | + | double | +ub, | +
| + | + | bool | +integer, | +
| + | + | const std::string & | +name_prefix, | +
| + | + | std::vector< MPVariable * > * | +vars | +
| + | ) | ++ |
Creates an array of variables.
+All variables created have the same bounds and integrality requirement. If nb <= 0, no variables are created, the function crashes in non-opt mode.
+| nb | the number of variables to create. | |
| lb | the lower bound of created variables | |
| ub | the upper bound of created variables | |
| integer | controls whether the created variables are continuous or integral. | |
| name_prefix | the prefix of the variable names. Variables are named name_prefix0, name_prefix1, ... | |
| [out] | vars | the vector of variables to fill with variables. |
+
|
+ +inline | +
Returns the mutable objective object.
+ +Definition at line 423 of file linear_solver.h.
+ +
+
|
+ +inline | +
Returns the name of the model set at construction.
+ +Definition at line 256 of file linear_solver.h.
+ +| ABSL_MUST_USE_RESULT bool operations_research::MPSolver::NextSolution | +( | +) | ++ |
Some solvers (MIP only, not LP) can produce multiple solutions to the problem.
+Returns true when another solution is available, and updates the MPVariable* objects to make the new solution queryable. Call only after calling solve.
+The optimality properties of the additional solutions found, and whether or not the solver computes them ahead of time or when NextSolution() is called is solver specific.
+As of 2018-08-09, only Gurobi supports NextSolution(), see linear_solver_underlying_gurobi_test for an example of how to configure Gurobi for this purpose. The other solvers return false unconditionally.
+ +| int64 operations_research::MPSolver::nodes | +( | +) | +const | +
Returns the number of branch-and-bound nodes evaluated during the solve.
+Only available for discrete problems.
+ +
+
|
+ +inline | +
Returns the number of constraints.
+ +Definition at line 356 of file linear_solver.h.
+ +
+
|
+ +inline | +
Returns the number of variables.
+ +Definition at line 277 of file linear_solver.h.
+ +
+
|
+ +inline | +
Returns the objective object.
+Note that the objective is owned by the solver, and is initialized to its default value (see the MPObjective class below) at construction.
+ +Definition at line 418 of file linear_solver.h.
+ +| bool operations_research::MPSolver::OutputIsEnabled | +( | +) | +const | +
Controls (or queries) the amount of output produced by the underlying solver.
+The output can surface to LOGs, or to stdout or stderr, depending on the implementation. The amount of output will greatly vary with each implementation and each problem.
+Output is suppressed by default.
+ +| bool operations_research::MPSolver::OwnsVariable | +( | +const MPVariable * | +var | ) | +const | +
+
|
+ +static | +
Parses the name of the solver.
+Returns true if the solver type is successfully parsed as one of the OptimizationProblemType.
+ +
+
|
+ +inlinevirtual | +
Returns the optimization problem type set at construction.
+ +Definition at line 263 of file linear_solver.h.
+ +| void operations_research::MPSolver::Reset | +( | +) | ++ |
Advanced usage: resets extracted model to solve from scratch.
+This won't reset the parameters that were set with SetSolverSpecificParametersAsString() or set_time_limit() or even clear the linear program. It will just make sure that next Solve() will be as if everything was reconstructed from scratch.
+ +
+
|
+ +inline | +
Definition at line 789 of file linear_solver.h.
+ +| void operations_research::MPSolver::SetHint | +( | +std::vector< std::pair< const MPVariable *, double > > | +hint | ) | ++ |
Set a hint for solution.
+If a feasible or almost-feasible solution to the problem is already known, it may be helpful to pass it to the solver so that it can be used. A solver that supports this feature will try to use this information to create its initial feasible solution.
+Note: It may not always be faster to give a hint like this to the solver. There is also no guarantee that the solver will use this hint or try to return a solution "close" to this assignment in case of multiple optimal solutions.
+ +| util::Status operations_research::MPSolver::SetNumThreads | +( | +int | +num_threads | ) | ++ |
Sets the number of threads to use by the underlying solver.
+Returns OkStatus if the operation was successful. num_threads must be equal to or greater than 1. Note that the behaviour of this call depends on the underlying solver. E.g., it may set the exact number of threads or the max number of threads (check the solver's interface implementation for details). Also, some solvers may not (yet) support this function, but still enable multi-threading via SetSolverSpecificParametersAsString().
+ +| bool operations_research::MPSolver::SetSolverSpecificParametersAsString | +( | +const std::string & | +parameters | ) | ++ |
Advanced usage: pass solver specific parameters in text format.
+The format is solver-specific and is the same as the corresponding solver configuration file format. Returns true if the operation was successful.
+TODO(user): Currently SCIP will always return true even if the format is wrong (you can check the log if you suspect an issue there). This seems to be a bug in SCIP though.
+ +| void operations_research::MPSolver::SetStartingLpBasis | +( | +const std::vector< MPSolver::BasisStatus > & | +variable_statuses, | +
| + | + | const std::vector< MPSolver::BasisStatus > & | +constraint_statuses | +
| + | ) | ++ |
Advanced usage: Incrementality.
+This function takes a starting basis to be used in the next LP Solve() call. The statuses of a current solution can be retrieved via the basis_status() function of a MPVariable or a MPConstraint.
+WARNING: With Glop, you should disable presolve when using this because this information will not be modified in sync with the presolve and will likely not mean much on the presolved problem.
+ +
+
|
+ +inline | +
Definition at line 699 of file linear_solver.h.
+ +| ResultStatus operations_research::MPSolver::Solve | +( | +) | ++ |
Solves the problem using default parameter values.
+ +| ResultStatus operations_research::MPSolver::Solve | +( | +const MPSolverParameters & | +param | ) | ++ |
Solves the problem using the specified parameter values.
+ +| std::string operations_research::MPSolver::SolverVersion | +( | +) | +const | +
Returns a std::string describing the underlying solver and its version.
+ +
+
|
+ +static | +
Solves the model encoded by a MPModelRequest protocol buffer and fills the solution encoded as a MPSolutionResponse.
+Note(user): This creates a temporary MPSolver and destroys it at the end. If you want to keep the MPSolver alive (for debugging, or for incremental solving), you should write another version of this function that creates the MPSolver object on the heap and returns it.
+ +
+
|
+ +static | +
Whether the given problem type is supported (this will depend on the targets that you linked).
+ +| void operations_research::MPSolver::SuppressOutput | +( | +) | ++ |
Suppress output.
+ +
+
|
+ +inline | +
Definition at line 784 of file linear_solver.h.
+ +
+
|
+ +inline | +
Definition at line 794 of file linear_solver.h.
+ +
+
|
+ +inline | +
Definition at line 698 of file linear_solver.h.
+ +| void* operations_research::MPSolver::underlying_solver | +( | +) | ++ |
Advanced usage: returns the underlying solver.
+Returns the underlying solver so that the user can use solver-specific features or features that are not exposed in the simple API of MPSolver. This method is for advanced users, use at your own risk! In particular, if you modify the model or the solution by accessing the underlying solver directly, then the underlying solver will be out of sync with the information kept in the wrapper (MPSolver, MPVariable, MPConstraint, MPObjective). You need to cast the void* returned back to its original type that depends on the interface (CBC: OsiClpSolverInterface*, CLP: ClpSimplex*, GLPK: glp_prob*, SCIP: SCIP*).
+ +
+
|
+ +inline | +
Returns the array of variables handled by the MPSolver.
+(They are listed in the order in which they were created.)
+ +Definition at line 283 of file linear_solver.h.
+ +| bool operations_research::MPSolver::VerifySolution | +( | +double | +tolerance, | +
| + | + | bool | +log_errors | +
| + | ) | +const | +
Advanced usage: Verifies the correctness of the solution.
+It verifies that all variables must be within their domains, all constraints must be satisfied, and the reported objective value must be accurate.
+Usage:
Most users should just set the –verify_solution flag and not bother using this method directly.
+ +
+
|
+ +inline | +
Definition at line 799 of file linear_solver.h.
+ +| void operations_research::MPSolver::Write | +( | +const std::string & | +file_name | ) | ++ |
Writes the model using the solver internal write function.
+Currently only available for Gurobi.
+ +
+
|
+ +friend | +
Definition at line 812 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 805 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 804 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 808 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 811 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 803 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 807 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 814 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 810 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 813 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 806 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 809 of file linear_solver.h.
+ +Definition at line 1628 of file linear_solver.pb.h.
+Definition at line 1619 of file linear_solver.pb.h.
Public Types | |
| typedef MPSolverCommonParameters_LPAlgorithmValues | LPAlgorithmValues |
| nested types -------------------------------------------------— More... | |
@@ -85,7 +84,6 @@ Public Member Functions | |
| void | Swap (MPSolverCommonParameters *other) |
| MPSolverCommonParameters * | New () const final |
| implements Message -------------------------------------------— More... | |
| MPSolverCommonParameters * | New (::PROTOBUF_NAMESPACE_ID::Arena *arena) const final |
| ::PROTOBUF_NAMESPACE_ID::Metadata | GetMetadata () const final |
| bool | has_relative_mip_gap () const |
| accessors ----------------------------------------------------— More... | |
| void | clear_relative_mip_gap () |
| void | set_allocated_relative_mip_gap (::operations_research::OptionalDouble *relative_mip_gap) |
| bool | has_primal_tolerance () const |
| optional .operations_research.OptionalDouble primal_tolerance = 2; More... | |
| void | clear_primal_tolerance () |
| void | set_allocated_primal_tolerance (::operations_research::OptionalDouble *primal_tolerance) |
| bool | has_dual_tolerance () const |
| optional .operations_research.OptionalDouble dual_tolerance = 3; More... | |
| void | clear_dual_tolerance () |
| void | set_allocated_dual_tolerance (::operations_research::OptionalDouble *dual_tolerance) |
| bool | has_lp_algorithm () const |
| optional .operations_research.MPSolverCommonParameters.LPAlgorithmValues lp_algorithm = 4 [default = LP_ALGO_UNSPECIFIED]; More... | |
| void | clear_lp_algorithm () |
| void | set_lp_algorithm (::operations_research::MPSolverCommonParameters_LPAlgorithmValues value) |
| bool | has_presolve () const |
| optional .operations_research.OptionalBoolean presolve = 5 [default = BOOL_UNSPECIFIED]; More... | |
| void | clear_presolve () |
| void | set_presolve (::operations_research::OptionalBoolean value) |
| bool | has_scaling () const |
| optional .operations_research.OptionalBoolean scaling = 7 [default = BOOL_UNSPECIFIED]; More... | |
| void | clear_scaling () |
nested types -------------------------------------------------—
- -Definition at line 1742 of file linear_solver.pb.h.
+Definition at line 1733 of file linear_solver.pb.h.
Definition at line 1635 of file linear_solver.pb.h.
+Definition at line 1626 of file linear_solver.pb.h.
Definition at line 3362 of file linear_solver.pb.h.
+Definition at line 3341 of file linear_solver.pb.h.
Definition at line 3411 of file linear_solver.pb.h.
+Definition at line 3390 of file linear_solver.pb.h.
Definition at line 3430 of file linear_solver.pb.h.
+Definition at line 3409 of file linear_solver.pb.h.
Definition at line 3313 of file linear_solver.pb.h.
+Definition at line 3292 of file linear_solver.pb.h.
Definition at line 3264 of file linear_solver.pb.h.
+Definition at line 3243 of file linear_solver.pb.h.
Definition at line 3449 of file linear_solver.pb.h.
+Definition at line 3428 of file linear_solver.pb.h.
Definition at line 1660 of file linear_solver.pb.h.
+Definition at line 1651 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSolverCommonParameters.dual_tolerance)
-Definition at line 3366 of file linear_solver.pb.h.
+Definition at line 3345 of file linear_solver.pb.h.
Definition at line 1711 of file linear_solver.pb.h.
+Definition at line 1702 of file linear_solver.pb.h.
Definition at line 1663 of file linear_solver.pb.h.
+Definition at line 1654 of file linear_solver.pb.h.
Definition at line 1666 of file linear_solver.pb.h.
+Definition at line 1657 of file linear_solver.pb.h.
optional .operations_research.OptionalDouble dual_tolerance = 3;
- -Definition at line 3359 of file linear_solver.pb.h.
+Definition at line 3338 of file linear_solver.pb.h.
optional .operations_research.MPSolverCommonParameters.LPAlgorithmValues lp_algorithm = 4 [default = LP_ALGO_UNSPECIFIED];
- -Definition at line 3408 of file linear_solver.pb.h.
+Definition at line 3387 of file linear_solver.pb.h.
optional .operations_research.OptionalBoolean presolve = 5 [default = BOOL_UNSPECIFIED];
- -Definition at line 3427 of file linear_solver.pb.h.
+Definition at line 3406 of file linear_solver.pb.h.
optional .operations_research.OptionalDouble primal_tolerance = 2;
- -Definition at line 3310 of file linear_solver.pb.h.
+Definition at line 3289 of file linear_solver.pb.h.
accessors ----------------------------------------------------—
- -optional .operations_research.OptionalDouble relative_mip_gap = 1;
- -Definition at line 3261 of file linear_solver.pb.h.
+Definition at line 3240 of file linear_solver.pb.h.
optional .operations_research.OptionalBoolean scaling = 7 [default = BOOL_UNSPECIFIED];
- -Definition at line 3446 of file linear_solver.pb.h.
+Definition at line 3425 of file linear_solver.pb.h.
Definition at line 1672 of file linear_solver.pb.h.
+Definition at line 1663 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSolverCommonParameters.lp_algorithm)
-Definition at line 3415 of file linear_solver.pb.h.
+Definition at line 3394 of file linear_solver.pb.h.
Definition at line 1761 of file linear_solver.pb.h.
+Definition at line 1752 of file linear_solver.pb.h.
Definition at line 1751 of file linear_solver.pb.h.
+Definition at line 1742 of file linear_solver.pb.h.
Definition at line 1765 of file linear_solver.pb.h.
+Definition at line 1756 of file linear_solver.pb.h.
Definition at line 1771 of file linear_solver.pb.h.
+Definition at line 1762 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPSolverCommonParameters.dual_tolerance)
-Definition at line 3379 of file linear_solver.pb.h.
+Definition at line 3358 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPSolverCommonParameters.primal_tolerance)
-Definition at line 3330 of file linear_solver.pb.h.
+Definition at line 3309 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPSolverCommonParameters.relative_mip_gap)
-Definition at line 3281 of file linear_solver.pb.h.
+Definition at line 3260 of file linear_solver.pb.h.
Definition at line 1656 of file linear_solver.pb.h.
+Definition at line 1647 of file linear_solver.pb.h.
implements Message -------------------------------------------—
- -Definition at line 1686 of file linear_solver.pb.h.
+Definition at line 1677 of file linear_solver.pb.h.
Definition at line 1690 of file linear_solver.pb.h.
+Definition at line 1681 of file linear_solver.pb.h.
Definition at line 1640 of file linear_solver.pb.h.
+Definition at line 1631 of file linear_solver.pb.h.
Definition at line 1644 of file linear_solver.pb.h.
+Definition at line 1635 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSolverCommonParameters.presolve)
-Definition at line 3434 of file linear_solver.pb.h.
+Definition at line 3413 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSolverCommonParameters.primal_tolerance)
-Definition at line 3317 of file linear_solver.pb.h.
+Definition at line 3296 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSolverCommonParameters.relative_mip_gap)
-Definition at line 3268 of file linear_solver.pb.h.
+Definition at line 3247 of file linear_solver.pb.h.
@protoc_insertion_point(field_release:operations_research.MPSolverCommonParameters.dual_tolerance)
-Definition at line 3372 of file linear_solver.pb.h.
+Definition at line 3351 of file linear_solver.pb.h.
@protoc_insertion_point(field_release:operations_research.MPSolverCommonParameters.primal_tolerance)
-Definition at line 3323 of file linear_solver.pb.h.
+Definition at line 3302 of file linear_solver.pb.h.
@protoc_insertion_point(field_release:operations_research.MPSolverCommonParameters.relative_mip_gap)
-Definition at line 3274 of file linear_solver.pb.h.
+Definition at line 3253 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSolverCommonParameters.scaling)
-Definition at line 3453 of file linear_solver.pb.h.
+Definition at line 3432 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_allocated:operations_research.MPSolverCommonParameters.dual_tolerance)
-Definition at line 3388 of file linear_solver.pb.h.
+Definition at line 3367 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_allocated:operations_research.MPSolverCommonParameters.primal_tolerance)
-Definition at line 3339 of file linear_solver.pb.h.
+Definition at line 3318 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_allocated:operations_research.MPSolverCommonParameters.relative_mip_gap)
-Definition at line 3290 of file linear_solver.pb.h.
+Definition at line 3269 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPSolverCommonParameters.lp_algorithm)
-Definition at line 3419 of file linear_solver.pb.h.
+Definition at line 3398 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPSolverCommonParameters.presolve)
-Definition at line 3438 of file linear_solver.pb.h.
+Definition at line 3417 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPSolverCommonParameters.scaling)
-Definition at line 3457 of file linear_solver.pb.h.
+Definition at line 3436 of file linear_solver.pb.h.
Definition at line 1653 of file linear_solver.pb.h.
+Definition at line 1644 of file linear_solver.pb.h.
Definition at line 1718 of file linear_solver.pb.h.
+Definition at line 1709 of file linear_solver.pb.h.
Definition at line 1839 of file linear_solver.pb.h.
+Definition at line 1830 of file linear_solver.pb.h.
Definition at line 1680 of file linear_solver.pb.h.
+Definition at line 1671 of file linear_solver.pb.h.
Definition at line 1799 of file linear_solver.pb.h.
+Definition at line 1790 of file linear_solver.pb.h.
Definition at line 1676 of file linear_solver.pb.h.
+Definition at line 1667 of file linear_solver.pb.h.
Definition at line 1808 of file linear_solver.pb.h.
+Definition at line 1799 of file linear_solver.pb.h.
Definition at line 1815 of file linear_solver.pb.h.
+Definition at line 1806 of file linear_solver.pb.h.
Definition at line 1790 of file linear_solver.pb.h.
+Definition at line 1781 of file linear_solver.pb.h.
Definition at line 1781 of file linear_solver.pb.h.
+Definition at line 1772 of file linear_solver.pb.h.
Definition at line 1822 of file linear_solver.pb.h.
+Definition at line 1813 of file linear_solver.pb.h.
Definition at line 1749 of file linear_solver.pb.h.
+Definition at line 1740 of file linear_solver.pb.h.
Definition at line 1745 of file linear_solver.pb.h.
+Definition at line 1736 of file linear_solver.pb.h.
Definition at line 1747 of file linear_solver.pb.h.
+Definition at line 1738 of file linear_solver.pb.h.
Definition at line 1743 of file linear_solver.pb.h.
+Definition at line 1734 of file linear_solver.pb.h.
Definition at line 1758 of file linear_solver.pb.h.
+Definition at line 1749 of file linear_solver.pb.h.
Definition at line 1756 of file linear_solver.pb.h.
+Definition at line 1747 of file linear_solver.pb.h.
Definition at line 1754 of file linear_solver.pb.h.
+Definition at line 1745 of file linear_solver.pb.h.
This is the complete list of members for operations_research::MPSolverInterface, including all inherited members.
+| AddIndicatorConstraint(MPConstraint *const ct) | operations_research::MPSolverInterface | inlinevirtual |
| AddRowConstraint(MPConstraint *const ct)=0 | operations_research::MPSolverInterface | pure virtual |
| AddVariable(MPVariable *const var)=0 | operations_research::MPSolverInterface | pure virtual |
| best_objective_bound() const =0 | operations_research::MPSolverInterface | pure virtual |
| BranchingPriorityChangedForVariable(int var_index) | operations_research::MPSolverInterface | inlinevirtual |
| CheckBestObjectiveBoundExists() const | operations_research::MPSolverInterface | virtual |
| CheckSolutionExists() const | operations_research::MPSolverInterface | virtual |
| CheckSolutionIsSynchronized() const | operations_research::MPSolverInterface | |
| CheckSolutionIsSynchronizedAndExists() const | operations_research::MPSolverInterface | inline |
| ClearConstraint(MPConstraint *const constraint)=0 | operations_research::MPSolverInterface | pure virtual |
| ClearObjective()=0 | operations_research::MPSolverInterface | pure virtual |
| column_status(int variable_index) const =0 | operations_research::MPSolverInterface | pure virtual |
| ComputeExactConditionNumber() const | operations_research::MPSolverInterface | virtual |
| constraint_is_extracted(int ct_index) const | operations_research::MPSolverInterface | inline |
| ExtractModel() | operations_research::MPSolverInterface | protected |
| ExtractNewConstraints()=0 | operations_research::MPSolverInterface | protectedpure virtual |
| ExtractNewVariables()=0 | operations_research::MPSolverInterface | protectedpure virtual |
| ExtractObjective()=0 | operations_research::MPSolverInterface | protectedpure virtual |
| InterruptSolve() | operations_research::MPSolverInterface | inlinevirtual |
| InvalidateSolutionSynchronization() | operations_research::MPSolverInterface | protected |
| IsContinuous() const =0 | operations_research::MPSolverInterface | pure virtual |
| IsLP() const =0 | operations_research::MPSolverInterface | pure virtual |
| IsMIP() const =0 | operations_research::MPSolverInterface | pure virtual |
| iterations() const =0 | operations_research::MPSolverInterface | pure virtual |
| kDummyVariableIndex | operations_research::MPSolverInterface | protectedstatic |
| kUnknownNumberOfIterations | operations_research::MPSolverInterface | static |
| kUnknownNumberOfNodes | operations_research::MPSolverInterface | static |
| last_constraint_index_ | operations_research::MPSolverInterface | protected |
| last_variable_index() const | operations_research::MPSolverInterface | inline |
| last_variable_index_ | operations_research::MPSolverInterface | protected |
| maximize_ | operations_research::MPSolverInterface | protected |
| MODEL_SYNCHRONIZED enum value | operations_research::MPSolverInterface | |
| MPConstraint class | operations_research::MPSolverInterface | friend |
| MPObjective class | operations_research::MPSolverInterface | friend |
| MPSolver class | operations_research::MPSolverInterface | friend |
| MPSolverInterface(MPSolver *const solver) | operations_research::MPSolverInterface | explicit |
| MUST_RELOAD enum value | operations_research::MPSolverInterface | |
| NextSolution() | operations_research::MPSolverInterface | inlinevirtual |
| nodes() const =0 | operations_research::MPSolverInterface | pure virtual |
| objective_value() const | operations_research::MPSolverInterface | |
| objective_value_ | operations_research::MPSolverInterface | protected |
| quiet() const | operations_research::MPSolverInterface | inline |
| quiet_ | operations_research::MPSolverInterface | protected |
| ReadParameterFile(const std::string &filename) | operations_research::MPSolverInterface | protectedvirtual |
| Reset()=0 | operations_research::MPSolverInterface | pure virtual |
| ResetExtractionInformation() | operations_research::MPSolverInterface | protected |
| result_status() const | operations_research::MPSolverInterface | inline |
| result_status_ | operations_research::MPSolverInterface | protected |
| row_status(int constraint_index) const =0 | operations_research::MPSolverInterface | pure virtual |
| set_constraint_as_extracted(int ct_index, bool extracted) | operations_research::MPSolverInterface | inline |
| set_quiet(bool quiet_value) | operations_research::MPSolverInterface | inline |
| set_variable_as_extracted(int var_index, bool extracted) | operations_research::MPSolverInterface | inline |
| SetCoefficient(MPConstraint *const constraint, const MPVariable *const variable, double new_value, double old_value)=0 | operations_research::MPSolverInterface | pure virtual |
| SetCommonParameters(const MPSolverParameters ¶m) | operations_research::MPSolverInterface | protected |
| SetConstraintBounds(int index, double lb, double ub)=0 | operations_research::MPSolverInterface | pure virtual |
| SetDoubleParamToUnsupportedValue(MPSolverParameters::DoubleParam param, double value) | operations_research::MPSolverInterface | protected |
| SetDualTolerance(double value)=0 | operations_research::MPSolverInterface | protectedpure virtual |
| SetIntegerParamToUnsupportedValue(MPSolverParameters::IntegerParam param, int value) | operations_research::MPSolverInterface | protectedvirtual |
| SetLpAlgorithm(int value)=0 | operations_research::MPSolverInterface | protectedpure virtual |
| SetMIPParameters(const MPSolverParameters ¶m) | operations_research::MPSolverInterface | protected |
| SetNumThreads(int num_threads) | operations_research::MPSolverInterface | protectedvirtual |
| SetObjectiveCoefficient(const MPVariable *const variable, double coefficient)=0 | operations_research::MPSolverInterface | pure virtual |
| SetObjectiveOffset(double value)=0 | operations_research::MPSolverInterface | pure virtual |
| SetOptimizationDirection(bool maximize)=0 | operations_research::MPSolverInterface | pure virtual |
| SetParameters(const MPSolverParameters ¶m)=0 | operations_research::MPSolverInterface | protectedpure virtual |
| SetPresolveMode(int value)=0 | operations_research::MPSolverInterface | protectedpure virtual |
| SetPrimalTolerance(double value)=0 | operations_research::MPSolverInterface | protectedpure virtual |
| SetRelativeMipGap(double value)=0 | operations_research::MPSolverInterface | protectedpure virtual |
| SetScalingMode(int value)=0 | operations_research::MPSolverInterface | protectedpure virtual |
| SetSolverSpecificParametersAsString(const std::string ¶meters) | operations_research::MPSolverInterface | protectedvirtual |
| SetStartingLpBasis(const std::vector< MPSolver::BasisStatus > &variable_statuses, const std::vector< MPSolver::BasisStatus > &constraint_statuses) | operations_research::MPSolverInterface | inlinevirtual |
| SetUnsupportedDoubleParam(MPSolverParameters::DoubleParam param) | operations_research::MPSolverInterface | protected |
| SetUnsupportedIntegerParam(MPSolverParameters::IntegerParam param) | operations_research::MPSolverInterface | protectedvirtual |
| SetVariableBounds(int index, double lb, double ub)=0 | operations_research::MPSolverInterface | pure virtual |
| SetVariableInteger(int index, bool integer)=0 | operations_research::MPSolverInterface | pure virtual |
| SOLUTION_SYNCHRONIZED enum value | operations_research::MPSolverInterface | |
| Solve(const MPSolverParameters ¶m)=0 | operations_research::MPSolverInterface | pure virtual |
| solver_ | operations_research::MPSolverInterface | protected |
| SolverVersion() const =0 | operations_research::MPSolverInterface | pure virtual |
| sync_status_ | operations_research::MPSolverInterface | protected |
| SynchronizationStatus enum name | operations_research::MPSolverInterface | |
| trivial_worst_objective_bound() const | operations_research::MPSolverInterface | |
| underlying_solver()=0 | operations_research::MPSolverInterface | pure virtual |
| ValidFileExtensionForParameterFile() const | operations_research::MPSolverInterface | protectedvirtual |
| variable_is_extracted(int var_index) const | operations_research::MPSolverInterface | inline |
| Write(const std::string &filename) | operations_research::MPSolverInterface | virtual |
| ~MPSolverInterface() | operations_research::MPSolverInterface | virtual |
Definition at line 1592 of file linear_solver.h.
++Public Types | |
| enum | SynchronizationStatus { MUST_RELOAD, +MODEL_SYNCHRONIZED, +SOLUTION_SYNCHRONIZED + } |
+Public Member Functions | |
| MPSolverInterface (MPSolver *const solver) | |
| virtual | ~MPSolverInterface () |
| virtual MPSolver::ResultStatus | Solve (const MPSolverParameters ¶m)=0 |
| virtual void | Write (const std::string &filename) |
| virtual void | Reset ()=0 |
| virtual void | SetOptimizationDirection (bool maximize)=0 |
| virtual void | SetVariableBounds (int index, double lb, double ub)=0 |
| virtual void | SetVariableInteger (int index, bool integer)=0 |
| virtual void | SetConstraintBounds (int index, double lb, double ub)=0 |
| virtual void | AddRowConstraint (MPConstraint *const ct)=0 |
| virtual bool | AddIndicatorConstraint (MPConstraint *const ct) |
| virtual void | AddVariable (MPVariable *const var)=0 |
| virtual void | SetCoefficient (MPConstraint *const constraint, const MPVariable *const variable, double new_value, double old_value)=0 |
| virtual void | ClearConstraint (MPConstraint *const constraint)=0 |
| virtual void | SetObjectiveCoefficient (const MPVariable *const variable, double coefficient)=0 |
| virtual void | SetObjectiveOffset (double value)=0 |
| virtual void | ClearObjective ()=0 |
| virtual void | BranchingPriorityChangedForVariable (int var_index) |
| virtual int64 | iterations () const =0 |
| virtual int64 | nodes () const =0 |
| virtual double | best_objective_bound () const =0 |
| double | trivial_worst_objective_bound () const |
| double | objective_value () const |
| virtual MPSolver::BasisStatus | row_status (int constraint_index) const =0 |
| virtual MPSolver::BasisStatus | column_status (int variable_index) const =0 |
| bool | CheckSolutionIsSynchronized () const |
| virtual bool | CheckSolutionExists () const |
| bool | CheckSolutionIsSynchronizedAndExists () const |
| virtual bool | CheckBestObjectiveBoundExists () const |
| virtual bool | IsContinuous () const =0 |
| virtual bool | IsLP () const =0 |
| virtual bool | IsMIP () const =0 |
| int | last_variable_index () const |
| bool | variable_is_extracted (int var_index) const |
| void | set_variable_as_extracted (int var_index, bool extracted) |
| bool | constraint_is_extracted (int ct_index) const |
| void | set_constraint_as_extracted (int ct_index, bool extracted) |
| bool | quiet () const |
| void | set_quiet (bool quiet_value) |
| MPSolver::ResultStatus | result_status () const |
| virtual std::string | SolverVersion () const =0 |
| virtual void * | underlying_solver ()=0 |
| virtual double | ComputeExactConditionNumber () const |
| virtual void | SetStartingLpBasis (const std::vector< MPSolver::BasisStatus > &variable_statuses, const std::vector< MPSolver::BasisStatus > &constraint_statuses) |
| virtual bool | InterruptSolve () |
| virtual bool | NextSolution () |
+Static Public Attributes | |
| static const int64 | kUnknownNumberOfIterations = -1 |
| static const int64 | kUnknownNumberOfNodes = -1 |
+Protected Member Functions | |
| void | ExtractModel () |
| virtual void | ExtractNewVariables ()=0 |
| virtual void | ExtractNewConstraints ()=0 |
| virtual void | ExtractObjective ()=0 |
| void | ResetExtractionInformation () |
| void | InvalidateSolutionSynchronization () |
| void | SetCommonParameters (const MPSolverParameters ¶m) |
| void | SetMIPParameters (const MPSolverParameters ¶m) |
| virtual void | SetParameters (const MPSolverParameters ¶m)=0 |
| void | SetUnsupportedDoubleParam (MPSolverParameters::DoubleParam param) |
| virtual void | SetUnsupportedIntegerParam (MPSolverParameters::IntegerParam param) |
| void | SetDoubleParamToUnsupportedValue (MPSolverParameters::DoubleParam param, double value) |
| virtual void | SetIntegerParamToUnsupportedValue (MPSolverParameters::IntegerParam param, int value) |
| virtual void | SetRelativeMipGap (double value)=0 |
| virtual void | SetPrimalTolerance (double value)=0 |
| virtual void | SetDualTolerance (double value)=0 |
| virtual void | SetPresolveMode (int value)=0 |
| virtual util::Status | SetNumThreads (int num_threads) |
| virtual bool | SetSolverSpecificParametersAsString (const std::string ¶meters) |
| virtual bool | ReadParameterFile (const std::string &filename) |
| virtual std::string | ValidFileExtensionForParameterFile () const |
| virtual void | SetScalingMode (int value)=0 |
| virtual void | SetLpAlgorithm (int value)=0 |
+Protected Attributes | |
| MPSolver *const | solver_ |
| SynchronizationStatus | sync_status_ |
| MPSolver::ResultStatus | result_status_ |
| bool | maximize_ |
| int | last_constraint_index_ |
| int | last_variable_index_ |
| double | objective_value_ |
| bool | quiet_ |
+Static Protected Attributes | |
| static const int | kDummyVariableIndex |
+Friends | |
| class | MPSolver |
| class | MPConstraint |
| class | MPObjective |
| enum operations_research::MPSolverInterface::SynchronizationStatus | +
| Enumerator | |
|---|---|
| MUST_RELOAD | |
| MODEL_SYNCHRONIZED | |
| SOLUTION_SYNCHRONIZED | |
Definition at line 1594 of file linear_solver.h.
+ +
+
|
+ +explicit | +
+
|
+ +virtual | +
+
|
+ +inlinevirtual | +
Definition at line 1649 of file linear_solver.h.
+ +
+
|
+ +pure virtual | +
+
|
+ +pure virtual | +
+
|
+ +pure virtual | +
+
|
+ +inlinevirtual | +
Definition at line 1675 of file linear_solver.h.
+ +
+
|
+ +virtual | +
+
|
+ +virtual | +
| bool operations_research::MPSolverInterface::CheckSolutionIsSynchronized | +( | +) | +const | +
+
|
+ +inline | +
Definition at line 1705 of file linear_solver.h.
+ +
+
|
+ +pure virtual | +
+
|
+ +pure virtual | +
+
|
+ +pure virtual | +
+
|
+ +virtual | +
+
|
+ +inline | +
Definition at line 1734 of file linear_solver.h.
+ +
+
|
+ +protected | +
+
|
+ +protectedpure virtual | +
+
|
+ +protectedpure virtual | +
+
|
+ +protectedpure virtual | +
+
|
+ +inlinevirtual | +
Definition at line 1769 of file linear_solver.h.
+ +
+
|
+ +protected | +
+
|
+ +pure virtual | +
+
|
+ +pure virtual | +
+
|
+ +pure virtual | +
+
|
+ +pure virtual | +
+
|
+ +inline | +
Definition at line 1726 of file linear_solver.h.
+ +
+
|
+ +inlinevirtual | +
Definition at line 1772 of file linear_solver.h.
+ +
+
|
+ +pure virtual | +
| double operations_research::MPSolverInterface::objective_value | +( | +) | +const | +
+
|
+ +inline | +
Definition at line 1742 of file linear_solver.h.
+ +
+
|
+ +protectedvirtual | +
+
|
+ +pure virtual | +
+
|
+ +protected | +
+
|
+ +inline | +
Definition at line 1747 of file linear_solver.h.
+ +
+
|
+ +pure virtual | +
+
|
+ +inline | +
Definition at line 1737 of file linear_solver.h.
+ +
+
|
+ +inline | +
Definition at line 1744 of file linear_solver.h.
+ +
+
|
+ +inline | +
Definition at line 1731 of file linear_solver.h.
+ +
+
|
+ +pure virtual | +
+
|
+ +protected | +
+
|
+ +pure virtual | +
+
|
+ +protected | +
+
|
+ +protectedpure virtual | +
+
|
+ +protectedvirtual | +
+
|
+ +protectedpure virtual | +
+
|
+ +protected | +
+
|
+ +protectedvirtual | +
+
|
+ +pure virtual | +
+
|
+ +pure virtual | +
+
|
+ +pure virtual | +
+
|
+ +protectedpure virtual | +
+
|
+ +protectedpure virtual | +
+
|
+ +protectedpure virtual | +
+
|
+ +protectedpure virtual | +
+
|
+ +protectedpure virtual | +
+
|
+ +protectedvirtual | +
+
|
+ +inlinevirtual | +
Definition at line 1763 of file linear_solver.h.
+ +
+
|
+ +protected | +
+
|
+ +protectedvirtual | +
+
|
+ +pure virtual | +
+
|
+ +pure virtual | +
+
|
+ +pure virtual | +
+
|
+ +pure virtual | +
| double operations_research::MPSolverInterface::trivial_worst_objective_bound | +( | +) | +const | +
+
|
+ +pure virtual | +
+
|
+ +protectedvirtual | +
+
|
+ +inline | +
Definition at line 1728 of file linear_solver.h.
+ +
+
|
+ +virtual | +
+
|
+ +friend | +
Definition at line 1777 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1778 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1774 of file linear_solver.h.
+ +
+
|
+ +staticprotected | +
Definition at line 1803 of file linear_solver.h.
+ +
+
|
+ +static | +
Definition at line 1609 of file linear_solver.h.
+ +
+
|
+ +static | +
Definition at line 1612 of file linear_solver.h.
+ +
+
|
+ +protected | +
Definition at line 1791 of file linear_solver.h.
+ +
+
|
+ +protected | +
Definition at line 1793 of file linear_solver.h.
+ +
+
|
+ +protected | +
Definition at line 1788 of file linear_solver.h.
+ +
+
|
+ +protected | +
Definition at line 1796 of file linear_solver.h.
+ +
+
|
+ +protected | +
Definition at line 1799 of file linear_solver.h.
+ +
+
|
+ +protected | +
Definition at line 1786 of file linear_solver.h.
+ +
+
|
+ +protected | +
Definition at line 1781 of file linear_solver.h.
+ +
+
|
+ +protected | +
Definition at line 1783 of file linear_solver.h.
+ +This is the complete list of members for operations_research::MPSolverParameters, including all inherited members.
+| BARRIER enum value | operations_research::MPSolverParameters | |
| DoubleParam enum name | operations_research::MPSolverParameters | |
| DUAL enum value | operations_research::MPSolverParameters | |
| DUAL_TOLERANCE enum value | operations_research::MPSolverParameters | |
| GetDoubleParam(MPSolverParameters::DoubleParam param) const | operations_research::MPSolverParameters | |
| GetIntegerParam(MPSolverParameters::IntegerParam param) const | operations_research::MPSolverParameters | |
| INCREMENTALITY enum value | operations_research::MPSolverParameters | |
| INCREMENTALITY_OFF enum value | operations_research::MPSolverParameters | |
| INCREMENTALITY_ON enum value | operations_research::MPSolverParameters | |
| IncrementalityValues enum name | operations_research::MPSolverParameters | |
| IntegerParam enum name | operations_research::MPSolverParameters | |
| kDefaultDoubleParamValue | operations_research::MPSolverParameters | static |
| kDefaultDualTolerance | operations_research::MPSolverParameters | static |
| kDefaultIncrementality | operations_research::MPSolverParameters | static |
| kDefaultIntegerParamValue | operations_research::MPSolverParameters | static |
| kDefaultPresolve | operations_research::MPSolverParameters | static |
| kDefaultPrimalTolerance | operations_research::MPSolverParameters | static |
| kDefaultRelativeMipGap | operations_research::MPSolverParameters | static |
| kUnknownDoubleParamValue | operations_research::MPSolverParameters | static |
| kUnknownIntegerParamValue | operations_research::MPSolverParameters | static |
| LP_ALGORITHM enum value | operations_research::MPSolverParameters | |
| LpAlgorithmValues enum name | operations_research::MPSolverParameters | |
| MPSolverParameters() | operations_research::MPSolverParameters | |
| PRESOLVE enum value | operations_research::MPSolverParameters | |
| PRESOLVE_OFF enum value | operations_research::MPSolverParameters | |
| PRESOLVE_ON enum value | operations_research::MPSolverParameters | |
| PresolveValues enum name | operations_research::MPSolverParameters | |
| PRIMAL enum value | operations_research::MPSolverParameters | |
| PRIMAL_TOLERANCE enum value | operations_research::MPSolverParameters | |
| RELATIVE_MIP_GAP enum value | operations_research::MPSolverParameters | |
| Reset() | operations_research::MPSolverParameters | |
| ResetDoubleParam(MPSolverParameters::DoubleParam param) | operations_research::MPSolverParameters | |
| ResetIntegerParam(MPSolverParameters::IntegerParam param) | operations_research::MPSolverParameters | |
| SCALING enum value | operations_research::MPSolverParameters | |
| SCALING_OFF enum value | operations_research::MPSolverParameters | |
| SCALING_ON enum value | operations_research::MPSolverParameters | |
| ScalingValues enum name | operations_research::MPSolverParameters | |
| SetDoubleParam(MPSolverParameters::DoubleParam param, double value) | operations_research::MPSolverParameters | |
| SetIntegerParam(MPSolverParameters::IntegerParam param, int value) | operations_research::MPSolverParameters |
This class stores parameter settings for LP and MIP solvers.
+Some parameters are marked as advanced: do not change their values unless you know what you are doing!
+For developers: how to add a new parameter:
TODO(user): store the parameter values in a protocol buffer instead. We need to figure out how to deal with the subtleties of the default values.
+ +Definition at line 1405 of file linear_solver.h.
++Public Types | |
| enum | DoubleParam { RELATIVE_MIP_GAP = 0, +PRIMAL_TOLERANCE = 1, +DUAL_TOLERANCE = 2 + } |
| Enumeration of parameters that take continuous values. More... | |
| enum | IntegerParam { PRESOLVE = 1000, +LP_ALGORITHM = 1001, +INCREMENTALITY = 1002, +SCALING = 1003 + } |
| Enumeration of parameters that take integer or categorical values. More... | |
| enum | PresolveValues { PRESOLVE_OFF = 0, +PRESOLVE_ON = 1 + } |
| For each categorical parameter, enumeration of possible values. More... | |
| enum | LpAlgorithmValues { DUAL = 10, +PRIMAL = 11, +BARRIER = 12 + } |
| LP algorithm to use. More... | |
| enum | IncrementalityValues { INCREMENTALITY_OFF = 0, +INCREMENTALITY_ON = 1 + } |
| Advanced usage: Incrementality options. More... | |
| enum | ScalingValues { SCALING_OFF = 0, +SCALING_ON = 1 + } |
| Advanced usage: Scaling options. More... | |
+Public Member Functions | |
| MPSolverParameters () | |
| The constructor sets all parameters to their default value. More... | |
| void | SetDoubleParam (MPSolverParameters::DoubleParam param, double value) |
| Sets a double parameter to a specific value. More... | |
| void | SetIntegerParam (MPSolverParameters::IntegerParam param, int value) |
| Sets a integer parameter to a specific value. More... | |
| void | ResetDoubleParam (MPSolverParameters::DoubleParam param) |
| Sets a double parameter to its default value (default value defined in MPSolverParameters if it exists, otherwise the default value defined in the underlying solver). More... | |
| void | ResetIntegerParam (MPSolverParameters::IntegerParam param) |
| Sets an integer parameter to its default value (default value defined in MPSolverParameters if it exists, otherwise the default value defined in the underlying solver). More... | |
| void | Reset () |
| Sets all parameters to their default value. More... | |
| double | GetDoubleParam (MPSolverParameters::DoubleParam param) const |
| Returns the value of a double parameter. More... | |
| int | GetIntegerParam (MPSolverParameters::IntegerParam param) const |
| Returns the value of an integer parameter. More... | |
+Static Public Attributes | |
| static const double | kDefaultDoubleParamValue |
| static const int | kDefaultIntegerParamValue |
| static const double | kUnknownDoubleParamValue |
| static const int | kUnknownIntegerParamValue |
| static const double | kDefaultRelativeMipGap |
| static const double | kDefaultPrimalTolerance |
| static const double | kDefaultDualTolerance |
| static const PresolveValues | kDefaultPresolve |
| static const IncrementalityValues | kDefaultIncrementality |
| enum operations_research::MPSolverParameters::DoubleParam | +
Enumeration of parameters that take continuous values.
+| Enumerator | |
|---|---|
| RELATIVE_MIP_GAP | Limit for relative MIP gap. + |
| PRIMAL_TOLERANCE | Advanced usage: tolerance for primal feasibility of basic solutions. +This does not control the integer feasibility tolerance of integer + solutions for MIP or the tolerance used during presolve. + |
| DUAL_TOLERANCE | Advanced usage: tolerance for dual feasibility of basic solutions. + |
Definition at line 1410 of file linear_solver.h.
+ +| enum operations_research::MPSolverParameters::IncrementalityValues | +
Advanced usage: Incrementality options.
+| Enumerator | |
|---|---|
| INCREMENTALITY_OFF | Start solve from scratch. + |
| INCREMENTALITY_ON | Reuse results from previous solve as much as the underlying solver allows. + |
Definition at line 1470 of file linear_solver.h.
+ +| enum operations_research::MPSolverParameters::IntegerParam | +
Enumeration of parameters that take integer or categorical values.
+| Enumerator | |
|---|---|
| PRESOLVE | Advanced usage: presolve mode. + |
| LP_ALGORITHM | Algorithm to solve linear programs. + |
| INCREMENTALITY | Advanced usage: incrementality from one solve to the next. + |
| SCALING | Advanced usage: enable or disable matrix scaling. + |
Definition at line 1431 of file linear_solver.h.
+ +| enum operations_research::MPSolverParameters::LpAlgorithmValues | +
LP algorithm to use.
+| Enumerator | |
|---|---|
| DUAL | |
| PRIMAL | |
| BARRIER | |
Definition at line 1461 of file linear_solver.h.
+ +| enum operations_research::MPSolverParameters::PresolveValues | +
For each categorical parameter, enumeration of possible values.
+| Enumerator | |
|---|---|
| PRESOLVE_OFF | |
| PRESOLVE_ON | |
Definition at line 1453 of file linear_solver.h.
+ +| enum operations_research::MPSolverParameters::ScalingValues | +
Advanced usage: Scaling options.
+| Enumerator | |
|---|---|
| SCALING_OFF | Scaling is off. + |
| SCALING_ON | Scaling is on. + |
Definition at line 1486 of file linear_solver.h.
+ +| operations_research::MPSolverParameters::MPSolverParameters | +( | +) | ++ |
The constructor sets all parameters to their default value.
+ +| double operations_research::MPSolverParameters::GetDoubleParam | +( | +MPSolverParameters::DoubleParam | +param | ) | +const | +
Returns the value of a double parameter.
+ +| int operations_research::MPSolverParameters::GetIntegerParam | +( | +MPSolverParameters::IntegerParam | +param | ) | +const | +
Returns the value of an integer parameter.
+ +| void operations_research::MPSolverParameters::Reset | +( | +) | ++ |
Sets all parameters to their default value.
+ +| void operations_research::MPSolverParameters::ResetDoubleParam | +( | +MPSolverParameters::DoubleParam | +param | ) | ++ |
Sets a double parameter to its default value (default value defined in MPSolverParameters if it exists, otherwise the default value defined in the underlying solver).
+ +| void operations_research::MPSolverParameters::ResetIntegerParam | +( | +MPSolverParameters::IntegerParam | +param | ) | ++ |
Sets an integer parameter to its default value (default value defined in MPSolverParameters if it exists, otherwise the default value defined in the underlying solver).
+ +| void operations_research::MPSolverParameters::SetDoubleParam | +( | +MPSolverParameters::DoubleParam | +param, | +
| + | + | double | +value | +
| + | ) | ++ |
Sets a double parameter to a specific value.
+ +| void operations_research::MPSolverParameters::SetIntegerParam | +( | +MPSolverParameters::IntegerParam | +param, | +
| + | + | int | +value | +
| + | ) | ++ |
Sets a integer parameter to a specific value.
+ +
+
|
+ +static | +
Definition at line 1496 of file linear_solver.h.
+ +
+
|
+ +static | +
Definition at line 1514 of file linear_solver.h.
+ +
+
|
+ +static | +
Definition at line 1516 of file linear_solver.h.
+ +
+
|
+ +static | +
Definition at line 1497 of file linear_solver.h.
+ +
+
|
+ +static | +
Definition at line 1515 of file linear_solver.h.
+ +
+
|
+ +static | +
Definition at line 1513 of file linear_solver.h.
+ +
+
|
+ +static | +
Definition at line 1512 of file linear_solver.h.
+ +
+
|
+ +static | +
Definition at line 1502 of file linear_solver.h.
+ +
+
|
+ +static | +
Definition at line 1503 of file linear_solver.h.
+ +Definition at line 937 of file linear_solver.pb.h.
+Definition at line 932 of file linear_solver.pb.h.
Public Types | |
| typedef MPSosConstraint_Type | Type |
| nested types -------------------------------------------------— More... | |
@@ -85,7 +84,6 @@ Public Member Functions | |
| void | Swap (MPSosConstraint *other) |
| MPSosConstraint * | New () const final |
| implements Message -------------------------------------------— More... | |
| MPSosConstraint * | New (::PROTOBUF_NAMESPACE_ID::Arena *arena) const final |
| ::PROTOBUF_NAMESPACE_ID::Metadata | GetMetadata () const final |
| int | var_index_size () const |
| accessors ----------------------------------------------------— More... | |
| void | clear_var_index () |
| ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int32 > * | mutable_var_index () |
| int | weight_size () const |
| repeated double weight = 3; More... | |
| void | clear_weight () |
| ::PROTOBUF_NAMESPACE_ID::RepeatedField< double > * | mutable_weight () |
| bool | has_type () const |
| optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT]; More... | |
| void | clear_type () |
nested types -------------------------------------------------—
- -Definition at line 1051 of file linear_solver.pb.h.
+Definition at line 1046 of file linear_solver.pb.h.
Definition at line 944 of file linear_solver.pb.h.
+Definition at line 939 of file linear_solver.pb.h.
@protoc_insertion_point(field_add:operations_research.MPSosConstraint.var_index)
-Definition at line 2884 of file linear_solver.pb.h.
+Definition at line 2867 of file linear_solver.pb.h.
@protoc_insertion_point(field_add:operations_research.MPSosConstraint.weight)
-Definition at line 2914 of file linear_solver.pb.h.
+Definition at line 2897 of file linear_solver.pb.h.
Definition at line 2854 of file linear_solver.pb.h.
+Definition at line 2837 of file linear_solver.pb.h.
Definition at line 2873 of file linear_solver.pb.h.
+Definition at line 2856 of file linear_solver.pb.h.
Definition at line 2903 of file linear_solver.pb.h.
+Definition at line 2886 of file linear_solver.pb.h.
Definition at line 969 of file linear_solver.pb.h.
+Definition at line 964 of file linear_solver.pb.h.
Definition at line 1020 of file linear_solver.pb.h.
+Definition at line 1015 of file linear_solver.pb.h.
Definition at line 972 of file linear_solver.pb.h.
+Definition at line 967 of file linear_solver.pb.h.
Definition at line 975 of file linear_solver.pb.h.
+Definition at line 970 of file linear_solver.pb.h.
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];
- -optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];
- -Definition at line 2851 of file linear_solver.pb.h.
+Definition at line 2834 of file linear_solver.pb.h.
Definition at line 981 of file linear_solver.pb.h.
+Definition at line 976 of file linear_solver.pb.h.
Definition at line 965 of file linear_solver.pb.h.
+Definition at line 960 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable_list:operations_research.MPSosConstraint.var_index)
-Definition at line 2894 of file linear_solver.pb.h.
+Definition at line 2877 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable_list:operations_research.MPSosConstraint.weight)
-Definition at line 2924 of file linear_solver.pb.h.
+Definition at line 2907 of file linear_solver.pb.h.
implements Message -------------------------------------------—
- -Definition at line 995 of file linear_solver.pb.h.
+Definition at line 990 of file linear_solver.pb.h.
Definition at line 999 of file linear_solver.pb.h.
+Definition at line 994 of file linear_solver.pb.h.
Definition at line 949 of file linear_solver.pb.h.
+Definition at line 944 of file linear_solver.pb.h.
Definition at line 953 of file linear_solver.pb.h.
+Definition at line 948 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPSosConstraint.type)
-Definition at line 2862 of file linear_solver.pb.h.
+Definition at line 2845 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPSosConstraint.var_index)
-Definition at line 2880 of file linear_solver.pb.h.
+Definition at line 2863 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPSosConstraint.weight)
-Definition at line 2910 of file linear_solver.pb.h.
+Definition at line 2893 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSosConstraint.type)
-Definition at line 2858 of file linear_solver.pb.h.
+Definition at line 2841 of file linear_solver.pb.h.
Definition at line 1066 of file linear_solver.pb.h.
+Definition at line 1061 of file linear_solver.pb.h.
Definition at line 1056 of file linear_solver.pb.h.
+Definition at line 1051 of file linear_solver.pb.h.
Definition at line 1070 of file linear_solver.pb.h.
+Definition at line 1065 of file linear_solver.pb.h.
Definition at line 1076 of file linear_solver.pb.h.
+Definition at line 1071 of file linear_solver.pb.h.
Definition at line 962 of file linear_solver.pb.h.
+Definition at line 957 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSosConstraint.var_index)
-Definition at line 2876 of file linear_solver.pb.h.
+Definition at line 2859 of file linear_solver.pb.h.
@protoc_insertion_point(field_list:operations_research.MPSosConstraint.var_index)
-Definition at line 2889 of file linear_solver.pb.h.
+Definition at line 2872 of file linear_solver.pb.h.
accessors ----------------------------------------------------—
-repeated int32 var_index = 2;
- -Definition at line 2870 of file linear_solver.pb.h.
+Definition at line 2853 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPSosConstraint.weight)
-Definition at line 2906 of file linear_solver.pb.h.
+Definition at line 2889 of file linear_solver.pb.h.
@protoc_insertion_point(field_list:operations_research.MPSosConstraint.weight)
-Definition at line 2919 of file linear_solver.pb.h.
+Definition at line 2902 of file linear_solver.pb.h.
repeated double weight = 3;
- -Definition at line 2900 of file linear_solver.pb.h.
+Definition at line 2883 of file linear_solver.pb.h.
Definition at line 1027 of file linear_solver.pb.h.
+Definition at line 1022 of file linear_solver.pb.h.
Definition at line 1124 of file linear_solver.pb.h.
+Definition at line 1119 of file linear_solver.pb.h.
Definition at line 989 of file linear_solver.pb.h.
+Definition at line 984 of file linear_solver.pb.h.
Definition at line 985 of file linear_solver.pb.h.
+Definition at line 980 of file linear_solver.pb.h.
Definition at line 1110 of file linear_solver.pb.h.
+Definition at line 1105 of file linear_solver.pb.h.
Definition at line 1086 of file linear_solver.pb.h.
+Definition at line 1081 of file linear_solver.pb.h.
Definition at line 1098 of file linear_solver.pb.h.
+Definition at line 1093 of file linear_solver.pb.h.
Definition at line 1052 of file linear_solver.pb.h.
+Definition at line 1047 of file linear_solver.pb.h.
Definition at line 1054 of file linear_solver.pb.h.
+Definition at line 1049 of file linear_solver.pb.h.
Definition at line 1063 of file linear_solver.pb.h.
+Definition at line 1058 of file linear_solver.pb.h.
Definition at line 1061 of file linear_solver.pb.h.
+Definition at line 1056 of file linear_solver.pb.h.
Definition at line 1059 of file linear_solver.pb.h.
+Definition at line 1054 of file linear_solver.pb.h.
This is the complete list of members for operations_research::MPVariable, including all inherited members.
+| basis_status() const | operations_research::MPVariable | |
| BopInterface class | operations_research::MPVariable | friend |
| branching_priority() const | operations_research::MPVariable | inline |
| CBCInterface class | operations_research::MPVariable | friend |
| CLPInterface class | operations_research::MPVariable | friend |
| CplexInterface class | operations_research::MPVariable | friend |
| GLOPInterface class | operations_research::MPVariable | friend |
| GLPKInterface class | operations_research::MPVariable | friend |
| GurobiInterface class | operations_research::MPVariable | friend |
| index() const | operations_research::MPVariable | inline |
| integer() const | operations_research::MPVariable | inline |
| KnapsackInterface class | operations_research::MPVariable | friend |
| lb() const | operations_research::MPVariable | inline |
| MPSolver class | operations_research::MPVariable | friend |
| MPSolverInterface class | operations_research::MPVariable | friend |
| MPVariable(int index, double lb, double ub, bool integer, const std::string &name, MPSolverInterface *const interface_in) | operations_research::MPVariable | inlineprotected |
| MPVariableSolutionValueTest class | operations_research::MPVariable | friend |
| name() const | operations_research::MPVariable | inline |
| reduced_cost() const | operations_research::MPVariable | |
| SatInterface class | operations_research::MPVariable | friend |
| SCIPInterface class | operations_research::MPVariable | friend |
| set_reduced_cost(double reduced_cost) | operations_research::MPVariable | inlineprotected |
| set_solution_value(double value) | operations_research::MPVariable | inlineprotected |
| SetBounds(double lb, double ub) | operations_research::MPVariable | |
| SetBranchingPriority(int priority) | operations_research::MPVariable | |
| SetInteger(bool integer) | operations_research::MPVariable | |
| SetLB(double lb) | operations_research::MPVariable | inline |
| SetUB(double ub) | operations_research::MPVariable | inline |
| SLMInterface class | operations_research::MPVariable | friend |
| solution_value() const | operations_research::MPVariable | |
| ub() const | operations_research::MPVariable | inline |
| unrounded_solution_value() const | operations_research::MPVariable |
The class for variables of a Mathematical Programming (MP) model.
+ +Definition at line 1066 of file linear_solver.h.
++Public Member Functions | |
| const std::string & | name () const |
| Returns the name of the variable. More... | |
| void | SetInteger (bool integer) |
| Sets the integrality requirement of the variable. More... | |
| bool | integer () const |
| Returns the integrality requirement of the variable. More... | |
| double | solution_value () const |
| Returns the value of the variable in the current solution. More... | |
| int | index () const |
| Returns the index of the variable in the MPSolver::variables_. More... | |
| double | lb () const |
| Returns the lower bound. More... | |
| double | ub () const |
| Returns the upper bound. More... | |
| void | SetLB (double lb) |
| Sets the lower bound. More... | |
| void | SetUB (double ub) |
| Sets the upper bound. More... | |
| void | SetBounds (double lb, double ub) |
| Sets both the lower and upper bounds. More... | |
| double | unrounded_solution_value () const |
| Advanced usage: unrounded solution value. More... | |
| double | reduced_cost () const |
| Advanced usage: returns the reduced cost of the variable in the current solution (only available for continuous problems). More... | |
| MPSolver::BasisStatus | basis_status () const |
| Advanced usage: returns the basis status of the variable in the current solution (only available for continuous problems). More... | |
| int | branching_priority () const |
| Advanced usage: Certain MIP solvers (e.g. More... | |
| void | SetBranchingPriority (int priority) |
+Protected Member Functions | |
| MPVariable (int index, double lb, double ub, bool integer, const std::string &name, MPSolverInterface *const interface_in) | |
| void | set_solution_value (double value) |
| void | set_reduced_cost (double reduced_cost) |
+Friends | |
| class | MPSolver |
| class | MPSolverInterface |
| class | CBCInterface |
| class | CLPInterface |
| class | GLPKInterface |
| class | SCIPInterface |
| class | SLMInterface |
| class | GurobiInterface |
| class | CplexInterface |
| class | GLOPInterface |
| class | MPVariableSolutionValueTest |
| class | BopInterface |
| class | SatInterface |
| class | KnapsackInterface |
+
|
+ +inlineprotected | +
Definition at line 1174 of file linear_solver.h.
+ +| MPSolver::BasisStatus operations_research::MPVariable::basis_status | +( | +) | +const | +
Advanced usage: returns the basis status of the variable in the current solution (only available for continuous problems).
+
+
|
+ +inline | +
Advanced usage: Certain MIP solvers (e.g.
+Gurobi or SCIP) allow you to set a per-variable priority for determining which variable to branch on.
+A value of 0 is treated as default, and is equivalent to not setting the branching priority. The solver looks first to branch on fractional variables in higher priority levels. As of 2019-05, only Gurobi and SCIP support setting branching priority; all other solvers will simply ignore this annotation.
+ +Definition at line 1152 of file linear_solver.h.
+ +
+
|
+ +inline | +
Returns the index of the variable in the MPSolver::variables_.
+ +Definition at line 1095 of file linear_solver.h.
+ +
+
|
+ +inline | +
Returns the integrality requirement of the variable.
+ +Definition at line 1081 of file linear_solver.h.
+ +
+
|
+ +inline | +
Returns the lower bound.
+ +Definition at line 1100 of file linear_solver.h.
+ +
+
|
+ +inline | +
Returns the name of the variable.
+ +Definition at line 1071 of file linear_solver.h.
+ +| double operations_research::MPVariable::reduced_cost | +( | +) | +const | +
Advanced usage: returns the reduced cost of the variable in the current solution (only available for continuous problems).
+ +
+
|
+ +inlineprotected | +
Definition at line 1186 of file linear_solver.h.
+ +
+
|
+ +inlineprotected | +
Definition at line 1185 of file linear_solver.h.
+ +| void operations_research::MPVariable::SetBounds | +( | +double | +lb, | +
| + | + | double | +ub | +
| + | ) | ++ |
Sets both the lower and upper bounds.
+ +| void operations_research::MPVariable::SetBranchingPriority | +( | +int | +priority | ) | ++ |
| void operations_research::MPVariable::SetInteger | +( | +bool | +integer | ) | ++ |
Sets the integrality requirement of the variable.
+ +
+
|
+ +inline | +
Sets the lower bound.
+ +Definition at line 1110 of file linear_solver.h.
+ +
+
|
+ +inline | +
Sets the upper bound.
+ +Definition at line 1114 of file linear_solver.h.
+ +| double operations_research::MPVariable::solution_value | +( | +) | +const | +
Returns the value of the variable in the current solution.
+If the variable is integer, then the value will always be an integer (the underlying solver handles floating-point values only, but this function automatically rounds it to the nearest integer; see: man 3 round).
+ +
+
|
+ +inline | +
Returns the upper bound.
+ +Definition at line 1105 of file linear_solver.h.
+ +| double operations_research::MPVariable::unrounded_solution_value | +( | +) | +const | +
Advanced usage: unrounded solution value.
+The returned value won't be rounded to the nearest integer even if the variable is integer.
+ +
+
|
+ +friend | +
Definition at line 1167 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1158 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1159 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1164 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1165 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1160 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1163 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1169 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1156 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1157 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1166 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1168 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1161 of file linear_solver.h.
+ +
+
|
+ +friend | +
Definition at line 1162 of file linear_solver.h.
+ +Definition at line 227 of file linear_solver.pb.h.
+Definition at line 226 of file linear_solver.pb.h.
Public Member Functions | |
| void | Swap (MPVariableProto *other) |
| MPVariableProto * | New () const final |
| implements Message -------------------------------------------— More... | |
| MPVariableProto * | New (::PROTOBUF_NAMESPACE_ID::Arena *arena) const final |
| ::PROTOBUF_NAMESPACE_ID::Metadata | GetMetadata () const final |
| bool | has_name () const |
| nested types -------------------------------------------------— More... | |
| void | clear_name () |
| void | set_allocated_name (std::string *name) |
| bool | has_objective_coefficient () const |
| optional double objective_coefficient = 3 [default = 0]; More... | |
| void | clear_objective_coefficient () |
| void | set_objective_coefficient (double value) |
| bool | has_is_integer () const |
| optional bool is_integer = 4 [default = false]; More... | |
| void | clear_is_integer () |
| void | set_is_integer (bool value) |
| bool | has_branching_priority () const |
| optional int32 branching_priority = 6 [default = 0]; More... | |
| void | clear_branching_priority () |
| void | set_branching_priority (::PROTOBUF_NAMESPACE_ID::int32 value) |
| bool | has_lower_bound () const |
| optional double lower_bound = 1 [default = -inf]; More... | |
| void | clear_lower_bound () |
| void | set_lower_bound (double value) |
| bool | has_upper_bound () const |
| optional double upper_bound = 2 [default = inf]; More... | |
| void | clear_upper_bound () |
Definition at line 234 of file linear_solver.pb.h.
+Definition at line 233 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPVariableProto.branching_priority)
-Definition at line 2414 of file linear_solver.pb.h.
+Definition at line 2401 of file linear_solver.pb.h.
Definition at line 2410 of file linear_solver.pb.h.
+Definition at line 2397 of file linear_solver.pb.h.
Definition at line 2334 of file linear_solver.pb.h.
+Definition at line 2321 of file linear_solver.pb.h.
Definition at line 2280 of file linear_solver.pb.h.
+Definition at line 2267 of file linear_solver.pb.h.
Definition at line 2352 of file linear_solver.pb.h.
+Definition at line 2339 of file linear_solver.pb.h.
Definition at line 2316 of file linear_solver.pb.h.
+Definition at line 2303 of file linear_solver.pb.h.
Definition at line 2298 of file linear_solver.pb.h.
+Definition at line 2285 of file linear_solver.pb.h.
Definition at line 259 of file linear_solver.pb.h.
+Definition at line 258 of file linear_solver.pb.h.
Definition at line 310 of file linear_solver.pb.h.
+Definition at line 309 of file linear_solver.pb.h.
Definition at line 262 of file linear_solver.pb.h.
+Definition at line 261 of file linear_solver.pb.h.
Definition at line 265 of file linear_solver.pb.h.
+Definition at line 264 of file linear_solver.pb.h.
optional int32 branching_priority = 6 [default = 0];
- -Definition at line 2407 of file linear_solver.pb.h.
+Definition at line 2394 of file linear_solver.pb.h.
optional bool is_integer = 4 [default = false];
- -Definition at line 2331 of file linear_solver.pb.h.
+Definition at line 2318 of file linear_solver.pb.h.
optional double lower_bound = 1 [default = -inf];
- -optional double lower_bound = 1 [default = -inf];
- -Definition at line 2277 of file linear_solver.pb.h.
+Definition at line 2264 of file linear_solver.pb.h.
nested types -------------------------------------------------—
-optional string name = 5 [default = ""];
-accessors ----------------------------------------------------— optional string name = 5 [default = ""];
- -Definition at line 2349 of file linear_solver.pb.h.
+Definition at line 2336 of file linear_solver.pb.h.
optional double objective_coefficient = 3 [default = 0];
- -Definition at line 2313 of file linear_solver.pb.h.
+Definition at line 2300 of file linear_solver.pb.h.
optional double upper_bound = 2 [default = inf];
- -Definition at line 2295 of file linear_solver.pb.h.
+Definition at line 2282 of file linear_solver.pb.h.
Definition at line 271 of file linear_solver.pb.h.
+Definition at line 270 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPVariableProto.is_integer)
-Definition at line 2338 of file linear_solver.pb.h.
+Definition at line 2325 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPVariableProto.lower_bound)
-Definition at line 2284 of file linear_solver.pb.h.
+Definition at line 2271 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable:operations_research.MPVariableProto.name)
-Definition at line 2383 of file linear_solver.pb.h.
+Definition at line 2370 of file linear_solver.pb.h.
Definition at line 255 of file linear_solver.pb.h.
+Definition at line 254 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPVariableProto.name)
-Definition at line 2356 of file linear_solver.pb.h.
+Definition at line 2343 of file linear_solver.pb.h.
implements Message -------------------------------------------—
- -Definition at line 285 of file linear_solver.pb.h.
+Definition at line 284 of file linear_solver.pb.h.
Definition at line 289 of file linear_solver.pb.h.
+Definition at line 288 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPVariableProto.objective_coefficient)
-Definition at line 2320 of file linear_solver.pb.h.
+Definition at line 2307 of file linear_solver.pb.h.
Definition at line 239 of file linear_solver.pb.h.
+Definition at line 238 of file linear_solver.pb.h.
Definition at line 243 of file linear_solver.pb.h.
+Definition at line 242 of file linear_solver.pb.h.
@protoc_insertion_point(field_release:operations_research.MPVariableProto.name)
-Definition at line 2388 of file linear_solver.pb.h.
+Definition at line 2375 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_allocated:operations_research.MPVariableProto.name)
-Definition at line 2396 of file linear_solver.pb.h.
+Definition at line 2383 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPVariableProto.branching_priority)
-Definition at line 2418 of file linear_solver.pb.h.
+Definition at line 2405 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPVariableProto.is_integer)
-Definition at line 2342 of file linear_solver.pb.h.
+Definition at line 2329 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPVariableProto.lower_bound)
-Definition at line 2288 of file linear_solver.pb.h.
+Definition at line 2275 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPVariableProto.name)
-Definition at line 2360 of file linear_solver.pb.h.
+Definition at line 2347 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_rvalue:operations_research.MPVariableProto.name)
-Definition at line 2365 of file linear_solver.pb.h.
+Definition at line 2352 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_char:operations_research.MPVariableProto.name)
-Definition at line 2371 of file linear_solver.pb.h.
+Definition at line 2358 of file linear_solver.pb.h.
@protoc_insertion_point(field_set_pointer:operations_research.MPVariableProto.name)
-Definition at line 2377 of file linear_solver.pb.h.
+Definition at line 2364 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPVariableProto.objective_coefficient)
-Definition at line 2324 of file linear_solver.pb.h.
+Definition at line 2311 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.MPVariableProto.upper_bound)
-Definition at line 2306 of file linear_solver.pb.h.
+Definition at line 2293 of file linear_solver.pb.h.
Definition at line 252 of file linear_solver.pb.h.
+Definition at line 251 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.MPVariableProto.upper_bound)
-Definition at line 2302 of file linear_solver.pb.h.
+Definition at line 2289 of file linear_solver.pb.h.
Definition at line 317 of file linear_solver.pb.h.
+Definition at line 316 of file linear_solver.pb.h.
Definition at line 404 of file linear_solver.pb.h.
+Definition at line 403 of file linear_solver.pb.h.
Definition at line 279 of file linear_solver.pb.h.
+Definition at line 278 of file linear_solver.pb.h.
Definition at line 373 of file linear_solver.pb.h.
+Definition at line 372 of file linear_solver.pb.h.
Definition at line 275 of file linear_solver.pb.h.
+Definition at line 274 of file linear_solver.pb.h.
Definition at line 366 of file linear_solver.pb.h.
+Definition at line 365 of file linear_solver.pb.h.
Definition at line 380 of file linear_solver.pb.h.
+Definition at line 379 of file linear_solver.pb.h.
Definition at line 346 of file linear_solver.pb.h.
+Definition at line 345 of file linear_solver.pb.h.
Definition at line 359 of file linear_solver.pb.h.
+Definition at line 358 of file linear_solver.pb.h.
Definition at line 387 of file linear_solver.pb.h.
+Definition at line 386 of file linear_solver.pb.h.
Definition at line 1492 of file linear_solver.pb.h.
+Definition at line 1484 of file linear_solver.pb.h.
Public Member Functions | |
| void | Swap (OptionalDouble *other) |
| OptionalDouble * | New () const final |
| implements Message -------------------------------------------— More... | |
| OptionalDouble * | New (::PROTOBUF_NAMESPACE_ID::Arena *arena) const final |
| ::PROTOBUF_NAMESPACE_ID::Metadata | GetMetadata () const final |
| bool | has_value () const |
| nested types -------------------------------------------------— More... | |
| void | clear_value () |
Definition at line 1499 of file linear_solver.pb.h.
+Definition at line 1491 of file linear_solver.pb.h.
Definition at line 3241 of file linear_solver.pb.h.
+Definition at line 3221 of file linear_solver.pb.h.
Definition at line 1524 of file linear_solver.pb.h.
+Definition at line 1516 of file linear_solver.pb.h.
Definition at line 1575 of file linear_solver.pb.h.
+Definition at line 1567 of file linear_solver.pb.h.
Definition at line 1527 of file linear_solver.pb.h.
+Definition at line 1519 of file linear_solver.pb.h.
Definition at line 1530 of file linear_solver.pb.h.
+Definition at line 1522 of file linear_solver.pb.h.
nested types -------------------------------------------------—
- -accessors ----------------------------------------------------— optional double value = 1;
-optional double value = 1;
- -Definition at line 3238 of file linear_solver.pb.h.
+Definition at line 3218 of file linear_solver.pb.h.
Definition at line 1536 of file linear_solver.pb.h.
+Definition at line 1528 of file linear_solver.pb.h.
Definition at line 1520 of file linear_solver.pb.h.
+Definition at line 1512 of file linear_solver.pb.h.
implements Message -------------------------------------------—
- -Definition at line 1550 of file linear_solver.pb.h.
+Definition at line 1542 of file linear_solver.pb.h.
Definition at line 1554 of file linear_solver.pb.h.
+Definition at line 1546 of file linear_solver.pb.h.
Definition at line 1504 of file linear_solver.pb.h.
+Definition at line 1496 of file linear_solver.pb.h.
Definition at line 1508 of file linear_solver.pb.h.
+Definition at line 1500 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.OptionalDouble.value)
-Definition at line 3249 of file linear_solver.pb.h.
+Definition at line 3229 of file linear_solver.pb.h.
Definition at line 1517 of file linear_solver.pb.h.
+Definition at line 1509 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.OptionalDouble.value)
-Definition at line 3245 of file linear_solver.pb.h.
+Definition at line 3225 of file linear_solver.pb.h.
Definition at line 1582 of file linear_solver.pb.h.
+Definition at line 1574 of file linear_solver.pb.h.
Definition at line 1623 of file linear_solver.pb.h.
+Definition at line 1615 of file linear_solver.pb.h.
Definition at line 1544 of file linear_solver.pb.h.
+Definition at line 1536 of file linear_solver.pb.h.
Definition at line 1540 of file linear_solver.pb.h.
+Definition at line 1532 of file linear_solver.pb.h.
Definition at line 1611 of file linear_solver.pb.h.
+Definition at line 1603 of file linear_solver.pb.h.
Definition at line 1129 of file linear_solver.pb.h.
+Definition at line 1123 of file linear_solver.pb.h.
Public Member Functions | |
| void | Swap (PartialVariableAssignment *other) |
| PartialVariableAssignment * | New () const final |
| implements Message -------------------------------------------— More... | |
| PartialVariableAssignment * | New (::PROTOBUF_NAMESPACE_ID::Arena *arena) const final |
| ::PROTOBUF_NAMESPACE_ID::Metadata | GetMetadata () const final |
| int | var_index_size () const |
| nested types -------------------------------------------------— More... | |
| void | clear_var_index () |
| ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int32 > * | mutable_var_index () |
| int | var_value_size () const |
| repeated double var_value = 2 [packed = true]; More... | |
| void | clear_var_value () |
Definition at line 1136 of file linear_solver.pb.h.
+Definition at line 1130 of file linear_solver.pb.h.
@protoc_insertion_point(field_add:operations_research.PartialVariableAssignment.var_index)
-Definition at line 2949 of file linear_solver.pb.h.
+Definition at line 2931 of file linear_solver.pb.h.
@protoc_insertion_point(field_add:operations_research.PartialVariableAssignment.var_value)
-Definition at line 2979 of file linear_solver.pb.h.
+Definition at line 2961 of file linear_solver.pb.h.
Definition at line 2938 of file linear_solver.pb.h.
+Definition at line 2920 of file linear_solver.pb.h.
Definition at line 2968 of file linear_solver.pb.h.
+Definition at line 2950 of file linear_solver.pb.h.
Definition at line 1161 of file linear_solver.pb.h.
+Definition at line 1155 of file linear_solver.pb.h.
Definition at line 1212 of file linear_solver.pb.h.
+Definition at line 1206 of file linear_solver.pb.h.
Definition at line 1164 of file linear_solver.pb.h.
+Definition at line 1158 of file linear_solver.pb.h.
Definition at line 1167 of file linear_solver.pb.h.
+Definition at line 1161 of file linear_solver.pb.h.
Definition at line 1173 of file linear_solver.pb.h.
+Definition at line 1167 of file linear_solver.pb.h.
Definition at line 1157 of file linear_solver.pb.h.
+Definition at line 1151 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable_list:operations_research.PartialVariableAssignment.var_index)
-Definition at line 2959 of file linear_solver.pb.h.
+Definition at line 2941 of file linear_solver.pb.h.
@protoc_insertion_point(field_mutable_list:operations_research.PartialVariableAssignment.var_value)
-Definition at line 2989 of file linear_solver.pb.h.
+Definition at line 2971 of file linear_solver.pb.h.
implements Message -------------------------------------------—
- -Definition at line 1187 of file linear_solver.pb.h.
+Definition at line 1181 of file linear_solver.pb.h.
Definition at line 1191 of file linear_solver.pb.h.
+Definition at line 1185 of file linear_solver.pb.h.
Definition at line 1141 of file linear_solver.pb.h.
+Definition at line 1135 of file linear_solver.pb.h.
Definition at line 1145 of file linear_solver.pb.h.
+Definition at line 1139 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.PartialVariableAssignment.var_index)
-Definition at line 2945 of file linear_solver.pb.h.
+Definition at line 2927 of file linear_solver.pb.h.
@protoc_insertion_point(field_set:operations_research.PartialVariableAssignment.var_value)
-Definition at line 2975 of file linear_solver.pb.h.
+Definition at line 2957 of file linear_solver.pb.h.
Definition at line 1154 of file linear_solver.pb.h.
+Definition at line 1148 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.PartialVariableAssignment.var_index)
-Definition at line 2941 of file linear_solver.pb.h.
+Definition at line 2923 of file linear_solver.pb.h.
@protoc_insertion_point(field_list:operations_research.PartialVariableAssignment.var_index)
-Definition at line 2954 of file linear_solver.pb.h.
+Definition at line 2936 of file linear_solver.pb.h.
nested types -------------------------------------------------—
- -accessors ----------------------------------------------------— repeated int32 var_index = 1 [packed = true];
-repeated int32 var_index = 1 [packed = true];
- -Definition at line 2935 of file linear_solver.pb.h.
+Definition at line 2917 of file linear_solver.pb.h.
@protoc_insertion_point(field_get:operations_research.PartialVariableAssignment.var_value)
-Definition at line 2971 of file linear_solver.pb.h.
+Definition at line 2953 of file linear_solver.pb.h.
@protoc_insertion_point(field_list:operations_research.PartialVariableAssignment.var_value)
-Definition at line 2984 of file linear_solver.pb.h.
+Definition at line 2966 of file linear_solver.pb.h.
repeated double var_value = 2 [packed = true];
- -Definition at line 2965 of file linear_solver.pb.h.
+Definition at line 2947 of file linear_solver.pb.h.
Definition at line 1219 of file linear_solver.pb.h.
+Definition at line 1213 of file linear_solver.pb.h.
Definition at line 1280 of file linear_solver.pb.h.
+Definition at line 1274 of file linear_solver.pb.h.
Definition at line 1181 of file linear_solver.pb.h.
+Definition at line 1175 of file linear_solver.pb.h.
Definition at line 1177 of file linear_solver.pb.h.
+Definition at line 1171 of file linear_solver.pb.h.
Definition at line 1248 of file linear_solver.pb.h.
+Definition at line 1242 of file linear_solver.pb.h.
Definition at line 1260 of file linear_solver.pb.h.
+Definition at line 1254 of file linear_solver.pb.h.
#include "ortools/port/proto_utils.h"Go to the source code of this file.
++Classes | |
| class | operations_research::MPSolver |
| This mathematical programming (MP) solver class is the main class though which users build and solve problems. More... | |
| class | operations_research::MPObjective |
| A class to express a linear objective. More... | |
| class | operations_research::MPVariable |
| The class for variables of a Mathematical Programming (MP) model. More... | |
| class | operations_research::MPConstraint |
| The class for constraints of a Mathematical Programming (MP) model. More... | |
| class | operations_research::MPSolverParameters |
| This class stores parameter settings for LP and MIP solvers. More... | |
| class | operations_research::MPSolverInterface |
+Namespaces | |
| operations_research | |
+Functions | |
| const absl::string_view | operations_research::ToString (MPSolver::OptimizationProblemType optimization_problem_type) |
| std::ostream & | operations_research::operator<< (std::ostream &os, MPSolver::OptimizationProblemType optimization_problem_type) |
| std::ostream & | operations_research::operator<< (std::ostream &os, MPSolver::ResultStatus status) |
| bool | operations_research::AbslParseFlag (absl::string_view text, MPSolver::OptimizationProblemType *solver_type, std::string *error) |
| std::string | operations_research::AbslUnparseFlag (MPSolver::OptimizationProblemType solver_type) |
+Variables | |
| constexpr double | operations_research::kDefaultPrimalTolerance = 1e-07 |
Macros | |
| #define | PROTOBUF_INTERNAL_EXPORT_ortools_2flinear_5fsolver_2flinear_5fsolver_2eproto |
| Generated by the protocol buffer compiler. More... | |
@@ -330,9 +327,6 @@ Variables |
Generated by the protocol buffer compiler.
-DO NOT EDIT! source: ortools/linear_solver/linear_solver.proto @protoc_insertion_point(includes)
-Definition at line 39 of file linear_solver.pb.h.
Definition at line 3833 of file linear_solver.pb.h.
+Definition at line 3800 of file linear_solver.pb.h.
Definition at line 3828 of file linear_solver.pb.h.
+Definition at line 3795 of file linear_solver.pb.h.
Definition at line 3838 of file linear_solver.pb.h.
+Definition at line 3805 of file linear_solver.pb.h.
Definition at line 3823 of file linear_solver.pb.h.
+Definition at line 3790 of file linear_solver.pb.h.
Functions | |
| util::StatusOr< std::string > | operations_research::ExportModelAsLpFormat (const MPModelProto &model, const MPModelExportOptions &options=MPModelExportOptions()) |
| Outputs the current model (variables, constraints, objective) as a std::string encoded in the so-called "CPLEX LP file format" as generated by SCIP. More... | |
| util::StatusOr< std::string > | operations_research::ExportModelAsMpsFormat (const MPModelProto &model, const MPModelExportOptions &options=MPModelExportOptions()) |
| Outputs the current model (variables, constraints, objective) as a std::string encoded in MPS file format, using the "free" MPS format. More... | |
diff --git a/docs/cpp_linear/model__exporter__swig__helper_8h_source.html b/docs/cpp_linear/model__exporter__swig__helper_8h_source.html
index d0cde98628..7ce74eccb2 100644
--- a/docs/cpp_linear/model__exporter__swig__helper_8h_source.html
+++ b/docs/cpp_linear/model__exporter__swig__helper_8h_source.html
@@ -56,12 +56,12 @@ $(document).ready(function(){initNavTree('model__exporter__swig__helper_8h_sourc
Go to the documentation of this file.std::string ExportModelAsLpFormatReturnString(const MPModelProto &input_model, const MPModelExportOptions &options=MPModelExportOptions()) Definition: model_exporter_swig_helper.h:24 util::StatusOr< std::string > ExportModelAsMpsFormat(const MPModelProto &model, const MPModelExportOptions &options=MPModelExportOptions()) Outputs the current model (variables, constraints, objective) as a std::string encoded in MPS file fo... util::StatusOr< std::string > ExportModelAsMpsFormat(const MPModelProto &model, const MPModelExportOptions &options=MPModelExportOptions()) std::string ExportModelAsMpsFormatReturnString(const MPModelProto &input_model, const MPModelExportOptions &options=MPModelExportOptions()) Definition: model_exporter_swig_helper.h:31 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in c... Definition: model_exporter.h:26 util::StatusOr< std::string > ExportModelAsLpFormat(const MPModelProto &model, const MPModelExportOptions &options=MPModelExportOptions()) Outputs the current model (variables, constraints, objective) as a std::string encoded in the so-call... Definition: linear_solver.h:160 util::StatusOr< std::string > ExportModelAsLpFormat(const MPModelProto &model, const MPModelExportOptions &options=MPModelExportOptions()) | operations_research | | Namespaces | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. | |||||
Functions | |
| std::string | operations_research::FindErrorInMPModelProto (const MPModelProto &model) |
| Returns an empty std::string iff the model is valid and not trivially infeasible. More... | |
| std::string | operations_research::FindFeasibilityErrorInSolutionHint (const MPModelProto &model, double tolerance) |
| Returns an empty std::string if the solution hint given in the model is a feasible solution. More... | |
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. -More...
Classes | |
| class | MPConstraint |
| The class for constraints of a Mathematical Programming (MP) model. More... | |
| class | MPConstraintProto |
| class | MPGeneralConstraintProto |
| class | MPModelRequest |
| class | MPObjective |
| A class to express a linear objective. More... | |
| class | MPSolutionResponse |
| class | MPSolver |
| This mathematical programming (MP) solver class is the main class though which users build and solve problems. More... | |
| class | MPSolverCommonParameters |
| class | MPSolverInterface |
| class | MPSolverParameters |
| This class stores parameter settings for LP and MIP solvers. More... | |
| class | MPSosConstraint |
| class | MPVariable |
| The class for variables of a Mathematical Programming (MP) model. More... | |
| class | MPVariableProto |
| class | OptionalDouble |
Functions | |
| const absl::string_view | ToString (MPSolver::OptimizationProblemType optimization_problem_type) |
| std::ostream & | operator<< (std::ostream &os, MPSolver::OptimizationProblemType optimization_problem_type) |
| std::ostream & | operator<< (std::ostream &os, MPSolver::ResultStatus status) |
| bool | AbslParseFlag (absl::string_view text, MPSolver::OptimizationProblemType *solver_type, std::string *error) |
| std::string | AbslUnparseFlag (MPSolver::OptimizationProblemType solver_type) |
| util::StatusOr< std::string > | ExportModelAsLpFormat (const MPModelProto &model, const MPModelExportOptions &options=MPModelExportOptions()) |
| Outputs the current model (variables, constraints, objective) as a std::string encoded in the so-called "CPLEX LP file format" as generated by SCIP. More... | |
| util::StatusOr< std::string > | ExportModelAsMpsFormat (const MPModelProto &model, const MPModelExportOptions &options=MPModelExportOptions()) |
| Outputs the current model (variables, constraints, objective) as a std::string encoded in MPS file format, using the "free" MPS format. More... | |
| std::string | ExportModelAsLpFormatReturnString (const MPModelProto &input_model, const MPModelExportOptions &options=MPModelExportOptions()) |
| std::string | ExportModelAsMpsFormatReturnString (const MPModelProto &input_model, const MPModelExportOptions &options=MPModelExportOptions()) |
| std::string | FindErrorInMPModelProto (const MPModelProto &model) |
| Returns an empty std::string iff the model is valid and not trivially infeasible. More... | |
| std::string | FindFeasibilityErrorInSolutionHint (const MPModelProto &model, double tolerance) |
| Returns an empty std::string if the solution hint given in the model is a feasible solution. More... | |
| bool | MPSosConstraint_Type_IsValid (int value) |
Variables | |
| constexpr double | kDefaultPrimalTolerance = 1e-07 |
| MPConstraintProtoDefaultTypeInternal | _MPConstraintProto_default_instance_ |
| MPGeneralConstraintProtoDefaultTypeInternal | _MPGeneralConstraintProto_default_instance_ |
| constexpr int | MPSolverResponseStatus_ARRAYSIZE = MPSolverResponseStatus_MAX + 1 |
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-| bool operations_research::AbslParseFlag | +( | +absl::string_view | +text, | +
| + | + | MPSolver::OptimizationProblemType * | +solver_type, | +
| + | + | std::string * | +error | +
| + | ) | ++ |
+
|
+ +inline | +
Definition at line 911 of file linear_solver.h.
+ +Outputs the current model (variables, constraints, objective) as a std::string encoded in the so-called "CPLEX LP file format" as generated by SCIP.
-The LP file format is easily readable by a human.
-Returns false if some error has occurred during execution. The validity of names is automatically checked. If a variable name or a constraint name is invalid or non-existent, a new valid name is automatically generated.
-If 'obfuscated' is true, the variable and constraint names of proto_ are not used. Variable and constraint names of the form "V12345" and "C12345" are used instead.
-For more information about the different LP file formats: http://lpsolve.sourceforge.net/5.5/lp-format.htm The following give a reasonable idea of the CPLEX LP file format: http://lpsolve.sourceforge.net/5.5/CPLEX-format.htm http://tinyurl.com/cplex-lp-format http://www.gurobi.com/documentation/5.1/reference-manual/node871
-Outputs the current model (variables, constraints, objective) as a std::string encoded in MPS file format, using the "free" MPS format.
-Returns false if some error has occurred during execution. Models with maximization objectives trigger an error, because MPS can encode only minimization problems.
-The validity of names is automatically checked. If a variable name or a constraint name is invalid or non-existent, a new valid name is automatically generated.
-Name validity and obfuscation works exactly as in ExportModelAsLpFormat().
-For more information about the MPS format: http://en.wikipedia.org/wiki/MPS_(format) A close-to-original description coming from OSL: http://tinyurl.com/mps-format-by-osl A recent description from CPLEX: http://tinyurl.com/mps-format-by-cplex CPLEX extensions: http://tinyurl.com/mps-extensions-by-cplex Gurobi's description: http://www.gurobi.com/documentation/5.1/reference-manual/node869
-Returns an empty std::string iff the model is valid and not trivially infeasible.
-Otherwise, returns a description of the first error or trivial infeasibility encountered.
-NOTE(user): the code of this method (and the client code too!) is considerably simplified by this std::string-based, simple API. If clients require it, we could add a formal error status enum.
-Returns an empty std::string if the solution hint given in the model is a feasible solution.
-Otherwise, returns a description of the first reason for infeasibility.
-This function can be useful for debugging/checking that the given solution hint is feasible when it is expected to be the case. The feasibility is checked up to the given tolerance using the ::operations_research::IsLowerWithinTolerance() function.
-Definition at line 127 of file linear_solver.pb.h.
+ + + +
+
|
+ +inline | +
Definition at line 895 of file linear_solver.h.
+ +
+
|
+ +inline | +
Definition at line 901 of file linear_solver.h.
+ +| const absl::string_view operations_research::ToString | +( | +MPSolver::OptimizationProblemType | +optimization_problem_type | ) | ++ |
| constexpr double operations_research::kDefaultPrimalTolerance = 1e-07 | +
Definition at line 162 of file linear_solver.h.
+| Ninternal | |
| Noperations_research | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License |
| Noperations_research |
Internal implementation detail – do not use these members.
- +Definition at line 47 of file linear_solver.pb.h.
diff --git a/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPModelRequest__SolverType_01_4.html b/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPModelRequest__SolverType_01_4.html index d6afdad087..f4b0b0ac11 100644 --- a/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPModelRequest__SolverType_01_4.html +++ b/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPModelRequest__SolverType_01_4.html @@ -52,7 +52,7 @@ $(document).ready(function(){initNavTree('structis__proto__enum_3_01_1_1operatio struct is_proto_enum< ::operations_research::MPModelRequest_SolverType > -Definition at line 3831 of file linear_solver.pb.h. +Definition at line 3798 of file linear_solver.pb.h. The documentation for this struct was generated from the following file: diff --git a/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPSolverCommonParameters__LPAlgorithmValues_01_4.html b/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPSolverCommonParameters__LPAlgorithmValues_01_4.html index cf8ccfb09b..319f83d671 100644 --- a/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPSolverCommonParameters__LPAlgorithmValues_01_4.html +++ b/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPSolverCommonParameters__LPAlgorithmValues_01_4.html @@ -52,7 +52,7 @@ $(document).ready(function(){initNavTree('structis__proto__enum_3_01_1_1operatio struct is_proto_enum< ::operations_research::MPSolverCommonParameters_LPAlgorithmValues > - Definition at line 3826 of file linear_solver.pb.h. +Definition at line 3793 of file linear_solver.pb.h. The documentation for this struct was generated from the following file: diff --git a/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPSolverResponseStatus_01_4.html b/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPSolverResponseStatus_01_4.html index b047580831..1063b02139 100644 --- a/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPSolverResponseStatus_01_4.html +++ b/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPSolverResponseStatus_01_4.html @@ -52,7 +52,7 @@ $(document).ready(function(){initNavTree('structis__proto__enum_3_01_1_1operatio struct is_proto_enum< ::operations_research::MPSolverResponseStatus > - Definition at line 3836 of file linear_solver.pb.h. +Definition at line 3803 of file linear_solver.pb.h. The documentation for this struct was generated from the following file: diff --git a/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPSosConstraint__Type_01_4.html b/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPSosConstraint__Type_01_4.html index 97e90be8af..2fe09469ae 100644 --- a/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPSosConstraint__Type_01_4.html +++ b/docs/cpp_linear/structis__proto__enum_3_01_1_1operations__research_1_1MPSosConstraint__Type_01_4.html @@ -52,7 +52,7 @@ $(document).ready(function(){initNavTree('structis__proto__enum_3_01_1_1operatio struct is_proto_enum< ::operations_research::MPSosConstraint_Type > - Definition at line 3821 of file linear_solver.pb.h. +Definition at line 3788 of file linear_solver.pb.h. The documentation for this struct was generated from the following file: diff --git a/docs/cpp_linear/structoperations__research_1_1MPModelExportOptions.html b/docs/cpp_linear/structoperations__research_1_1MPModelExportOptions.html index 7429c26d9c..e38b65796a 100644 --- a/docs/cpp_linear/structoperations__research_1_1MPModelExportOptions.html +++ b/docs/cpp_linear/structoperations__research_1_1MPModelExportOptions.html @@ -63,16 +63,12 @@ Public Member Functions | |
Public Attributes | |
| bool | obfuscate = false |
| Obfuscates variable and constraint names. More... | |
| bool | log_invalid_names = false |
| Whether to log invalid variable and constraint names. More... | |
| bool | show_unused_variables = false |
| For .lp files only. More... | |
| int | max_line_length = 10000 |
| For .lp files only. More... | |
Whether to log invalid variable and constraint names.
-Definition at line 34 of file model_exporter.h.
For .lp files only.
-Maximum line length in exported files. The default was chosen so that SCIP can read the files.
-Definition at line 41 of file model_exporter.h.
Obfuscates variable and constraint names.
-Definition at line 32 of file model_exporter.h.
For .lp files only.
-Decides whether variables unused in the objective and constraints are shown when exported to a file.
-Definition at line 38 of file model_exporter.h.
diff --git a/docs/java/MPConstraint_8java_source.html b/docs/java/MPConstraint_8java_source.html
index 6010cbcde1..22149d6c52 100644
--- a/docs/java/MPConstraint_8java_source.html
+++ b/docs/java/MPConstraint_8java_source.html
@@ -41,37 +41,37 @@
46 main_research_linear_solverJNI.MPConstraint_setCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var, coeff); 50 return main_research_linear_solverJNI.MPConstraint_getCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var); 90 return MPSolver.BasisStatus.swigToEnum(main_research_linear_solverJNI.MPConstraint_basisStatus(swigCPtr, this));
+Go to the documentation of this file. 60 main_research_linear_solverJNI.MPConstraint_setCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var, coeff); 68 return main_research_linear_solverJNI.MPConstraint_getCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var); 157 return MPSolver.BasisStatus.swigToEnum(main_research_linear_solverJNI.MPConstraint_basisStatus(swigCPtr, this));
static final native void MPConstraint_setCoefficient(long jarg1, MPConstraint jarg1_, long jarg2, MPVariable jarg2_, double jarg3) The class for variables of a Mathematical Programming (MP) model. Definition: MPVariable.java:16 static final native String MPConstraint_name(long jarg1, MPConstraint jarg1_) MPConstraint(long cPtr, boolean cMemoryOwn) Definition: MPConstraint.java:17 MPConstraint(long cPtr, boolean cMemoryOwn) Definition: MPConstraint.java:22 static final native void MPConstraint_setIsLazy(long jarg1, MPConstraint jarg1_, boolean jarg2) static BasisStatus swigToEnum(int swigValue) Definition: MPSolver.java:411 void setBounds(double lb, double ub) Definition: MPConstraint.java:69 int index() Returns the index of the constraint in the MPSolver::constraints_. Definition: MPConstraint.java:132 The class for constraints of a Mathematical Programming (MP) model. Definition: MPConstraint.java:18 static BasisStatus swigToEnum(int swigValue) Definition: MPSolver.java:697 void setBounds(double lb, double ub) Sets both the lower and upper bounds. Definition: MPConstraint.java:102 static final native double MPConstraint_getCoefficient(long jarg1, MPConstraint jarg1_, long jarg2, MPVariable jarg2_) static final native void MPConstraint_setUb(long jarg1, MPConstraint jarg1_, double jarg2) void setUb(double ub) Definition: MPConstraint.java:65 void setIsLazy(boolean laziness) Definition: MPConstraint.java:77 void setIsLazy(boolean laziness) Advanced usage: sets the constraint "laziness". Definition: MPConstraint.java:125 This mathematical programming (MP) solver class is the main class though which users build and solve... Definition: MPSolver.java:17 static final native void MPConstraint_setBounds(long jarg1, MPConstraint jarg1_, double jarg2, double jarg3) static final native int MPConstraint_index(long jarg1, MPConstraint jarg1_) double dualValue() Definition: MPConstraint.java:85 Advanced usage: possible basis status values for a variable and the slack variable of a linear const... Definition: MPSolver.java:686 double dualValue() Advanced usage: returns the dual value of the constraint in the current solution (only available for... Definition: MPConstraint.java:140 static final native void MPConstraint_setLb(long jarg1, MPConstraint jarg1_, double jarg2) Definition: main_research_linear_solverJNI.java:11 static final native boolean MPConstraint_isLazy(long jarg1, MPConstraint jarg1_) static final native int MPConstraint_basisStatus(long jarg1, MPConstraint jarg1_) boolean isLazy() Advanced usage: returns true if the constraint is "lazy" (see below). Definition: MPConstraint.java:109 static final native void delete_MPConstraint(long jarg1) void setCoefficient(MPVariable var, double coeff) Definition: MPConstraint.java:45 double getCoefficient(MPVariable var) Definition: MPConstraint.java:49 void setLb(double lb) Definition: MPConstraint.java:61 MPSolver.BasisStatus basisStatus() Definition: MPConstraint.java:89 void setCoefficient(MPVariable var, double coeff) Sets the coefficient of the variable on the constraint. Definition: MPConstraint.java:59 double getCoefficient(MPVariable var) Gets the coefficient of a given variable on the constraint (which is 0 if the variable does not appe... Definition: MPConstraint.java:67 MPSolver.BasisStatus basisStatus() Advanced usage: returns the basis status of the constraint. Definition: MPConstraint.java:156 static final native double MPConstraint_ub(long jarg1, MPConstraint jarg1_) static final native double MPConstraint_lb(long jarg1, MPConstraint jarg1_) static final native double MPConstraint_dualValue(long jarg1, MPConstraint jarg1_) Classesclass | com.google.ortools.linearsolver.MPObjective | | A class to express a linear objective. More... | | | ||||
diff --git a/docs/java/MPObjective_8java_source.html b/docs/java/MPObjective_8java_source.html
index 60191da340..55b3a3c85e 100644
--- a/docs/java/MPObjective_8java_source.html
+++ b/docs/java/MPObjective_8java_source.html
@@ -41,35 +41,35 @@
46 main_research_linear_solverJNI.MPObjective_setCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var, coeff); 50 return main_research_linear_solverJNI.MPObjective_getCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var); MPObjective(long cPtr, boolean cMemoryOwn) Definition: MPObjective.java:17 59 main_research_linear_solverJNI.MPObjective_setCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var, coeff); 68 return main_research_linear_solverJNI.MPObjective_getCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var); MPObjective(long cPtr, boolean cMemoryOwn) Definition: MPObjective.java:20 static final native boolean MPObjective_maximization(long jarg1, MPObjective jarg1_) The class for variables of a Mathematical Programming (MP) model. Definition: MPVariable.java:16 static final native void MPObjective_setMaximization(long jarg1, MPObjective jarg1_) void setMaximization() Definition: MPObjective.java:69 double bestBound() Definition: MPObjective.java:85 static final native double MPObjective_value(long jarg1, MPObjective jarg1_) static final native void MPObjective_setMinimization(long jarg1, MPObjective jarg1_) static final native void delete_MPObjective(long jarg1) void setOffset(double value) Definition: MPObjective.java:53 void clear() Clears the offset, all variables and coefficients, and the optimization direction. Definition: MPObjective.java:48 static final native void MPObjective_clear(long jarg1, MPObjective jarg1_) void setCoefficient(MPVariable var, double coeff) Definition: MPObjective.java:45 void setMinimization() Definition: MPObjective.java:65 boolean minimization() Definition: MPObjective.java:77 double getCoefficient(MPVariable var) Definition: MPObjective.java:49 void setCoefficient(MPVariable var, double coeff) Sets the coefficient of the variable in the objective. Definition: MPObjective.java:58 boolean minimization() Is the optimization direction set to minimize? Definition: MPObjective.java:116 double value() Returns the objective value of the best solution found so far. Definition: MPObjective.java:131 double getCoefficient(MPVariable var) Gets the coefficient of a given variable in the objective It returns 0 if the variable does not ap... Definition: MPObjective.java:67 static final native boolean MPObjective_minimization(long jarg1, MPObjective jarg1_) static final native double MPObjective_bestBound(long jarg1, MPObjective jarg1_) static final native double MPObjective_offset(long jarg1, MPObjective jarg1_) static final native void MPObjective_setCoefficient(long jarg1, MPObjective jarg1_, long jarg2, MPVariable jarg2_, double jarg3) Definition: main_research_linear_solverJNI.java:11 static final native void MPObjective_setOptimizationDirection(long jarg1, MPObjective jarg1_, boolean jarg2) A class to express a linear objective. Definition: MPObjective.java:16 static final native double MPObjective_getCoefficient(long jarg1, MPObjective jarg1_, long jarg2, MPVariable jarg2_) void setOptimizationDirection(boolean maximize) Definition: MPObjective.java:61 void setOptimizationDirection(boolean maximize) Sets the optimization direction (maximize: true or minimize: false). Definition: MPObjective.java:88 static final native void MPObjective_setOffset(long jarg1, MPObjective jarg1_, double jarg2) boolean maximization() Definition: MPObjective.java:73 boolean maximization() Is the optimization direction set to maximize? Definition: MPObjective.java:109 |
diff --git a/docs/java/MPSolverParameters_8java_source.html b/docs/java/MPSolverParameters_8java_source.html
index 99ea526253..0838dc46b5 100644
--- a/docs/java/MPSolverParameters_8java_source.html
+++ b/docs/java/MPSolverParameters_8java_source.html
@@ -41,79 +41,79 @@
54 return MPSolverParameters.PresolveValues.swigToEnum(main_research_linear_solverJNI.MPSolverParameters_kDefaultPresolve_get()); 58 return MPSolverParameters.IncrementalityValues.swigToEnum(main_research_linear_solverJNI.MPSolverParameters_kDefaultIncrementality_get()); 66 main_research_linear_solverJNI.MPSolverParameters_setDoubleParam(swigCPtr, this, param.swigValue(), value); 70 main_research_linear_solverJNI.MPSolverParameters_setIntegerParam(swigCPtr, this, param.swigValue(), value); 74 return main_research_linear_solverJNI.MPSolverParameters_getDoubleParam(swigCPtr, this, param.swigValue()); 78 return main_research_linear_solverJNI.MPSolverParameters_getIntegerParam(swigCPtr, this, param.swigValue()); 92 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 136 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 141 throw new IllegalArgumentException("No enum " + IntegerParam.class + " with value " + swigValue); 178 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 183 throw new IllegalArgumentException("No enum " + PresolveValues.class + " with value " + swigValue); 221 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 226 throw new IllegalArgumentException("No enum " + LpAlgorithmValues.class + " with value " + swigValue); 263 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 268 throw new IllegalArgumentException("No enum " + IncrementalityValues.class + " with value " + swigValue); 305 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 310 throw new IllegalArgumentException("No enum " + ScalingValues.class + " with value " + swigValue); static IncrementalityValues swigToEnum(int swigValue) Definition: MPSolverParameters.java:261 80 return MPSolverParameters.PresolveValues.swigToEnum(main_research_linear_solverJNI.MPSolverParameters_kDefaultPresolve_get()); 84 return MPSolverParameters.IncrementalityValues.swigToEnum(main_research_linear_solverJNI.MPSolverParameters_kDefaultIncrementality_get()); 98 main_research_linear_solverJNI.MPSolverParameters_setDoubleParam(swigCPtr, this, param.swigValue(), value); 105 main_research_linear_solverJNI.MPSolverParameters_setIntegerParam(swigCPtr, this, param.swigValue(), value); 112 return main_research_linear_solverJNI.MPSolverParameters_getDoubleParam(swigCPtr, this, param.swigValue()); 119 return main_research_linear_solverJNI.MPSolverParameters_getIntegerParam(swigCPtr, this, param.swigValue()); 148 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 153 throw new IllegalArgumentException("No enum " + DoubleParam.class + " with value " + swigValue); 207 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 212 throw new IllegalArgumentException("No enum " + IntegerParam.class + " with value " + swigValue); 252 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 257 throw new IllegalArgumentException("No enum " + PresolveValues.class + " with value " + swigValue); 298 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 303 throw new IllegalArgumentException("No enum " + LpAlgorithmValues.class + " with value " + swigValue); 350 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 355 throw new IllegalArgumentException("No enum " + IncrementalityValues.class + " with value " + swigValue); 401 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 406 throw new IllegalArgumentException("No enum " + ScalingValues.class + " with value " + swigValue); static IncrementalityValues swigToEnum(int swigValue) Definition: MPSolverParameters.java:348 com.google.ortools.linearsolver.main_research_linear_solverJNI.MPSolverParameters_INCREMENTALITY_get static final native int MPSolverParameters_INCREMENTALITY_get() static final native int MPSolverParameters_SCALING_get() void setIntegerParam(MPSolverParameters.IntegerParam param, int value) Definition: MPSolverParameters.java:69 Definition: MPSolverParameters.java:253 void setIntegerParam(MPSolverParameters.IntegerParam param, int value) Sets a integer parameter to a specific value. Definition: MPSolverParameters.java:104 Advanced usage: Incrementality options. Definition: MPSolverParameters.java:333 com.google.ortools.linearsolver.main_research_linear_solverJNI.MPSolverParameters_DUAL_TOLERANCE_get static final native int MPSolverParameters_DUAL_TOLERANCE_get() static final native double MPSolverParameters_getDoubleParam(long jarg1, MPSolverParameters jarg1_, int jarg2) static final native int MPSolverParameters_INCREMENTALITY_ON_get() SCALING Definition: MPSolverParameters.java:128 BARRIER Definition: MPSolverParameters.java:213 MPSolverParameters() Definition: MPSolverParameters.java:61 BARRIER Definition: MPSolverParameters.java:290 MPSolverParameters() The constructor sets all parameters to their default value. Definition: MPSolverParameters.java:90 static final native int MPSolverParameters_RELATIVE_MIP_GAP_get() static double getKDefaultRelativeMipGap() Definition: MPSolverParameters.java:41 PRESOLVE_OFF Definition: MPSolverParameters.java:169 static double getKDefaultDualTolerance() Definition: MPSolverParameters.java:49 final int swigValue() Definition: MPSolverParameters.java:130 MPSolverParameters(long cPtr, boolean cMemoryOwn) Definition: MPSolverParameters.java:17 static double getKDefaultRelativeMipGap() Definition: MPSolverParameters.java:67 PRESOLVE_OFF Definition: MPSolverParameters.java:243 static double getKDefaultDualTolerance() Definition: MPSolverParameters.java:75 final int swigValue() Definition: MPSolverParameters.java:201 MPSolverParameters(long cPtr, boolean cMemoryOwn) Definition: MPSolverParameters.java:43 static final native int MPSolverParameters_getIntegerParam(long jarg1, MPSolverParameters jarg1_, int jarg2) static final native long new_MPSolverParameters() DUAL_TOLERANCE Definition: MPSolverParameters.java:84 static DoubleParam swigToEnum(int swigValue) Definition: MPSolverParameters.java:90 DUAL_TOLERANCE Advanced usage: tolerance for dual feasibility of basic solutions. Definition: MPSolverParameters.java:140 static DoubleParam swigToEnum(int swigValue) Definition: MPSolverParameters.java:146 static final native void delete_MPSolverParameters(long jarg1) static final native int MPSolverParameters_BARRIER_get() final int swigValue() Definition: MPSolverParameters.java:299 Definition: MPSolverParameters.java:295 INCREMENTALITY Definition: MPSolverParameters.java:127 final int swigValue() Definition: MPSolverParameters.java:395 Advanced usage: Scaling options. Definition: MPSolverParameters.java:385 INCREMENTALITY Advanced usage: incrementality from one solve to the next. Definition: MPSolverParameters.java:195 static final native int MPSolverParameters_PRESOLVE_ON_get() static LpAlgorithmValues swigToEnum(int swigValue) Definition: MPSolverParameters.java:219 double getDoubleParam(MPSolverParameters.DoubleParam param) Definition: MPSolverParameters.java:73 void setDoubleParam(MPSolverParameters.DoubleParam param, double value) Definition: MPSolverParameters.java:65 final int swigValue() Definition: MPSolverParameters.java:257 PRESOLVE Definition: MPSolverParameters.java:125 static LpAlgorithmValues swigToEnum(int swigValue) Definition: MPSolverParameters.java:296 double getDoubleParam(MPSolverParameters.DoubleParam param) Returns the value of a double parameter. Definition: MPSolverParameters.java:111 void setDoubleParam(MPSolverParameters.DoubleParam param, double value) Sets a double parameter to a specific value. Definition: MPSolverParameters.java:97 final int swigValue() Definition: MPSolverParameters.java:344 static final native int MPSolverParameters_kDefaultPresolve_get() final int swigValue() Definition: MPSolverParameters.java:172 final int swigValue() Definition: MPSolverParameters.java:246 static final native int MPSolverParameters_PRIMAL_get() Definition: MPSolverParameters.java:124 Enumeration of parameters that take integer or categorical values. Definition: MPSolverParameters.java:183 static final native double MPSolverParameters_kDefaultDualTolerance_get() RELATIVE_MIP_GAP Definition: MPSolverParameters.java:82 static final native int MPSolverParameters_PRESOLVE_OFF_get() static final native int MPSolverParameters_SCALING_ON_get() static final native void MPSolverParameters_setIntegerParam(long jarg1, MPSolverParameters jarg1_, int jarg2, int jarg3) final int swigValue() Definition: MPSolverParameters.java:86 int getIntegerParam(MPSolverParameters.IntegerParam param) Definition: MPSolverParameters.java:77 final int swigValue() Definition: MPSolverParameters.java:142 int getIntegerParam(MPSolverParameters.IntegerParam param) Returns the value of an integer parameter. Definition: MPSolverParameters.java:118 This class stores parameter settings for LP and MIP solvers. Definition: MPSolverParameters.java:39 static final native int MPSolverParameters_DUAL_get() static MPSolverParameters.IncrementalityValues getKDefaultIncrementality() Definition: MPSolverParameters.java:57 Definition: MPSolverParameters.java:168 static MPSolverParameters.IncrementalityValues getKDefaultIncrementality() Definition: MPSolverParameters.java:83 For each categorical parameter, enumeration of possible values. Definition: MPSolverParameters.java:242 static final native double MPSolverParameters_kDefaultPrimalTolerance_get() static ScalingValues swigToEnum(int swigValue) Definition: MPSolverParameters.java:303 Definition: MPSolverParameters.java:81 static MPSolverParameters.PresolveValues getKDefaultPresolve() Definition: MPSolverParameters.java:53 static ScalingValues swigToEnum(int swigValue) Definition: MPSolverParameters.java:399 Enumeration of parameters that take continuous values. Definition: MPSolverParameters.java:125 static MPSolverParameters.PresolveValues getKDefaultPresolve() Definition: MPSolverParameters.java:79 Definition: main_research_linear_solverJNI.java:11 final int swigValue() Definition: MPSolverParameters.java:215 INCREMENTALITY_OFF Definition: MPSolverParameters.java:254 final int swigValue() Definition: MPSolverParameters.java:292 static final native int MPSolverParameters_SCALING_OFF_get() static final native int MPSolverParameters_LP_ALGORITHM_get() Definition: MPSolverParameters.java:210 static double getKDefaultPrimalTolerance() Definition: MPSolverParameters.java:45 static IntegerParam swigToEnum(int swigValue) Definition: MPSolverParameters.java:134 SCALING_OFF Definition: MPSolverParameters.java:296 LP algorithm to use. Definition: MPSolverParameters.java:287 static double getKDefaultPrimalTolerance() Definition: MPSolverParameters.java:71 static IntegerParam swigToEnum(int swigValue) Definition: MPSolverParameters.java:205 static final native int MPSolverParameters_PRIMAL_TOLERANCE_get() static final native int MPSolverParameters_kDefaultIncrementality_get() static PresolveValues swigToEnum(int swigValue) Definition: MPSolverParameters.java:176 static PresolveValues swigToEnum(int swigValue) Definition: MPSolverParameters.java:250 static final native double MPSolverParameters_kDefaultRelativeMipGap_get() static final native int MPSolverParameters_PRESOLVE_get() LP_ALGORITHM Definition: MPSolverParameters.java:126 PRIMAL_TOLERANCE Definition: MPSolverParameters.java:83 PRIMAL_TOLERANCE Advanced usage: tolerance for primal feasibility of basic solutions. Definition: MPSolverParameters.java:136 static final native void MPSolverParameters_setDoubleParam(long jarg1, MPSolverParameters jarg1_, int jarg2, double jarg3) DUAL Definition: MPSolverParameters.java:211 PRIMAL Definition: MPSolverParameters.java:212 PRESOLVE_ON Definition: MPSolverParameters.java:170 INCREMENTALITY_ON Definition: MPSolverParameters.java:255 SCALING_ON Definition: MPSolverParameters.java:297 DUAL Definition: MPSolverParameters.java:288 PRIMAL Definition: MPSolverParameters.java:289 PRESOLVE_ON Definition: MPSolverParameters.java:244 INCREMENTALITY_ON Reuse results from previous solve as much as the underlying solver allows. Definition: MPSolverParameters.java:342 static final native int MPSolverParameters_INCREMENTALITY_OFF_get() class | com.google.ortools.linearsolver.MPSolver | enum | com.google.ortools.linearsolver.MPSolver.OptimizationProblemType | enum | com.google.ortools.linearsolver.MPSolver.ResultStatus | enum | com.google.ortools.linearsolver.MPSolver.BasisStatus | | Classes | This mathematical programming (MP) solver class is the main class + though which users build and solve problems. More... | The type of problems (LP or MIP) that will be solved and the underlying + solver (GLOP, GLPK, CLP, CBC or SCIP) that will solve them. More... | The status of solving the problem. More... | Advanced usage: possible basis status values for a variable and the slack + variable of a linear constraint. More... | ||||||||||||||
diff --git a/docs/java/MPSolver_8java_source.html b/docs/java/MPSolver_8java_source.html
index ab47bf2e77..a6e2ae70d1 100644
--- a/docs/java/MPSolver_8java_source.html
+++ b/docs/java/MPSolver_8java_source.html
@@ -41,147 +41,147 @@
103 long cPtr = main_research_linear_solverJNI.MPSolver_lookupVariableOrNull(swigCPtr, this, var_name); 108 long cPtr = main_research_linear_solverJNI.MPSolver_makeVar(swigCPtr, this, lb, ub, integer, name); 136 long cPtr = main_research_linear_solverJNI.MPSolver_lookupConstraintOrNull(swigCPtr, this, constraint_name); 141 long cPtr = main_research_linear_solverJNI.MPSolver_makeConstraint__SWIG_0(swigCPtr, this, lb, ub); 151 long cPtr = main_research_linear_solverJNI.MPSolver_makeConstraint__SWIG_2(swigCPtr, this, lb, ub, name); 156 long cPtr = main_research_linear_solverJNI.MPSolver_makeConstraint__SWIG_3(swigCPtr, this, name); 166 return MPSolver.ResultStatus.swigToEnum(main_research_linear_solverJNI.MPSolver_solve__SWIG_0(swigCPtr, this)); 170 return MPSolver.ResultStatus.swigToEnum(main_research_linear_solverJNI.MPSolver_solve__SWIG_1(swigCPtr, this, MPSolverParameters.getCPtr(param), param)); 178 return main_research_linear_solverJNI.MPSolver_verifySolution(swigCPtr, this, tolerance, log_errors); 189 public SWIGTYPE_p_util__Status loadSolutionFromProto(SWIGTYPE_p_operations_research__MPSolutionResponse response, double tolerance) { 190 return new SWIGTYPE_p_util__Status(main_research_linear_solverJNI.MPSolver_loadSolutionFromProto__SWIG_0(swigCPtr, this, SWIGTYPE_p_operations_research__MPSolutionResponse.getCPtr(response), tolerance), true); 193 public SWIGTYPE_p_util__Status loadSolutionFromProto(SWIGTYPE_p_operations_research__MPSolutionResponse response) { 194 return new SWIGTYPE_p_util__Status(main_research_linear_solverJNI.MPSolver_loadSolutionFromProto__SWIG_1(swigCPtr, this, SWIGTYPE_p_operations_research__MPSolutionResponse.getCPtr(response)), true); 198 return main_research_linear_solverJNI.MPSolver_setSolverSpecificParametersAsString(swigCPtr, this, parameters); 234 return main_research_linear_solverJNI.MPSolver_loadModelFromProto(swigCPtr, this, input_model.toByteArray()); 237 public String loadModelFromProtoWithUniqueNamesOrDie(com.google.ortools.linearsolver.MPModelProto input_model) { 238 return main_research_linear_solverJNI.MPSolver_loadModelFromProtoWithUniqueNamesOrDie(swigCPtr, this, input_model.toByteArray()); 255 byte[] buf = main_research_linear_solverJNI.MPSolver_createSolutionResponseProto(swigCPtr, this); 267 public static com.google.ortools.linearsolver.MPSolutionResponse solveWithProto(com.google.ortools.linearsolver.MPModelRequest model_request) { 268 byte[] buf = main_research_linear_solverJNI.MPSolver_solveWithProto(model_request.toByteArray()); 281 return main_research_linear_solverJNI.MPSolver_exportModelAsLpFormat__SWIG_0(swigCPtr, this, MPModelExportOptions.getCPtr(options), options); 289 return main_research_linear_solverJNI.MPSolver_exportModelAsMpsFormat__SWIG_0(swigCPtr, this, MPModelExportOptions.getCPtr(options), options); 313 CBC_MIXED_INTEGER_PROGRAMMING(main_research_linear_solverJNI.MPSolver_CBC_MIXED_INTEGER_PROGRAMMING_get()), 322 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 327 throw new IllegalArgumentException("No enum " + OptimizationProblemType.class + " with value " + swigValue); 368 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 373 throw new IllegalArgumentException("No enum " + ResultStatus.class + " with value " + swigValue); 402 AT_LOWER_BOUND, 403 AT_UPPER_BOUND, 404 FIXED_VALUE, 405 BASIC; 413 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 418 throw new IllegalArgumentException("No enum " + BasisStatus.class + " with value " + swigValue); static final native long MPSolver_iterations(long jarg1, MPSolver jarg1_) NOT_SOLVED Definition: MPSolver.java:360 final int swigValue() Definition: MPSolver.java:362 131 long cPtr = main_research_linear_solverJNI.MPSolver_lookupVariableOrNull(swigCPtr, this, var_name); 143 long cPtr = main_research_linear_solverJNI.MPSolver_makeVar(swigCPtr, this, lb, ub, integer, name); 195 long cPtr = main_research_linear_solverJNI.MPSolver_lookupConstraintOrNull(swigCPtr, this, constraint_name); 208 long cPtr = main_research_linear_solverJNI.MPSolver_makeConstraint__SWIG_0(swigCPtr, this, lb, ub); 224 long cPtr = main_research_linear_solverJNI.MPSolver_makeConstraint__SWIG_2(swigCPtr, this, lb, ub, name); 232 long cPtr = main_research_linear_solverJNI.MPSolver_makeConstraint__SWIG_3(swigCPtr, this, name); 248 return MPSolver.ResultStatus.swigToEnum(main_research_linear_solverJNI.MPSolver_solve__SWIG_0(swigCPtr, this)); 255 return MPSolver.ResultStatus.swigToEnum(main_research_linear_solverJNI.MPSolver_solve__SWIG_1(swigCPtr, this, MPSolverParameters.getCPtr(param), param)); 287 return main_research_linear_solverJNI.MPSolver_verifySolution(swigCPtr, this, tolerance, log_errors); 345 public SWIGTYPE_p_util__Status loadSolutionFromProto(SWIGTYPE_p_operations_research__MPSolutionResponse response, double tolerance) { 346 return new SWIGTYPE_p_util__Status(main_research_linear_solverJNI.MPSolver_loadSolutionFromProto__SWIG_0(swigCPtr, this, SWIGTYPE_p_operations_research__MPSolutionResponse.getCPtr(response), tolerance), true); 380 public SWIGTYPE_p_util__Status loadSolutionFromProto(SWIGTYPE_p_operations_research__MPSolutionResponse response) { 381 return new SWIGTYPE_p_util__Status(main_research_linear_solverJNI.MPSolver_loadSolutionFromProto__SWIG_1(swigCPtr, this, SWIGTYPE_p_operations_research__MPSolutionResponse.getCPtr(response)), true); 395 return main_research_linear_solverJNI.MPSolver_setSolverSpecificParametersAsString(swigCPtr, this, parameters); 474 return main_research_linear_solverJNI.MPSolver_loadModelFromProto(swigCPtr, this, input_model.toByteArray()); 477 public String loadModelFromProtoWithUniqueNamesOrDie(com.google.ortools.linearsolver.MPModelProto input_model) { 478 return main_research_linear_solverJNI.MPSolver_loadModelFromProtoWithUniqueNamesOrDie(swigCPtr, this, input_model.toByteArray()); 495 byte[] buf = main_research_linear_solverJNI.MPSolver_createSolutionResponseProto(swigCPtr, this); 507 public static com.google.ortools.linearsolver.MPSolutionResponse solveWithProto(com.google.ortools.linearsolver.MPModelRequest model_request) { 508 byte[] buf = main_research_linear_solverJNI.MPSolver_solveWithProto(model_request.toByteArray()); 521 return main_research_linear_solverJNI.MPSolver_exportModelAsLpFormat__SWIG_0(swigCPtr, this, MPModelExportOptions.getCPtr(options), options); 529 return main_research_linear_solverJNI.MPSolver_exportModelAsMpsFormat__SWIG_0(swigCPtr, this, MPModelExportOptions.getCPtr(options), options); 568 CBC_MIXED_INTEGER_PROGRAMMING(main_research_linear_solverJNI.MPSolver_CBC_MIXED_INTEGER_PROGRAMMING_get()), 580 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 585 throw new IllegalArgumentException("No enum " + OptimizationProblemType.class + " with value " + swigValue); 650 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 655 throw new IllegalArgumentException("No enum " + ResultStatus.class + " with value " + swigValue); 688 AT_LOWER_BOUND, 689 AT_UPPER_BOUND, 690 FIXED_VALUE, 691 BASIC; 699 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 704 throw new IllegalArgumentException("No enum " + BasisStatus.class + " with value " + swigValue); static final native long MPSolver_iterations(long jarg1, MPSolver jarg1_) final int swigValue() Definition: MPSolver.java:644 static final native int MPSolver_solve__SWIG_0(long jarg1, MPSolver jarg1_) com.google.ortools.linearsolver.MPSolutionResponse createSolutionResponseProto() Definition: MPSolver.java:254 com.google.ortools.linearsolver.MPSolutionResponse createSolutionResponseProto() Definition: MPSolver.java:494 static final native int MPSolver_CLP_LINEAR_PROGRAMMING_get() CBC_MIXED_INTEGER_PROGRAMMING Definition: MPSolver.java:313 CBC_MIXED_INTEGER_PROGRAMMING Mixed integer Programming Solver using Coin CBC. Definition: MPSolver.java:568 static final native void MPSolver_suppressOutput(long jarg1, MPSolver jarg1_) static final native int MPSolver_numConstraints(long jarg1, MPSolver jarg1_) static final native long MPSolver_makeConstraint__SWIG_1(long jarg1, MPSolver jarg1_) com.google.ortools.linearsolver.MPModelProto exportModelToProto() Definition: MPSolver.java:241 com.google.ortools.linearsolver.MPModelProto exportModelToProto() Definition: MPSolver.java:481 The class for variables of a Mathematical Programming (MP) model. Definition: MPVariable.java:16 static final native int MPSolver_FREE_get() static final native String MPSolver_loadModelFromProtoWithUniqueNamesOrDie(long jarg1, MPSolver jarg1_, byte[] jarg2) static com.google.ortools.linearsolver.MPSolutionResponse parseFrom(java.nio.ByteBuffer data) Definition: MPSolutionResponse.java:585 static double infinity() Definition: MPSolver.java:201 MPVariable [] makeVarArray(int count, double lb, double ub, boolean integer, String var_name) Definition: MPSolver.java:49 MPVariable [] makeVarArray(int count, double lb, double ub, boolean integer, String var_name) Definition: MPSolver.java:53 MPVariable [] makeNumVarArray(int count, double lb, double ub, String var_name) Definition: MPSolver.java:62 boolean setNumThreads(int num_theads) Sets the number of threads to be used by the solver. Definition: MPSolver.java:306 MPVariable [] makeNumVarArray(int count, double lb, double ub, String var_name) Definition: MPSolver.java:66 boolean setNumThreads(int num_theads) Sets the number of threads to be used by the solver. Definition: MPSolver.java:546 static final native MPVariable [] MPSolver_variables(long jarg1, MPSolver jarg1_) boolean interruptSolve() Definition: MPSolver.java:185 MPVariable makeIntVar(double lb, double ub, String name) Definition: MPSolver.java:117 boolean interruptSolve() Interrupts the Solve() execution to terminate processing if possible. Definition: MPSolver.java:310 MPVariable makeIntVar(double lb, double ub, String name) Creates an integer variable. Definition: MPSolver.java:158 static final native byte [] MPSolver_exportModelToProto(long jarg1, MPSolver jarg1_) String loadModelFromProtoWithUniqueNamesOrDie(com.google.ortools.linearsolver.MPModelProto input_model) Definition: MPSolver.java:237 SWIGTYPE_p_util__Status loadSolutionFromProto(SWIGTYPE_p_operations_research__MPSolutionResponse response, double tolerance) Definition: MPSolver.java:189 void setHint(MPVariable[] variables, double[] values) Sets a hint for solution. Definition: MPSolver.java:299 MPConstraint makeConstraint(String name) Definition: MPSolver.java:155 INFEASIBLE Definition: MPSolver.java:357 UNBOUNDED Definition: MPSolver.java:358 String loadModelFromProtoWithUniqueNamesOrDie(com.google.ortools.linearsolver.MPModelProto input_model) Definition: MPSolver.java:477 SWIGTYPE_p_util__Status loadSolutionFromProto(SWIGTYPE_p_operations_research__MPSolutionResponse response, double tolerance) Load a solution encoded in a protocol buffer onto this solver for easy access via the MPSolver inter... Definition: MPSolver.java:345 The status of solving the problem. Definition: MPSolver.java:618 void setHint(MPVariable[] variables, double[] values) Sets a hint for solution. Definition: MPSolver.java:539 MPConstraint makeConstraint(String name) Creates a named constraint with -infinity and +infinity bounds. Definition: MPSolver.java:231 static final native int MPSolver_BOP_INTEGER_PROGRAMMING_get() static final native long MPSolver_makeConstraint__SWIG_0(long jarg1, MPSolver jarg1_, double jarg2, double jarg3) MPConstraint makeConstraint(double lb, double ub, String name) Definition: MPSolver.java:150 MPConstraint makeConstraint(double lb, double ub, String name) Creates a named constraint with given bounds. Definition: MPSolver.java:223 static final native String MPSolver_loadModelFromProto(long jarg1, MPSolver jarg1_, byte[] jarg2) void setTimeLimit(long time_limit_milliseconds) Definition: MPSolver.java:225 MPVariable [] makeBoolVarArray(int count) Definition: MPSolver.java:74 void setTimeLimit(long time_limit_milliseconds) Definition: MPSolver.java:465 MPVariable [] makeBoolVarArray(int count) Definition: MPSolver.java:78 static final native String MPSolver_exportModelAsLpFormat__SWIG_1(long jarg1, MPSolver jarg1_) void enableOutput() Definition: MPSolver.java:205 String exportModelAsLpFormat(MPModelExportOptions options) Definition: MPSolver.java:280 The class for constraints of a Mathematical Programming (MP) model. Definition: MPConstraint.java:18 String exportModelAsLpFormat(MPModelExportOptions options) Definition: MPSolver.java:520 static final native boolean MPSolver_supportsProblemType(int jarg1) static final native long MPSolver_makeIntVar(long jarg1, MPSolver jarg1_, double jarg2, double jarg3, String jarg4) static final native boolean MPSolver_setSolverSpecificParametersAsString(long jarg1, MPSolver jarg1_, String jarg2) static com.google.ortools.linearsolver.MPSolutionResponse solveWithProto(com.google.ortools.linearsolver.MPModelRequest model_request) Definition: MPSolver.java:267 static BasisStatus swigToEnum(int swigValue) Definition: MPSolver.java:411 static com.google.ortools.linearsolver.MPSolutionResponse solveWithProto(com.google.ortools.linearsolver.MPModelRequest model_request) Definition: MPSolver.java:507 static BasisStatus swigToEnum(int swigValue) Definition: MPSolver.java:697 static final native long MPSolver_loadSolutionFromProto__SWIG_0(long jarg1, MPSolver jarg1_, long jarg2, double jarg3) final int swigValue() Definition: MPSolver.java:316 MPConstraint [] constraints() Definition: MPSolver.java:131 MPVariable [] makeIntVarArray(int count, double lb, double ub) Definition: MPSolver.java:66 MPSolver.ResultStatus solve() Definition: MPSolver.java:165 MPVariable [] makeVarArray(int count, double lb, double ub, boolean integer) Definition: MPSolver.java:41 final int swigValue() Definition: MPSolver.java:574 MPConstraint [] constraints() Returns the array of constraints handled by the MPSolver. Definition: MPSolver.java:183 MPVariable [] makeIntVarArray(int count, double lb, double ub) Definition: MPSolver.java:70 MPSolver.ResultStatus solve() Solves the problem using default parameter values. Definition: MPSolver.java:247 MPVariable [] makeVarArray(int count, double lb, double ub, boolean integer) Definition: MPSolver.java:45 static final native void MPSolver_setHint(long jarg1, MPSolver jarg1_, MPVariable[] jarg2, double[] jarg3) static final native byte [] MPSolver_solveWithProto(byte[] jarg1) int numConstraints() Definition: MPSolver.java:127 SWIGTYPE_p_util__Status loadSolutionFromProto(SWIGTYPE_p_operations_research__MPSolutionResponse response) Definition: MPSolver.java:193 SWIGTYPE_p_util__Status loadSolutionFromProto(SWIGTYPE_p_operations_research__MPSolutionResponse response) Load a solution encoded in a protocol buffer onto this solver for easy access via the MPSolver inter... Definition: MPSolver.java:380 static final native String MPSolver_exportModelAsMpsFormat__SWIG_1(long jarg1, MPSolver jarg1_) static final native void MPSolver_setTimeLimit(long jarg1, MPSolver jarg1_, long jarg2) MPConstraint makeConstraint(double lb, double ub) Definition: MPSolver.java:140 MPConstraint makeConstraint(double lb, double ub) Creates a linear constraint with given bounds. Definition: MPSolver.java:207 static final native int MPSolver_solve__SWIG_1(long jarg1, MPSolver jarg1_, long jarg2, MPSolverParameters jarg2_) MPSolver(long cPtr, boolean cMemoryOwn) Definition: MPSolver.java:17 MPSolver(long cPtr, boolean cMemoryOwn) Definition: MPSolver.java:21 static final native long MPSolver_makeConstraint__SWIG_2(long jarg1, MPSolver jarg1_, double jarg2, double jarg3, String jarg4) This mathematical programming (MP) solver class is the main class though which users build and solve... Definition: MPSolver.java:17 Protobuf type. Definition: MPSolutionResponse.java:9 static final native int MPSolver_NOT_SOLVED_get() MPVariable [] makeBoolVarArray(int count, String var_name) Definition: MPSolver.java:78 MPVariable [] makeBoolVarArray(int count, String var_name) Definition: MPSolver.java:82 double [] computeConstraintActivities() Definition: MPSolver.java:173 MPSolver(String name, MPSolver.OptimizationProblemType problem_type) Definition: MPSolver.java:82 MPConstraint makeConstraint() Definition: MPSolver.java:145 double [] computeConstraintActivities() Advanced usage: compute the "activities" of all constraints, which are the sums of their linear term... Definition: MPSolver.java:264 MPSolver(String name, MPSolver.OptimizationProblemType problem_type) Create a solver with the given name and underlying solver backend. Definition: MPSolver.java:89 MPConstraint makeConstraint() Creates a constraint with -infinity and +infinity bounds. Definition: MPSolver.java:215 static final native int MPSolver_GLOP_LINEAR_PROGRAMMING_get() static final native void MPSolver_reset(long jarg1, MPSolver jarg1_) MPVariable [] makeIntVarArray(int count, double lb, double ub, String var_name) Definition: MPSolver.java:70 MPSolver.ResultStatus solve(MPSolverParameters param) Definition: MPSolver.java:169 MPVariable [] makeIntVarArray(int count, double lb, double ub, String var_name) Definition: MPSolver.java:74 MPSolver.ResultStatus solve(MPSolverParameters param) Solves the problem using the specified parameter values. Definition: MPSolver.java:254 static final native boolean MPSolver_setNumThreads(long jarg1, MPSolver jarg1_, int jarg2) String exportModelAsMpsFormat(MPModelExportOptions options) Definition: MPSolver.java:288 String exportModelAsMpsFormat(MPModelExportOptions options) Definition: MPSolver.java:528 static final native MPConstraint [] MPSolver_constraints(long jarg1, MPSolver jarg1_) BOP_INTEGER_PROGRAMMING Definition: MPSolver.java:314 static ResultStatus swigToEnum(int swigValue) Definition: MPSolver.java:366 static ResultStatus swigToEnum(int swigValue) Definition: MPSolver.java:648 The type of problems (LP or MIP) that will be solved and the underlying solver (GLOP,... Definition: MPSolver.java:556 static final native long MPSolver_makeBoolVar(long jarg1, MPSolver jarg1_, String jarg2) static boolean supportsProblemType(MPSolver.OptimizationProblemType problem_type) Definition: MPSolver.java:86 static boolean supportsProblemType(MPSolver.OptimizationProblemType problem_type) Whether the given problem type is supported (this will depend on the targets that you linked). Definition: MPSolver.java:97 long nodes() Returns the number of branch-and-bound nodes evaluated during the solve. Definition: MPSolver.java:433 Advanced usage: possible basis status values for a variable and the slack variable of a linear const... Definition: MPSolver.java:686 static final native String MPSolver_exportModelAsMpsFormat__SWIG_0(long jarg1, MPSolver jarg1_, long jarg2, MPModelExportOptions jarg2_) MPVariable makeVar(double lb, double ub, boolean integer, String name) Definition: MPSolver.java:107 This class stores parameter settings for LP and MIP solvers. Definition: MPSolverParameters.java:39 MPVariable makeVar(double lb, double ub, boolean integer, String name) Creates a variable with the given bounds, integrality requirement and name. Definition: MPSolver.java:142 static final native void MPSolver_enableOutput(long jarg1, MPSolver jarg1_) boolean setSolverSpecificParametersAsString(String parameters) Definition: MPSolver.java:197 boolean setSolverSpecificParametersAsString(String parameters) Advanced usage: pass solver specific parameters in text format. Definition: MPSolver.java:394 static final native double MPSolver_infinity() boolean verifySolution(double tolerance, boolean log_errors) Definition: MPSolver.java:177 void clear() Clears the objective (including the optimization direction), all variables and constraints. Definition: MPSolver.java:106 boolean verifySolution(double tolerance, boolean log_errors) Advanced usage: Verifies the correctness of the solution. Definition: MPSolver.java:286 static final native long MPSolver_objective(long jarg1, MPSolver jarg1_) String exportModelAsLpFormat() Definition: MPSolver.java:284 String loadModelFromProto(com.google.ortools.linearsolver.MPModelProto input_model) Definition: MPSolver.java:233 String exportModelAsLpFormat() Definition: MPSolver.java:524 String loadModelFromProto(com.google.ortools.linearsolver.MPModelProto input_model) Definition: MPSolver.java:473 static final native boolean MPSolver_verifySolution(long jarg1, MPSolver jarg1_, double jarg2, boolean jarg3) MPVariable [] variables() Definition: MPSolver.java:98 MPVariable [] variables() Returns the array of variables handled by the MPSolver. Definition: MPSolver.java:121 static final native long MPSolver_loadSolutionFromProto__SWIG_1(long jarg1, MPSolver jarg1_, long jarg2) Definition: main_research_linear_solverJNI.java:11 static final native long MPSolver_makeConstraint__SWIG_3(long jarg1, MPSolver jarg1_, String jarg2) GLOP_LINEAR_PROGRAMMING Definition: MPSolver.java:312 MPObjective objective() Definition: MPSolver.java:160 CLP_LINEAR_PROGRAMMING Definition: MPSolver.java:311 MPVariable makeNumVar(double lb, double ub, String name) Definition: MPSolver.java:112 MPConstraint lookupConstraintOrNull(String constraint_name) Definition: MPSolver.java:135 GLOP_LINEAR_PROGRAMMING Linear Programming solver using GLOP (Recommended solver). Definition: MPSolver.java:564 A class to express a linear objective. Definition: MPObjective.java:16 void reset() Advanced usage: resets extracted model to solve from scratch. Definition: MPSolver.java:298 MPVariable makeNumVar(double lb, double ub, String name) Creates a continuous variable. Definition: MPSolver.java:150 MPConstraint lookupConstraintOrNull(String constraint_name) Looks up a constraint by name, and returns nullptr if it does not exist. Definition: MPSolver.java:194 static final native int MPSolver_CBC_MIXED_INTEGER_PROGRAMMING_get() void suppressOutput() Definition: MPSolver.java:209 static final native long MPSolver_wallTime(long jarg1, MPSolver jarg1_) static final native long new_MPSolver(String jarg1, int jarg2) MPVariable [] makeNumVarArray(int count, double lb, double ub) Definition: MPSolver.java:58 MPVariable makeBoolVar(String name) Definition: MPSolver.java:122 MPVariable [] makeNumVarArray(int count, double lb, double ub) Definition: MPSolver.java:62 static final native long MPSolver_lookupVariableOrNull(long jarg1, MPSolver jarg1_, String jarg2) static final native long MPSolver_makeVar(long jarg1, MPSolver jarg1_, double jarg2, double jarg3, boolean jarg4, String jarg5) static final native double [] MPSolver_computeConstraintActivities(long jarg1, MPSolver jarg1_) static final native void MPSolver_clear(long jarg1, MPSolver jarg1_) static final native long MPSolver_lookupConstraintOrNull(long jarg1, MPSolver jarg1_, String jarg2) static OptimizationProblemType swigToEnum(int swigValue) Definition: MPSolver.java:320 static OptimizationProblemType swigToEnum(int swigValue) Definition: MPSolver.java:578 static final native String MPSolver_exportModelAsLpFormat__SWIG_0(long jarg1, MPSolver jarg1_, long jarg2, MPModelExportOptions jarg2_) static com.google.ortools.linearsolver.MPModelProto parseFrom(java.nio.ByteBuffer data) Definition: MPModelProto.java:644 static final native int MPSolver_numVariables(long jarg1, MPSolver jarg1_) MPVariable lookupVariableOrNull(String var_name) Definition: MPSolver.java:102 String exportModelAsMpsFormat() Definition: MPSolver.java:292 MPVariable lookupVariableOrNull(String var_name) Looks up a variable by name, and returns nullptr if it does not exist. Definition: MPSolver.java:130 String exportModelAsMpsFormat() Definition: MPSolver.java:532 static final native void delete_MPSolver(long jarg1) double computeExactConditionNumber() Definition: MPSolver.java:221 double computeExactConditionNumber() Advanced usage: computes the exact condition number of the current scaled basis: L1norm(B) * L1norm(... Definition: MPSolver.java:461 static final native long MPSolver_nodes(long jarg1, MPSolver jarg1_) static final native boolean MPSolver_interruptSolve(long jarg1, MPSolver jarg1_) static final native long MPSolver_makeNumVar(long jarg1, MPSolver jarg1_, double jarg2, double jarg3, String jarg4) final int swigValue() Definition: MPSolver.java:407 final int swigValue() Definition: MPSolver.java:693 static final native double MPSolver_computeExactConditionNumber(long jarg1, MPSolver jarg1_) static final native byte [] MPSolver_createSolutionResponseProto(long jarg1, MPSolver jarg1_) Classesclass | com.google.ortools.linearsolver.MPVariable | | The class for variables of a Mathematical Programming (MP) model. More... | | | ||||
diff --git a/docs/java/MPVariable_8java_source.html b/docs/java/MPVariable_8java_source.html
index 372a3b9a48..4c5eb7fd50 100644
--- a/docs/java/MPVariable_8java_source.html
+++ b/docs/java/MPVariable_8java_source.html
@@ -41,34 +41,34 @@
82 return MPSolver.BasisStatus.swigToEnum(main_research_linear_solverJNI.MPVariable_basisStatus(swigCPtr, this)); static final native double MPVariable_reducedCost(long jarg1, MPVariable jarg1_) 125 return MPSolver.BasisStatus.swigToEnum(main_research_linear_solverJNI.MPVariable_basisStatus(swigCPtr, this)); static final native double MPVariable_reducedCost(long jarg1, MPVariable jarg1_) The class for variables of a Mathematical Programming (MP) model. Definition: MPVariable.java:16 static final native int MPVariable_index(long jarg1, MPVariable jarg1_) MPVariable(long cPtr, boolean cMemoryOwn) Definition: MPVariable.java:17 void setBounds(double lb, double ub) Definition: MPVariable.java:73 MPVariable(long cPtr, boolean cMemoryOwn) Definition: MPVariable.java:20 void setBounds(double lb, double ub) Sets both the lower and upper bounds. Definition: MPVariable.java:107 static final native double MPVariable_lb(long jarg1, MPVariable jarg1_) static BasisStatus swigToEnum(int swigValue) Definition: MPSolver.java:411 static BasisStatus swigToEnum(int swigValue) Definition: MPSolver.java:697 int index() Returns the index of the variable in the MPSolver::variables_. Definition: MPVariable.java:72 static final native double MPVariable_solutionValue(long jarg1, MPVariable jarg1_) This mathematical programming (MP) solver class is the main class though which users build and solve... Definition: MPSolver.java:17 static final native void MPVariable_setLb(long jarg1, MPVariable jarg1_, double jarg2) double solutionValue() Definition: MPVariable.java:49 double reducedCost() Definition: MPVariable.java:77 double solutionValue() Returns the value of the variable in the current solution. Definition: MPVariable.java:65 Advanced usage: possible basis status values for a variable and the slack variable of a linear const... Definition: MPSolver.java:686 double reducedCost() Advanced usage: returns the reduced cost of the variable in the current solution (only available for... Definition: MPVariable.java:115 static final native void MPVariable_setInteger(long jarg1, MPVariable jarg1_, boolean jarg2) static final native int MPVariable_basisStatus(long jarg1, MPVariable jarg1_) static final native void MPVariable_setUb(long jarg1, MPVariable jarg1_, double jarg2) Definition: main_research_linear_solverJNI.java:11 static final native void delete_MPVariable(long jarg1) static final native double MPVariable_ub(long jarg1, MPVariable jarg1_) static final native void MPVariable_setBounds(long jarg1, MPVariable jarg1_, double jarg2, double jarg3) MPSolver.BasisStatus basisStatus() Definition: MPVariable.java:81 void setInteger(boolean integer) Definition: MPVariable.java:45 MPSolver.BasisStatus basisStatus() Advanced usage: returns the basis status of the variable in the current solution (only available for ... Definition: MPVariable.java:124 void setInteger(boolean integer) Sets the integrality requirement of the variable. Definition: MPVariable.java:54 static final native String MPVariable_name(long jarg1, MPVariable jarg1_) Detailed Description-
- Definition at line 13 of file MPConstraint.java. +The class for constraints of a Mathematical Programming (MP) model. +
Definition at line 18 of file MPConstraint.java.
-
Definition at line 17 of file MPConstraint.java. +Definition at line 22 of file MPConstraint.java. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Definition at line 89 of file MPConstraint.java.
+Advanced usage: returns the basis status of the constraint.
+
+
+ It is only available for continuous problems).
+
+ Note that if a constraint "linear_expression in [lb, ub]" is transformed
+ into "linear_expression + slack = 0" with slack in [-ub, -lb], then this
+ status is the same as the status of the slack variable with AT_UPPER_BOUND
+ and AT_LOWER_BOUND swapped.
+
+
Definition at line 156 of file MPConstraint.java.
Definition at line 31 of file MPConstraint.java.
+Definition at line 36 of file MPConstraint.java.
Definition at line 85 of file MPConstraint.java.
+Advanced usage: returns the dual value of the constraint in the current
+ solution (only available for continuous problems).
Definition at line 140 of file MPConstraint.java.
Definition at line 49 of file MPConstraint.java.
+Gets the coefficient of a given variable on the constraint (which is 0 if
+ the variable does not appear in the constraint).
Definition at line 67 of file MPConstraint.java.
Definition at line 81 of file MPConstraint.java.
+Returns the index of the constraint in the MPSolver::constraints_.
+ +Definition at line 132 of file MPConstraint.java.
Definition at line 73 of file MPConstraint.java.
+Advanced usage: returns true if the constraint is "lazy" (see below).
+ +Definition at line 109 of file MPConstraint.java.
Definition at line 53 of file MPConstraint.java.
+Returns the lower bound.
+ +Definition at line 74 of file MPConstraint.java.
Definition at line 41 of file MPConstraint.java.
+Returns the name of the constraint.
+ +Definition at line 49 of file MPConstraint.java.
Definition at line 69 of file MPConstraint.java.
+Sets both the lower and upper bounds.
+ +Definition at line 102 of file MPConstraint.java.
Definition at line 45 of file MPConstraint.java.
+Sets the coefficient of the variable on the constraint.
+
+
+ If the variable does not belong to the solver, the function just returns,
+ or crashes in non-opt mode.
Definition at line 59 of file MPConstraint.java.
Definition at line 77 of file MPConstraint.java.
+Advanced usage: sets the constraint "laziness".
+
+
+ This is only supported for SCIP and has no effect on other solvers.
+
+ When laziness is true, the constraint is only considered by the Linear
+ Programming solver if its current solution violates the constraint. In this
+ case, the constraint is definitively added to the problem. This may be
+ useful in some MIP problems, and may have a dramatic impact on performance.
+
+ For more info see: http://tinyurl.com/lazy-constraints.
Definition at line 125 of file MPConstraint.java.
Definition at line 61 of file MPConstraint.java.
+Sets the lower bound.
+ +Definition at line 88 of file MPConstraint.java.
Definition at line 65 of file MPConstraint.java.
+Sets the upper bound.
+ +Definition at line 95 of file MPConstraint.java.
Definition at line 57 of file MPConstraint.java.
+Returns the upper bound.
+ +Definition at line 81 of file MPConstraint.java.
-If this is set, then EnableOutput() will be set on the internal MPSolver +If this is set, then EnableOutput() will be set on the internal MPSolver that solves the model. WARNING: if you set this on a request to prod servers, it will be rejected and yield the RPC Application Error code MPSOLVER_SOLVER_TYPE_UNAVAILABLE. @@ -630,7 +630,7 @@ If not specified, the time limit on the solver is the RPC's deadline_left.
-If this is set, then EnableOutput() will be set on the internal MPSolver +If this is set, then EnableOutput() will be set on the internal MPSolver that solves the model. WARNING: if you set this on a request to prod servers, it will be rejected and yield the RPC Application Error code MPSOLVER_SOLVER_TYPE_UNAVAILABLE. diff --git a/docs/java/classcom_1_1google_1_1ortools_1_1linearsolver_1_1MPModelRequest_1_1Builder.html b/docs/java/classcom_1_1google_1_1ortools_1_1linearsolver_1_1MPModelRequest_1_1Builder.html index 1b02775a09..96669dd160 100644 --- a/docs/java/classcom_1_1google_1_1ortools_1_1linearsolver_1_1MPModelRequest_1_1Builder.html +++ b/docs/java/classcom_1_1google_1_1ortools_1_1linearsolver_1_1MPModelRequest_1_1Builder.html @@ -292,7 +292,7 @@ Protected Member Functions
-If this is set, then EnableOutput() will be set on the internal MPSolver +If this is set, then EnableOutput() will be set on the internal MPSolver that solves the model. WARNING: if you set this on a request to prod servers, it will be rejected and yield the RPC Application Error code MPSOLVER_SOLVER_TYPE_UNAVAILABLE. @@ -623,7 +623,7 @@ If not specified, the time limit on the solver is the RPC's deadline_left.
-If this is set, then EnableOutput() will be set on the internal MPSolver +If this is set, then EnableOutput() will be set on the internal MPSolver that solves the model. WARNING: if you set this on a request to prod servers, it will be rejected and yield the RPC Application Error code MPSOLVER_SOLVER_TYPE_UNAVAILABLE. @@ -903,7 +903,7 @@ If not specified, the time limit on the solver is the RPC's deadline_left.
-If this is set, then EnableOutput() will be set on the internal MPSolver +If this is set, then EnableOutput() will be set on the internal MPSolver that solves the model. WARNING: if you set this on a request to prod servers, it will be rejected and yield the RPC Application Error code MPSOLVER_SOLVER_TYPE_UNAVAILABLE. @@ -1288,7 +1288,7 @@ The model to be optimized by the server.
-If this is set, then EnableOutput() will be set on the internal MPSolver +If this is set, then EnableOutput() will be set on the internal MPSolver that solves the model. WARNING: if you set this on a request to prod servers, it will be rejected and yield the RPC Application Error code MPSOLVER_SOLVER_TYPE_UNAVAILABLE. diff --git a/docs/java/classcom_1_1google_1_1ortools_1_1linearsolver_1_1MPObjective.html b/docs/java/classcom_1_1google_1_1ortools_1_1linearsolver_1_1MPObjective.html index 3c65b2503e..2f30e184bc 100644 --- a/docs/java/classcom_1_1google_1_1ortools_1_1linearsolver_1_1MPObjective.html +++ b/docs/java/classcom_1_1google_1_1ortools_1_1linearsolver_1_1MPObjective.html @@ -41,36 +41,52 @@
Definition at line 13 of file MPObjective.java.
+A class to express a linear objective.
+ +Definition at line 16 of file MPObjective.java.
Public Member Functions | |
| synchronized void | delete () |
| void | clear () |
| Clears the offset, all variables and coefficients, and the optimization + direction. More... | |
| void | setCoefficient (MPVariable var, double coeff) |
| Sets the coefficient of the variable in the objective. More... | |
| double | getCoefficient (MPVariable var) |
| Gets the coefficient of a given variable in the objective + + It returns 0 if the variable does not appear in the objective). More... | |
| void | setOffset (double value) |
| Sets the constant term in the objective. More... | |
| double | offset () |
| Gets the constant term in the objective. More... | |
| void | setOptimizationDirection (boolean maximize) |
| Sets the optimization direction (maximize: true or minimize: false). More... | |
| void | setMinimization () |
| Sets the optimization direction to minimize. More... | |
| void | setMaximization () |
| Sets the optimization direction to maximize. More... | |
| boolean | maximization () |
| Is the optimization direction set to maximize? More... | |
| boolean | minimization () |
| Is the optimization direction set to minimize? More... | |
| double | value () |
| Returns the objective value of the best solution found so far. More... | |
| double | bestBound () |
| Returns the best objective bound. More... | |
@@ -113,7 +129,7 @@ Protected Member Functions |
Definition at line 17 of file MPObjective.java.
+Definition at line 20 of file MPObjective.java.
Definition at line 85 of file MPObjective.java.
+Returns the best objective bound.
+
+
+ In case of minimization, it is a lower bound on the objective value of the
+ optimal integer solution. Only available for discrete problems.
Definition at line 141 of file MPObjective.java.
Definition at line 41 of file MPObjective.java.
+Clears the offset, all variables and coefficients, and the optimization
+ direction.
Definition at line 48 of file MPObjective.java.
Definition at line 31 of file MPObjective.java.
+Definition at line 34 of file MPObjective.java.
Definition at line 49 of file MPObjective.java.
+Gets the coefficient of a given variable in the objective
+
+ It returns 0 if the variable does not appear in the objective).
Definition at line 67 of file MPObjective.java.
Definition at line 73 of file MPObjective.java.
+Is the optimization direction set to maximize?
+ +Definition at line 109 of file MPObjective.java.
Definition at line 77 of file MPObjective.java.
+Is the optimization direction set to minimize?
+ +Definition at line 116 of file MPObjective.java.
Definition at line 57 of file MPObjective.java.
+Gets the constant term in the objective.
+ +Definition at line 81 of file MPObjective.java.
Definition at line 45 of file MPObjective.java.
+Sets the coefficient of the variable in the objective.
+
+
+ If the variable does not belong to the solver, the function just returns,
+ or crashes in non-opt mode.
Definition at line 58 of file MPObjective.java.
Definition at line 69 of file MPObjective.java.
+Sets the optimization direction to maximize.
+ +Definition at line 102 of file MPObjective.java.
Definition at line 65 of file MPObjective.java.
+Sets the optimization direction to minimize.
+ +Definition at line 95 of file MPObjective.java.
Definition at line 53 of file MPObjective.java.
+Sets the constant term in the objective.
+ +Definition at line 74 of file MPObjective.java.
Definition at line 61 of file MPObjective.java.
+Sets the optimization direction (maximize: true or minimize: false).
+ +Definition at line 88 of file MPObjective.java.
Definition at line 81 of file MPObjective.java.
+Returns the objective value of the best solution found so far.
+
+
+ It is the optimal objective value if the problem has been solved to
+ optimality.
+
+ Note: the objective value may be slightly different than what you could
+ compute yourself using MPVariable::solution_value(); please use the
+ –verify_solution flag to gain confidence about the numerical stability of
+ your solution.
Definition at line 131 of file MPObjective.java.
Definition at line 13 of file MPSolver.java.
+This mathematical programming (MP) solver class is the main class
+ though which users build and solve problems.
Definition at line 17 of file MPSolver.java.
Classes | |
| enum | BasisStatus |
| Advanced usage: possible basis status values for a variable and the slack + variable of a linear constraint. More... | |
| enum | OptimizationProblemType |
| The type of problems (LP or MIP) that will be solved and the underlying + solver (GLOP, GLPK, CLP, CBC or SCIP) that will solve them. More... | |
| enum | ResultStatus |
| The status of solving the problem. More... | |
@@ -76,66 +83,103 @@ Public Member Functions | |
| MPVariable [] | makeBoolVarArray (int count, String var_name) |
| MPSolver (String name, MPSolver.OptimizationProblemType problem_type) | |
| Create a solver with the given name and underlying solver backend. More... | |
| void | clear () |
| Clears the objective (including the optimization direction), all variables + and constraints. More... | |
| int | numVariables () |
| Returns the number of variables. More... | |
| MPVariable [] | variables () |
| Returns the array of variables handled by the MPSolver. More... | |
| MPVariable | lookupVariableOrNull (String var_name) |
| Looks up a variable by name, and returns nullptr if it does not exist. More... | |
| MPVariable | makeVar (double lb, double ub, boolean integer, String name) |
| Creates a variable with the given bounds, integrality requirement and + name. More... | |
| MPVariable | makeNumVar (double lb, double ub, String name) |
| Creates a continuous variable. More... | |
| MPVariable | makeIntVar (double lb, double ub, String name) |
| Creates an integer variable. More... | |
| MPVariable | makeBoolVar (String name) |
| Creates a boolean variable. More... | |
| int | numConstraints () |
| Returns the number of constraints. More... | |
| MPConstraint [] | constraints () |
| Returns the array of constraints handled by the MPSolver. More... | |
| MPConstraint | lookupConstraintOrNull (String constraint_name) |
| Looks up a constraint by name, and returns nullptr if it does not exist. More... | |
| MPConstraint | makeConstraint (double lb, double ub) |
| Creates a linear constraint with given bounds. More... | |
| MPConstraint | makeConstraint () |
| Creates a constraint with -infinity and +infinity bounds. More... | |
| MPConstraint | makeConstraint (double lb, double ub, String name) |
| Creates a named constraint with given bounds. More... | |
| MPConstraint | makeConstraint (String name) |
| Creates a named constraint with -infinity and +infinity bounds. More... | |
| MPObjective | objective () |
| Returns the mutable objective object. More... | |
| MPSolver.ResultStatus | solve () |
| Solves the problem using default parameter values. More... | |
| MPSolver.ResultStatus | solve (MPSolverParameters param) |
| Solves the problem using the specified parameter values. More... | |
| double [] | computeConstraintActivities () |
| Advanced usage: compute the "activities" of all constraints, which are the + sums of their linear terms. More... | |
| boolean | verifySolution (double tolerance, boolean log_errors) |
| Advanced usage: Verifies the correctness of the solution. More... | |
| void | reset () |
| Advanced usage: resets extracted model to solve from scratch. More... | |
| boolean | interruptSolve () |
| Interrupts the Solve() execution to terminate processing if possible. More... | |
| SWIGTYPE_p_util__Status | loadSolutionFromProto (SWIGTYPE_p_operations_research__MPSolutionResponse response, double tolerance) |
| Load a solution encoded in a protocol buffer onto this solver for easy + access via the MPSolver interface. More... | |
| SWIGTYPE_p_util__Status | loadSolutionFromProto (SWIGTYPE_p_operations_research__MPSolutionResponse response) |
| Load a solution encoded in a protocol buffer onto this solver for easy + access via the MPSolver interface. More... | |
| boolean | setSolverSpecificParametersAsString (String parameters) |
| Advanced usage: pass solver specific parameters in text format. More... | |
| void | enableOutput () |
| Enable output. More... | |
| void | suppressOutput () |
| Suppress output. More... | |
| long | iterations () |
| Returns the number of simplex iterations. More... | |
| long | nodes () |
| Returns the number of branch-and-bound nodes evaluated during the solve. More... | |
| double | computeExactConditionNumber () |
| Advanced usage: computes the exact condition number of the current scaled + basis: L1norm(B) * L1norm(inverse(B)), where B is the scaled basis. More... | |
| void | setTimeLimit (long time_limit_milliseconds) |
Static Public Member Functions | |
| static boolean | supportsProblemType (MPSolver.OptimizationProblemType problem_type) |
| Whether the given problem type is supported (this will depend on the + targets that you linked). More... | |
| static double | infinity () |
| Infinity. More... | |
| static com.google.ortools.linearsolver.MPSolutionResponse | solveWithProto (com.google.ortools.linearsolver.MPModelRequest model_request) |
Definition at line 17 of file MPSolver.java.
+Definition at line 21 of file MPSolver.java.
Definition at line 82 of file MPSolver.java.
+Create a solver with the given name and underlying solver backend.
+ +Definition at line 89 of file MPSolver.java.
Definition at line 90 of file MPSolver.java.
+Clears the objective (including the optimization direction), all variables
+ and constraints.
All the other properties of the MPSolver (like the time
+ limit) are kept untouched.
Definition at line 106 of file MPSolver.java.
Definition at line 173 of file MPSolver.java.
+Advanced usage: compute the "activities" of all constraints, which are the
+ sums of their linear terms.
The activities are returned in the same order
+ as constraints(), which is the order in which constraints were added; but
+ you can also use MPConstraint::index() to get a constraint's index.
Definition at line 264 of file MPSolver.java.
Definition at line 221 of file MPSolver.java.
+Advanced usage: computes the exact condition number of the current scaled
+ basis: L1norm(B) * L1norm(inverse(B)), where B is the scaled basis.
+
+ This method requires that a basis exists: it should be called after Solve.
+ It is only available for continuous problems. It is implemented for GLPK
+ but not CLP because CLP does not provide the API for doing it.
+
+ The condition number measures how well the constraint matrix is conditioned
+ and can be used to predict whether numerical issues will arise during the
+ solve: the model is declared infeasible whereas it is feasible (or
+ vice-versa), the solution obtained is not optimal or violates some
+ constraints, the resolution is slow because of repeated singularities.
+
+ The rule of thumb to interpret the condition number kappa is:
+
Definition at line 461 of file MPSolver.java.
Definition at line 131 of file MPSolver.java.
+Returns the array of constraints handled by the MPSolver.
+
+
+ They are listed in the order in which they were created.
Definition at line 183 of file MPSolver.java.
Definition at line 254 of file MPSolver.java.
+Definition at line 494 of file MPSolver.java.
Definition at line 31 of file MPSolver.java.
+Definition at line 35 of file MPSolver.java.
Definition at line 205 of file MPSolver.java.
+Enable output.
+ +Definition at line 410 of file MPSolver.java.
Definition at line 280 of file MPSolver.java.
+Definition at line 520 of file MPSolver.java.
Definition at line 284 of file MPSolver.java.
+Definition at line 524 of file MPSolver.java.
Definition at line 288 of file MPSolver.java.
+Definition at line 528 of file MPSolver.java.
Definition at line 292 of file MPSolver.java.
+Definition at line 532 of file MPSolver.java.
Definition at line 241 of file MPSolver.java.
+Definition at line 481 of file MPSolver.java.
Definition at line 201 of file MPSolver.java.
+Infinity.
+
+
+ You can use -MPSolver::infinity() for negative infinity.
Definition at line 403 of file MPSolver.java.
Definition at line 185 of file MPSolver.java.
+Interrupts the Solve() execution to terminate processing if possible.
+
+
+ If the underlying interface supports interruption; it does that and returns
+ true regardless of whether there's an ongoing Solve() or not. The Solve()
+ call may still linger for a while depending on the conditions. If
+ interruption is not supported; returns false and does nothing.
Definition at line 310 of file MPSolver.java.
Definition at line 213 of file MPSolver.java.
+Returns the number of simplex iterations.
+ +Definition at line 424 of file MPSolver.java.
Definition at line 233 of file MPSolver.java.
+Definition at line 473 of file MPSolver.java.
Definition at line 237 of file MPSolver.java.
+Definition at line 477 of file MPSolver.java.
Definition at line 189 of file MPSolver.java.
+Load a solution encoded in a protocol buffer onto this solver for easy
+ access via the MPSolver interface.
+
+ IMPORTANT: This may only be used in conjunction with ExportModel(),
+ following this example:
+
+
+
+ The response must be in OPTIMAL or FEASIBLE status.
+
+ Returns a non-OK status if a problem arised (typically, if it wasn't used
+ like it should be):
+
Definition at line 345 of file MPSolver.java.
Definition at line 193 of file MPSolver.java.
+Load a solution encoded in a protocol buffer onto this solver for easy
+ access via the MPSolver interface.
+
+ IMPORTANT: This may only be used in conjunction with ExportModel(),
+ following this example:
+
+
+
+ The response must be in OPTIMAL or FEASIBLE status.
+
+ Returns a non-OK status if a problem arised (typically, if it wasn't used
+ like it should be):
+
Definition at line 380 of file MPSolver.java.
Definition at line 135 of file MPSolver.java.
+Looks up a constraint by name, and returns nullptr if it does not exist.
+
+
+ The first call has a O(n) complexity, as the constraint name index is
+ lazily created upon first use. Will crash if constraint names are not
+ unique.
Definition at line 194 of file MPSolver.java.
Definition at line 102 of file MPSolver.java.
+Looks up a variable by name, and returns nullptr if it does not exist.
+The
+ first call has a O(n) complexity, as the variable name index is lazily
+ created upon first use. Will crash if variable names are not unique.
Definition at line 130 of file MPSolver.java.
Definition at line 122 of file MPSolver.java.
+Creates a boolean variable.
+ +Definition at line 166 of file MPSolver.java.
Definition at line 74 of file MPSolver.java.
+Definition at line 78 of file MPSolver.java.
Definition at line 78 of file MPSolver.java.
+Definition at line 82 of file MPSolver.java.
Definition at line 140 of file MPSolver.java.
+Creates a linear constraint with given bounds.
+
+
+ Bounds can be finite or +/- MPSolver::infinity(). The MPSolver class
+ assumes ownership of the constraint.
+
+
Definition at line 207 of file MPSolver.java.
Definition at line 145 of file MPSolver.java.
+Creates a constraint with -infinity and +infinity bounds.
+ +Definition at line 215 of file MPSolver.java.
Definition at line 150 of file MPSolver.java.
+Creates a named constraint with given bounds.
+ +Definition at line 223 of file MPSolver.java.
Definition at line 155 of file MPSolver.java.
+Creates a named constraint with -infinity and +infinity bounds.
+ +Definition at line 231 of file MPSolver.java.
Definition at line 117 of file MPSolver.java.
+Creates an integer variable.
+ +Definition at line 158 of file MPSolver.java.
Definition at line 66 of file MPSolver.java.
+Definition at line 70 of file MPSolver.java.
Definition at line 70 of file MPSolver.java.
+Definition at line 74 of file MPSolver.java.
Definition at line 112 of file MPSolver.java.
+Creates a continuous variable.
+ +Definition at line 150 of file MPSolver.java.
Definition at line 58 of file MPSolver.java.
+Definition at line 62 of file MPSolver.java.
Definition at line 62 of file MPSolver.java.
+Definition at line 66 of file MPSolver.java.
Definition at line 107 of file MPSolver.java.
+Creates a variable with the given bounds, integrality requirement and
+ name.
Bounds can be finite or +/- MPSolver::infinity(). The MPSolver owns
+ the variable (i.e. the returned pointer is borrowed). Variable names are
+ optional. If you give an empty name, name() will auto-generate one for you
+ upon request.
Definition at line 142 of file MPSolver.java.
Definition at line 41 of file MPSolver.java.
+Definition at line 45 of file MPSolver.java.
Definition at line 49 of file MPSolver.java.
+Definition at line 53 of file MPSolver.java.
Definition at line 217 of file MPSolver.java.
+Returns the number of branch-and-bound nodes evaluated during the solve.
+
+
+ Only available for discrete problems.
Definition at line 433 of file MPSolver.java.
Definition at line 127 of file MPSolver.java.
+Returns the number of constraints.
+ +Definition at line 174 of file MPSolver.java.
Definition at line 94 of file MPSolver.java.
+Returns the number of variables.
+ +Definition at line 113 of file MPSolver.java.
Definition at line 160 of file MPSolver.java.
+Returns the mutable objective object.
+ +Definition at line 239 of file MPSolver.java.
Definition at line 181 of file MPSolver.java.
+Advanced usage: resets extracted model to solve from scratch.
+
+
+ This won't reset the parameters that were set with
+ SetSolverSpecificParametersAsString() or set_time_limit() or even clear the
+ linear program. It will just make sure that next Solve() will be as if
+ everything was reconstructed from scratch.
Definition at line 298 of file MPSolver.java.
Sets a hint for solution.
If a feasible or almost-feasible solution to the problem is already known, it may be helpful to pass it to the solver so that it can be used. A solver that supports this feature will try to use this information to create its initial feasible solution. Note that it may not always be faster to give a hint like this to the solver. There is also no guarantee that the solver will use this hint or try to return a solution "close" to this assignment in case of multiple optimal solutions.
-Definition at line 299 of file MPSolver.java.
+Definition at line 539 of file MPSolver.java.
@@ -1706,7 +1921,7 @@ Protected Member FunctionsSets the number of threads to be used by the solver.
-Definition at line 306 of file MPSolver.java.
+Definition at line 546 of file MPSolver.java.
@@ -1734,7 +1949,17 @@ Protected Member FunctionsDefinition at line 197 of file MPSolver.java.
+Advanced usage: pass solver specific parameters in text format.
+
+
+ The format is solver-specific and is the same as the corresponding solver
+ configuration file format. Returns true if the operation was successful.
+
+ TODO(user): Currently SCIP will always return true even if the format is
+ wrong (you can check the log if you suspect an issue there). This seems to
+ be a bug in SCIP though.
Definition at line 394 of file MPSolver.java.
Definition at line 225 of file MPSolver.java.
+Definition at line 465 of file MPSolver.java.
Definition at line 165 of file MPSolver.java.
+Solves the problem using default parameter values.
+ +Definition at line 247 of file MPSolver.java.
Definition at line 169 of file MPSolver.java.
+Solves the problem using the specified parameter values.
+ +Definition at line 254 of file MPSolver.java.
Definition at line 267 of file MPSolver.java.
+Definition at line 507 of file MPSolver.java.
Definition at line 86 of file MPSolver.java.
+Whether the given problem type is supported (this will depend on the
+ targets that you linked).
Definition at line 97 of file MPSolver.java.
Definition at line 209 of file MPSolver.java.
+Suppress output.
+ +Definition at line 417 of file MPSolver.java.
Definition at line 98 of file MPSolver.java.
+Returns the array of variables handled by the MPSolver.
+(They are listed in
+ the order in which they were created.)
Definition at line 121 of file MPSolver.java.
Definition at line 177 of file MPSolver.java.
+Advanced usage: Verifies the correctness of the solution.
+
+
+ It verifies that all variables must be within their domains, all
+ constraints must be satisfied, and the reported objective value must be
+ accurate.
+
+ Usage:
+
Definition at line 286 of file MPSolver.java.
Definition at line 229 of file MPSolver.java.
+Definition at line 469 of file MPSolver.java.
Definition at line 13 of file MPSolverParameters.java.
+This class stores parameter settings for LP and MIP solvers.
+Some parameters
+ are marked as advanced: do not change their values unless you know what you
+ are doing!
+
+ For developers: how to add a new parameter:
+
Definition at line 39 of file MPSolverParameters.java.
Classes | |
| enum | DoubleParam |
| Enumeration of parameters that take continuous values. More... | |
| enum | IncrementalityValues |
| Advanced usage: Incrementality options. More... | |
| enum | IntegerParam |
| Enumeration of parameters that take integer or categorical values. More... | |
| enum | LpAlgorithmValues |
| LP algorithm to use. More... | |
| enum | PresolveValues |
| For each categorical parameter, enumeration of possible values. More... | |
| enum | ScalingValues |
| Advanced usage: Scaling options. More... | |
@@ -66,14 +105,19 @@ Public Member Functions | |
| synchronized void | delete () |
| MPSolverParameters () | |
| The constructor sets all parameters to their default value. More... | |
| void | setDoubleParam (MPSolverParameters.DoubleParam param, double value) |
| Sets a double parameter to a specific value. More... | |
| void | setIntegerParam (MPSolverParameters.IntegerParam param, int value) |
| Sets a integer parameter to a specific value. More... | |
| double | getDoubleParam (MPSolverParameters.DoubleParam param) |
| Returns the value of a double parameter. More... | |
| int | getIntegerParam (MPSolverParameters.IntegerParam param) |
| Returns the value of an integer parameter. More... | |
@@ -129,7 +173,7 @@ Protected Member Functions |
Definition at line 17 of file MPSolverParameters.java.
+Definition at line 43 of file MPSolverParameters.java.
Definition at line 61 of file MPSolverParameters.java.
+The constructor sets all parameters to their default value.
+ +Definition at line 90 of file MPSolverParameters.java.
Definition at line 31 of file MPSolverParameters.java.
+Definition at line 57 of file MPSolverParameters.java.
Definition at line 73 of file MPSolverParameters.java.
+Returns the value of a double parameter.
+ +Definition at line 111 of file MPSolverParameters.java.
Definition at line 77 of file MPSolverParameters.java.
+Returns the value of an integer parameter.
+ +Definition at line 118 of file MPSolverParameters.java.
Definition at line 49 of file MPSolverParameters.java.
+Definition at line 75 of file MPSolverParameters.java.
Definition at line 57 of file MPSolverParameters.java.
+Definition at line 83 of file MPSolverParameters.java.
Definition at line 53 of file MPSolverParameters.java.
+Definition at line 79 of file MPSolverParameters.java.
Definition at line 45 of file MPSolverParameters.java.
+Definition at line 71 of file MPSolverParameters.java.
Definition at line 41 of file MPSolverParameters.java.
+Definition at line 67 of file MPSolverParameters.java.
Definition at line 65 of file MPSolverParameters.java.
+Sets a double parameter to a specific value.
+ +Definition at line 97 of file MPSolverParameters.java.
Definition at line 69 of file MPSolverParameters.java.
+Sets a integer parameter to a specific value.
+ +Definition at line 104 of file MPSolverParameters.java.
Definition at line 13 of file MPVariable.java.
+The class for variables of a Mathematical Programming (MP) model.
+ +Definition at line 16 of file MPVariable.java.
Public Member Functions | |
| synchronized void | delete () |
| String | name () |
| Returns the name of the variable. More... | |
| void | setInteger (boolean integer) |
| Sets the integrality requirement of the variable. More... | |
| double | solutionValue () |
| Returns the value of the variable in the current solution. More... | |
| int | index () |
| Returns the index of the variable in the MPSolver::variables_. More... | |
| double | lb () |
| Returns the lower bound. More... | |
| double | ub () |
| Returns the upper bound. More... | |
| void | setLb (double lb) |
| Sets the lower bound. More... | |
| void | setUb (double ub) |
| Sets the upper bound. More... | |
| void | setBounds (double lb, double ub) |
| Sets both the lower and upper bounds. More... | |
| double | reducedCost () |
| Advanced usage: returns the reduced cost of the variable in the current + solution (only available for continuous problems). More... | |
| MPSolver.BasisStatus | basisStatus () |
| Advanced usage: returns the basis status of the variable in the current solution (only available for continuous problems). More... | |
@@ -111,7 +124,7 @@ Protected Member Functions |
Definition at line 17 of file MPVariable.java.
+Definition at line 20 of file MPVariable.java.
Definition at line 81 of file MPVariable.java.
+Advanced usage: returns the basis status of the variable in the current solution (only available for continuous problems).
+
+
+
Definition at line 124 of file MPVariable.java.
Definition at line 31 of file MPVariable.java.
+Definition at line 34 of file MPVariable.java.
Definition at line 53 of file MPVariable.java.
+Returns the index of the variable in the MPSolver::variables_.
+ +Definition at line 72 of file MPVariable.java.
Definition at line 57 of file MPVariable.java.
+Returns the lower bound.
+ +Definition at line 79 of file MPVariable.java.
Definition at line 41 of file MPVariable.java.
+Returns the name of the variable.
+ +Definition at line 47 of file MPVariable.java.
Definition at line 77 of file MPVariable.java.
+Advanced usage: returns the reduced cost of the variable in the current
+ solution (only available for continuous problems).
Definition at line 115 of file MPVariable.java.
Definition at line 73 of file MPVariable.java.
+Sets both the lower and upper bounds.
+ +Definition at line 107 of file MPVariable.java.
Definition at line 45 of file MPVariable.java.
+Sets the integrality requirement of the variable.
+ +Definition at line 54 of file MPVariable.java.
Definition at line 65 of file MPVariable.java.
+Sets the lower bound.
+ +Definition at line 93 of file MPVariable.java.
Definition at line 69 of file MPVariable.java.
+Sets the upper bound.
+ +Definition at line 100 of file MPVariable.java.
Definition at line 49 of file MPVariable.java.
+Returns the value of the variable in the current solution.
+
+
+ If the variable is integer, then the value will always be an integer (the
+ underlying solver handles floating-point values only, but this function
+ automatically rounds it to the nearest integer; see: man 3 round).
Definition at line 65 of file MPVariable.java.
Definition at line 61 of file MPVariable.java.
+Returns the upper bound.
+ +Definition at line 86 of file MPVariable.java.
Protobuf enum
Definition at line 138 of file MPModelRequest.java.
Public Member Functions | |
Public Attributes | |
| RELATIVE_MIP_GAP =(main_research_linear_solverJNI.MPSolverParameters_RELATIVE_MIP_GAP_get()) | |
| Limit for relative MIP gap. More... | |
| PRIMAL_TOLERANCE =(main_research_linear_solverJNI.MPSolverParameters_PRIMAL_TOLERANCE_get()) | |
| Advanced usage: tolerance for primal feasibility of basic solutions. More... | |
| DUAL_TOLERANCE =(main_research_linear_solverJNI.MPSolverParameters_DUAL_TOLERANCE_get()) | |
| Advanced usage: tolerance for dual feasibility of basic solutions. More... | |
Definition at line 90 of file MPSolverParameters.java.
+Definition at line 146 of file MPSolverParameters.java.
Definition at line 86 of file MPSolverParameters.java.
+Definition at line 142 of file MPSolverParameters.java.
Definition at line 84 of file MPSolverParameters.java.
+Advanced usage: tolerance for dual feasibility of basic solutions.
+ +Definition at line 140 of file MPSolverParameters.java.
Definition at line 83 of file MPSolverParameters.java.
+Advanced usage: tolerance for primal feasibility of basic solutions.
+
+
+ This does not control the integer feasibility tolerance of integer
+ solutions for MIP or the tolerance used during presolve.
Definition at line 136 of file MPSolverParameters.java.
Definition at line 82 of file MPSolverParameters.java.
+Limit for relative MIP gap.
+ +Definition at line 129 of file MPSolverParameters.java.
Definition at line 253 of file MPSolverParameters.java.
+Advanced usage: Incrementality options.
+ +Definition at line 333 of file MPSolverParameters.java.
Public Member Functions | |
Public Attributes | |
| INCREMENTALITY_OFF =(main_research_linear_solverJNI.MPSolverParameters_INCREMENTALITY_OFF_get()) | |
| Start solve from scratch. More... | |
| INCREMENTALITY_ON =(main_research_linear_solverJNI.MPSolverParameters_INCREMENTALITY_ON_get()) | |
| Reuse results from previous solve as much as the underlying solver + allows. More... | |
Definition at line 261 of file MPSolverParameters.java.
+Definition at line 348 of file MPSolverParameters.java.
Definition at line 257 of file MPSolverParameters.java.
+Definition at line 344 of file MPSolverParameters.java.
Definition at line 254 of file MPSolverParameters.java.
+Start solve from scratch.
+ +Definition at line 337 of file MPSolverParameters.java.
Definition at line 255 of file MPSolverParameters.java.
+Reuse results from previous solve as much as the underlying solver
+ allows.
Definition at line 342 of file MPSolverParameters.java.
Definition at line 124 of file MPSolverParameters.java.
+Enumeration of parameters that take integer or categorical values.
+ +Definition at line 183 of file MPSolverParameters.java.
Public Member Functions | |
Public Attributes | |
| PRESOLVE =(main_research_linear_solverJNI.MPSolverParameters_PRESOLVE_get()) | |
| Advanced usage: presolve mode. More... | |
| LP_ALGORITHM =(main_research_linear_solverJNI.MPSolverParameters_LP_ALGORITHM_get()) | |
| Algorithm to solve linear programs. More... | |
| INCREMENTALITY =(main_research_linear_solverJNI.MPSolverParameters_INCREMENTALITY_get()) | |
| Advanced usage: incrementality from one solve to the next. More... | |
| SCALING =(main_research_linear_solverJNI.MPSolverParameters_SCALING_get()) | |
| Advanced usage: enable or disable matrix scaling. More... | |
Definition at line 134 of file MPSolverParameters.java.
+Definition at line 205 of file MPSolverParameters.java.
Definition at line 130 of file MPSolverParameters.java.
+Definition at line 201 of file MPSolverParameters.java.
Definition at line 127 of file MPSolverParameters.java.
+Advanced usage: incrementality from one solve to the next.
+ +Definition at line 195 of file MPSolverParameters.java.
Definition at line 126 of file MPSolverParameters.java.
+Algorithm to solve linear programs.
+ +Definition at line 191 of file MPSolverParameters.java.
Definition at line 125 of file MPSolverParameters.java.
+Advanced usage: presolve mode.
+ +Definition at line 187 of file MPSolverParameters.java.
Definition at line 128 of file MPSolverParameters.java.
+Advanced usage: enable or disable matrix scaling.
+ +Definition at line 199 of file MPSolverParameters.java.
Definition at line 210 of file MPSolverParameters.java.
+LP algorithm to use.
+ +Definition at line 287 of file MPSolverParameters.java.
Public Member Functions |
Definition at line 219 of file MPSolverParameters.java.
+Definition at line 296 of file MPSolverParameters.java.
Definition at line 215 of file MPSolverParameters.java.
+Definition at line 292 of file MPSolverParameters.java.
Definition at line 213 of file MPSolverParameters.java.
+Definition at line 290 of file MPSolverParameters.java.
Definition at line 211 of file MPSolverParameters.java.
+Definition at line 288 of file MPSolverParameters.java.
Definition at line 212 of file MPSolverParameters.java.
+Definition at line 289 of file MPSolverParameters.java.
Definition at line 168 of file MPSolverParameters.java.
+For each categorical parameter, enumeration of possible values.
+ +Definition at line 242 of file MPSolverParameters.java.
Public Member Functions |
Definition at line 176 of file MPSolverParameters.java.
+Definition at line 250 of file MPSolverParameters.java.
Definition at line 172 of file MPSolverParameters.java.
+Definition at line 246 of file MPSolverParameters.java.
Definition at line 169 of file MPSolverParameters.java.
+Definition at line 243 of file MPSolverParameters.java.
Definition at line 170 of file MPSolverParameters.java.
+Definition at line 244 of file MPSolverParameters.java.
Definition at line 295 of file MPSolverParameters.java.
+Advanced usage: Scaling options.
+ +Definition at line 385 of file MPSolverParameters.java.
Public Member Functions | |
Public Attributes | |
| SCALING_OFF =(main_research_linear_solverJNI.MPSolverParameters_SCALING_OFF_get()) | |
| Scaling is off. More... | |
| SCALING_ON =(main_research_linear_solverJNI.MPSolverParameters_SCALING_ON_get()) | |
| Scaling is on. More... | |
Definition at line 303 of file MPSolverParameters.java.
+Definition at line 399 of file MPSolverParameters.java.
Definition at line 299 of file MPSolverParameters.java.
+Definition at line 395 of file MPSolverParameters.java.
Definition at line 296 of file MPSolverParameters.java.
+Scaling is off.
+ +Definition at line 389 of file MPSolverParameters.java.
Definition at line 297 of file MPSolverParameters.java.
+Scaling is on.
+ +Definition at line 393 of file MPSolverParameters.java.
Definition at line 400 of file MPSolver.java.
+Advanced usage: possible basis status values for a variable and the slack
+ variable of a linear constraint.
Definition at line 686 of file MPSolver.java.
Public Member Functions |
Definition at line 411 of file MPSolver.java.
+Definition at line 697 of file MPSolver.java.
Definition at line 407 of file MPSolver.java.
+Definition at line 693 of file MPSolver.java.
Definition at line 402 of file MPSolver.java.
+Definition at line 688 of file MPSolver.java.
Definition at line 403 of file MPSolver.java.
+Definition at line 689 of file MPSolver.java.
Definition at line 405 of file MPSolver.java.
+Definition at line 691 of file MPSolver.java.
Definition at line 404 of file MPSolver.java.
+Definition at line 690 of file MPSolver.java.
Definition at line 401 of file MPSolver.java.
+Definition at line 687 of file MPSolver.java.
Definition at line 310 of file MPSolver.java.
+The type of problems (LP or MIP) that will be solved and the underlying
+ solver (GLOP, GLPK, CLP, CBC or SCIP) that will solve them.
This must
+ remain consistent with MPModelRequest::OptimizationProblemType
+ (take particular care of the open-source version).
Definition at line 556 of file MPSolver.java.
Public Member Functions | |
Public Attributes | |
| CLP_LINEAR_PROGRAMMING =(main_research_linear_solverJNI.MPSolver_CLP_LINEAR_PROGRAMMING_get()) | |
| Linear Programming solver using Coin CBC. More... | |
| GLOP_LINEAR_PROGRAMMING =(main_research_linear_solverJNI.MPSolver_GLOP_LINEAR_PROGRAMMING_get()) | |
| Linear Programming solver using GLOP (Recommended solver). More... | |
| CBC_MIXED_INTEGER_PROGRAMMING =(main_research_linear_solverJNI.MPSolver_CBC_MIXED_INTEGER_PROGRAMMING_get()) | |
| Mixed integer Programming Solver using Coin CBC. More... | |
| BOP_INTEGER_PROGRAMMING =(main_research_linear_solverJNI.MPSolver_BOP_INTEGER_PROGRAMMING_get()) | |
| Linear Boolean Programming Solver. More... | |
Definition at line 320 of file MPSolver.java.
+Definition at line 578 of file MPSolver.java.
Definition at line 316 of file MPSolver.java.
+Definition at line 574 of file MPSolver.java.
Definition at line 314 of file MPSolver.java.
+Linear Boolean Programming Solver.
+ +Definition at line 572 of file MPSolver.java.
Definition at line 313 of file MPSolver.java.
+Mixed integer Programming Solver using Coin CBC.
+ +Definition at line 568 of file MPSolver.java.
Definition at line 311 of file MPSolver.java.
+Linear Programming solver using Coin CBC.
+ +Definition at line 560 of file MPSolver.java.
Definition at line 312 of file MPSolver.java.
+Linear Programming solver using GLOP (Recommended solver).
+ +Definition at line 564 of file MPSolver.java.
Definition at line 354 of file MPSolver.java.
+The status of solving the problem.
+The straightforward translation to
+ homonymous enum values of MPSolverResponseStatus (see
+ ./linear_solver.proto) is guaranteed by ./enum_consistency_test.cc, you may
+ rely on it.
Definition at line 618 of file MPSolver.java.
Public Member Functions | |
Public Attributes | |
| OPTIMAL | |
| optimal. More... | |
| FEASIBLE | |
| feasible, or stopped by limit. More... | |
| INFEASIBLE | |
| proven infeasible. More... | |
| UNBOUNDED | |
| proven unbounded. More... | |
| ABNORMAL | |
| abnormal, i.e., error of some kind. More... | |
| NOT_SOLVED =(main_research_linear_solverJNI.MPSolver_NOT_SOLVED_get()) | |
| not been solved yet. More... | |
Definition at line 366 of file MPSolver.java.
+Definition at line 648 of file MPSolver.java.
Definition at line 362 of file MPSolver.java.
+Definition at line 644 of file MPSolver.java.
Definition at line 359 of file MPSolver.java.
+abnormal, i.e., error of some kind.
+ +Definition at line 638 of file MPSolver.java.
Definition at line 356 of file MPSolver.java.
+feasible, or stopped by limit.
+ +Definition at line 626 of file MPSolver.java.
Definition at line 357 of file MPSolver.java.
+proven infeasible.
+ +Definition at line 630 of file MPSolver.java.
Definition at line 360 of file MPSolver.java.
+not been solved yet.
+ +Definition at line 642 of file MPSolver.java.
Definition at line 355 of file MPSolver.java.
+optimal.
+ +Definition at line 622 of file MPSolver.java.
Definition at line 358 of file MPSolver.java.
+proven unbounded.
+ +Definition at line 634 of file MPSolver.java.
@@ -418,67 +418,67 @@
diff --git a/docs/java/interfacecom_1_1google_1_1ortools_1_1linearsolver_1_1MPModelRequestOrBuilder.html b/docs/java/interfacecom_1_1google_1_1ortools_1_1linearsolver_1_1MPModelRequestOrBuilder.html
index 7381bc2c3b..943e44533a 100644
--- a/docs/java/interfacecom_1_1google_1_1ortools_1_1linearsolver_1_1MPModelRequestOrBuilder.html
+++ b/docs/java/interfacecom_1_1google_1_1ortools_1_1linearsolver_1_1MPModelRequestOrBuilder.html
@@ -88,7 +88,7 @@ Public Member Functions-If this is set, then EnableOutput() will be set on the internal MPSolver +If this is set, then EnableOutput() will be set on the internal MPSolver that solves the model. WARNING: if you set this on a request to prod servers, it will be rejected and yield the RPC Application Error code MPSOLVER_SOLVER_TYPE_UNAVAILABLE. @@ -268,7 +268,7 @@ If not specified, the time limit on the solver is the RPC's deadline_left.
-If this is set, then EnableOutput() will be set on the internal MPSolver +If this is set, then EnableOutput() will be set on the internal MPSolver that solves the model. WARNING: if you set this on a request to prod servers, it will be rejected and yield the RPC Application Error code MPSOLVER_SOLVER_TYPE_UNAVAILABLE. diff --git a/docs/java/main__research__linear__solverJNI_8java_source.html b/docs/java/main__research__linear__solverJNI_8java_source.html index a73a7023e3..71716474b1 100644 --- a/docs/java/main__research__linear__solverJNI_8java_source.html +++ b/docs/java/main__research__linear__solverJNI_8java_source.html @@ -52,7 +52,7 @@static final native int MPSolver_numConstraints(long jarg1, MPSolver jarg1_)static final native long MPSolver_makeConstraint__SWIG_1(long jarg1, MPSolver jarg1_)- +static final native boolean MPObjective_maximization(long jarg1, MPObjective jarg1_)The class for variables of a Mathematical Programming (MP) model.Definition: MPVariable.java:16static final native int MPSolver_FREE_get()static final native void MPObjective_setMaximization(long jarg1, MPObjective jarg1_)@@ -81,7 +81,7 @@com.google.ortools.linearsolver.main_research_linear_solverJNI.MPSolverParameters_DUAL_TOLERANCE_getstatic final native int MPSolverParameters_DUAL_TOLERANCE_get()static final native String MPSolver_exportModelAsLpFormat__SWIG_1(long jarg1, MPSolver jarg1_)static final native double MPVariable_lb(long jarg1, MPVariable jarg1_)- +static final native int MPSolverParameters_PRESOLVE_ON_get()The class for constraints of a Mathematical Programming (MP) model.Definition: MPConstraint.java:18static final native boolean MPSolver_supportsProblemType(int jarg1)static final native long MPSolver_makeIntVar(long jarg1, MPSolver jarg1_, double jarg2, double jarg3, String jarg4)@@ -100,7 +100,7 @@static final native boolean MPSolver_setSolverSpecificParametersAsString(long jarg1, MPSolver jarg1_, String jarg2)static final native long MPSolver_makeConstraint__SWIG_2(long jarg1, MPSolver jarg1_, double jarg2, double jarg3, String jarg4)static final native int MPSolverParameters_PRIMAL_get()- +static final native long new_MPModelExportOptions()This mathematical programming (MP) solver class is the main class though which users build and solve...Definition: MPSolver.java:17static final native int MPSolver_NOT_SOLVED_get()static final native double MPSolverParameters_kDefaultDualTolerance_get()@@ -120,7 +120,7 @@static final native boolean MPModelExportOptions_ShowUnusedVariables_get(long jarg1, MPModelExportOptions jarg1_)static final native String MPSolver_exportModelAsMpsFormat__SWIG_0(long jarg1, MPSolver jarg1_, long jarg2, MPModelExportOptions jarg2_)static final native double MPObjective_bestBound(long jarg1, MPObjective jarg1_)- +static final native double MPObjective_offset(long jarg1, MPObjective jarg1_)This class stores parameter settings for LP and MIP solvers.Definition: MPSolverParameters.java:39static final native void MPModelExportOptions_MaxLineLength_set(long jarg1, MPModelExportOptions jarg1_, int jarg2)static final native void MPModelExportOptions_LogInvalidNames_set(long jarg1, MPModelExportOptions jarg1_, boolean jarg2)@@ -146,7 +146,7 @@static final native int MPSolverParameters_DUAL_get()static final native int MPSolverParameters_LP_ALGORITHM_get()static final native void MPObjective_setOptimizationDirection(long jarg1, MPObjective jarg1_, boolean jarg2)- +static final native void delete_MPConstraint(long jarg1)A class to express a linear objective.Definition: MPObjective.java:16static final native double MPObjective_getCoefficient(long jarg1, MPObjective jarg1_, long jarg2, MPVariable jarg2_)static final native int MPSolver_CBC_MIXED_INTEGER_PROGRAMMING_get()diff --git a/docs/java/namespacecom_1_1google_1_1ortools_1_1linearsolver.html b/docs/java/namespacecom_1_1google_1_1ortools_1_1linearsolver.html index eca7fb1f49..1b85ecdeb9 100644 --- a/docs/java/namespacecom_1_1google_1_1ortools_1_1linearsolver.html +++ b/docs/java/namespacecom_1_1google_1_1ortools_1_1linearsolver.html @@ -48,6 +48,7 @@ Classesstatic final native long MPSolver_wallTime(long jarg1, MPSolver jarg1_)class main_research_linear_solverJNI + class MPConstraint The class for constraints of a Mathematical Programming (MP) model. More... class MPConstraintProto @@ -73,6 +74,7 @@ Classes interface MPModelRequestOrBuilder + class MPObjective A class to express a linear objective. More... class MPSolutionResponse @@ -80,12 +82,15 @@ Classes Protobuf type. More... interface MPSolutionResponseOrBuilder + class MPSolver This mathematical programming (MP) solver class is the main class
+ though which users build and solve problems. More...class MPSolverCommonParameters interface MPSolverCommonParametersOrBuilder + class MPSolverParameters This class stores parameter settings for LP and MIP solvers. More... enum MPSolverResponseStatus @@ -94,6 +99,7 @@ Classes interface MPSosConstraintOrBuilder + class MPVariable The class for variables of a Mathematical Programming (MP) model. More... class MPVariableProto diff --git a/docs/python/ortools/linear_solver/pywraplp.html b/docs/python/ortools/linear_solver/pywraplp.html index 49e248586d..c359f541d6 100644 --- a/docs/python/ortools/linear_solver/pywraplp.html +++ b/docs/python/ortools/linear_solver/pywraplp.html @@ -132,92 +132,318 @@ from ortools.linear_solver.linear_solver_natural_api import LinearConstraint from ortools.linear_solver.linear_solver_natural_api import VariableExpr class Solver(object): + r""" + + This mathematical programming (MP) solver class is the main class + though which users build and solve problems. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr CLP_LINEAR_PROGRAMMING = _pywraplp.Solver_CLP_LINEAR_PROGRAMMING + r""" Linear Programming solver using Coin CBC.""" GLOP_LINEAR_PROGRAMMING = _pywraplp.Solver_GLOP_LINEAR_PROGRAMMING + r""" Linear Programming solver using GLOP (Recommended solver).""" CBC_MIXED_INTEGER_PROGRAMMING = _pywraplp.Solver_CBC_MIXED_INTEGER_PROGRAMMING + r""" Mixed integer Programming Solver using Coin CBC.""" BOP_INTEGER_PROGRAMMING = _pywraplp.Solver_BOP_INTEGER_PROGRAMMING + r""" Linear Boolean Programming Solver.""" def __init__(self, name: 'std::string const &', problem_type: 'operations_research::MPSolver::OptimizationProblemType'): + r""" + + Create a solver with the given name and underlying solver backend. + """ _pywraplp.Solver_swiginit(self, _pywraplp.new_Solver(name, problem_type)) __swig_destroy__ = _pywraplp.delete_Solver @staticmethod def SupportsProblemType(problem_type: 'operations_research::MPSolver::OptimizationProblemType') -> "bool": + r""" + + Whether the given problem type is supported (this will depend on the + targets that you linked). + """ return _pywraplp.Solver_SupportsProblemType(problem_type) def Clear(self) -> "void": + r""" + + Clears the objective (including the optimization direction), all variables + and constraints. All the other properties of the MPSolver (like the time + limit) are kept untouched. + """ return _pywraplp.Solver_Clear(self) def NumVariables(self) -> "int": + r""" + + Returns the number of variables. + """ return _pywraplp.Solver_NumVariables(self) def variables(self) -> "std::vector< operations_research::MPVariable * > const &": + r""" + + Returns the array of variables handled by the MPSolver. (They are listed in + the order in which they were created.) + """ return _pywraplp.Solver_variables(self) def LookupVariable(self, var_name: 'std::string const &') -> "operations_research::MPVariable *": + r""" + + Looks up a variable by name, and returns nullptr if it does not exist. The + first call has a O(n) complexity, as the variable name index is lazily + created upon first use. Will crash if variable names are not unique. + """ return _pywraplp.Solver_LookupVariable(self, var_name) def Var(self, lb: 'double', ub: 'double', integer: 'bool', name: 'std::string const &') -> "operations_research::MPVariable *": + r""" + + Creates a variable with the given bounds, integrality requirement and + name. Bounds can be finite or +/- MPSolver::infinity(). The MPSolver owns + the variable (i.e. the returned pointer is borrowed). Variable names are + optional. If you give an empty name, name() will auto-generate one for you + upon request. + """ return _pywraplp.Solver_Var(self, lb, ub, integer, name) def NumVar(self, lb: 'double', ub: 'double', name: 'std::string const &') -> "operations_research::MPVariable *": + r""" + + Creates a continuous variable. + """ return _pywraplp.Solver_NumVar(self, lb, ub, name) def IntVar(self, lb: 'double', ub: 'double', name: 'std::string const &') -> "operations_research::MPVariable *": + r""" + + Creates an integer variable. + """ return _pywraplp.Solver_IntVar(self, lb, ub, name) def BoolVar(self, name: 'std::string const &') -> "operations_research::MPVariable *": + r""" + + Creates a boolean variable. + """ return _pywraplp.Solver_BoolVar(self, name) def NumConstraints(self) -> "int": + r""" + + Returns the number of constraints. + """ return _pywraplp.Solver_NumConstraints(self) def constraints(self) -> "std::vector< operations_research::MPConstraint * > const &": + r""" + + Returns the array of constraints handled by the MPSolver. + + They are listed in the order in which they were created. + """ return _pywraplp.Solver_constraints(self) def LookupConstraint(self, constraint_name: 'std::string const &') -> "operations_research::MPConstraint *": + r""" + + Looks up a constraint by name, and returns nullptr if it does not exist. + + The first call has a O(n) complexity, as the constraint name index is + lazily created upon first use. Will crash if constraint names are not + unique. + """ return _pywraplp.Solver_LookupConstraint(self, constraint_name) def Constraint(self, *args) -> "operations_research::MPConstraint *": + r""" + *Overload 1:* + + Creates a linear constraint with given bounds. + + Bounds can be finite or +/- MPSolver::infinity(). The MPSolver class + assumes ownership of the constraint. + + :rtype: :py:class:`MPConstraint` + :return: a pointer to the newly created constraint. + + | + + *Overload 2:* + + Creates a constraint with -infinity and +infinity bounds. + + | + + *Overload 3:* + + Creates a named constraint with given bounds. + + | + + *Overload 4:* + + Creates a named constraint with -infinity and +infinity bounds. + """ return _pywraplp.Solver_Constraint(self, *args) def Objective(self) -> "operations_research::MPObjective *": + r""" + + Returns the mutable objective object. + """ return _pywraplp.Solver_Objective(self) OPTIMAL = _pywraplp.Solver_OPTIMAL + r""" optimal.""" FEASIBLE = _pywraplp.Solver_FEASIBLE + r""" feasible, or stopped by limit.""" INFEASIBLE = _pywraplp.Solver_INFEASIBLE + r""" proven infeasible.""" UNBOUNDED = _pywraplp.Solver_UNBOUNDED + r""" proven unbounded.""" ABNORMAL = _pywraplp.Solver_ABNORMAL + r""" abnormal, i.e., error of some kind.""" NOT_SOLVED = _pywraplp.Solver_NOT_SOLVED + r""" not been solved yet.""" def Solve(self, *args) -> "operations_research::MPSolver::ResultStatus": + r""" + *Overload 1:* + + Solves the problem using default parameter values. + + | + + *Overload 2:* + + Solves the problem using the specified parameter values. + """ return _pywraplp.Solver_Solve(self, *args) def ComputeConstraintActivities(self) -> "std::vector< double >": + r""" + + Advanced usage: compute the "activities" of all constraints, which are the + sums of their linear terms. The activities are returned in the same order + as constraints(), which is the order in which constraints were added; but + you can also use MPConstraint::index() to get a constraint's index. + """ return _pywraplp.Solver_ComputeConstraintActivities(self) def VerifySolution(self, tolerance: 'double', log_errors: 'bool') -> "bool": + r""" + + Advanced usage: Verifies the *correctness* of the solution. + + It verifies that all variables must be within their domains, all + constraints must be satisfied, and the reported objective value must be + accurate. + + Usage: + - This can only be called after Solve() was called. + - "tolerance" is interpreted as an absolute error threshold. + - For the objective value only, if the absolute error is too large, + the tolerance is interpreted as a relative error threshold instead. + - If "log_errors" is true, every single violation will be logged. + - If "tolerance" is negative, it will be set to infinity(). + + Most users should just set the --verify_solution flag and not bother using + this method directly. + """ return _pywraplp.Solver_VerifySolution(self, tolerance, log_errors) def InterruptSolve(self) -> "bool": + r""" + Interrupts the Solve() execution to terminate processing if possible. + + If the underlying interface supports interruption; it does that and returns + true regardless of whether there's an ongoing Solve() or not. The Solve() + call may still linger for a while depending on the conditions. If + interruption is not supported; returns false and does nothing. + """ return _pywraplp.Solver_InterruptSolve(self) def FillSolutionResponseProto(self, response: 'operations_research::MPSolutionResponse *') -> "void": + r""" + + Encodes the current solution in a solution response protocol buffer. + """ return _pywraplp.Solver_FillSolutionResponseProto(self, response) @staticmethod def SolveWithProto(model_request: 'operations_research::MPModelRequest const &', response: 'operations_research::MPSolutionResponse *') -> "operations_research::MPSolutionResponse *": + r""" + + Solves the model encoded by a MPModelRequest protocol buffer and fills the + solution encoded as a MPSolutionResponse. + + Note(user): This creates a temporary MPSolver and destroys it at the end. + If you want to keep the MPSolver alive (for debugging, or for incremental + solving), you should write another version of this function that creates + the MPSolver object on the heap and returns it. + """ return _pywraplp.Solver_SolveWithProto(model_request, response) def ExportModelToProto(self, output_model: 'operations_research::MPModelProto *') -> "void": + r""" + + Exports model to protocol buffer. + """ return _pywraplp.Solver_ExportModelToProto(self, output_model) def LoadSolutionFromProto(self, *args) -> "util::Status": + r""" + + Load a solution encoded in a protocol buffer onto this solver for easy + access via the MPSolver interface. + + IMPORTANT: This may only be used in conjunction with ExportModel(), + following this example: + + + .. code-block:: c++ + + + MPSolver my_solver; + ... add variables and constraints ... + MPModelProto model_proto; + my_solver.ExportModelToProto(model_proto); + MPSolutionResponse solver_response; + MPSolver::SolveWithProto(model_proto, solver_response); + if (solver_response.result_status() == MPSolutionResponse::OPTIMAL) { + CHECK_OK(my_solver.LoadSolutionFromProto(solver_response)); + ... inspect the solution using the usual API: solution_value(), etc... + } + + + The response must be in OPTIMAL or FEASIBLE status. + + Returns a non-OK status if a problem arised (typically, if it wasn't used + like it should be): + - loading a solution whose variables don't correspond to the solver's + current variables + - loading a solution with a status other than OPTIMAL / FEASIBLE. + + Note: the objective value isn't checked. You can use VerifySolution() for + that. + """ return _pywraplp.Solver_LoadSolutionFromProto(self, *args) def SetSolverSpecificParametersAsString(self, parameters: 'std::string const &') -> "bool": + r""" + + Advanced usage: pass solver specific parameters in text format. + + The format is solver-specific and is the same as the corresponding solver + configuration file format. Returns true if the operation was successful. + + TODO(user): Currently SCIP will always return true even if the format is + wrong (you can check the log if you suspect an issue there). This seems to + be a bug in SCIP though. + """ return _pywraplp.Solver_SetSolverSpecificParametersAsString(self, parameters) FREE = _pywraplp.Solver_FREE AT_LOWER_BOUND = _pywraplp.Solver_AT_LOWER_BOUND @@ -227,24 +453,81 @@ class Solver(object): @staticmethod def infinity() -> "double": + r""" + + Infinity. + + You can use -MPSolver::infinity() for negative infinity. + """ return _pywraplp.Solver_infinity() def EnableOutput(self) -> "void": + r""" Enable output.""" return _pywraplp.Solver_EnableOutput(self) def SuppressOutput(self) -> "void": + r""" Suppress output.""" return _pywraplp.Solver_SuppressOutput(self) def iterations(self) -> "int64": + r""" + + Returns the number of simplex iterations. + """ return _pywraplp.Solver_iterations(self) def nodes(self) -> "int64": + r""" + + Returns the number of branch-and-bound nodes evaluated during the solve. + + Only available for discrete problems. + """ return _pywraplp.Solver_nodes(self) def ComputeExactConditionNumber(self) -> "double": + r""" + Advanced usage: computes the exact condition number of the current scaled + basis: L1norm(B) * L1norm(inverse(B)), where B is the scaled basis. + + This method requires that a basis exists: it should be called after Solve. + It is only available for continuous problems. It is implemented for GLPK + but not CLP because CLP does not provide the API for doing it. + + The condition number measures how well the constraint matrix is conditioned + and can be used to predict whether numerical issues will arise during the + solve: the model is declared infeasible whereas it is feasible (or + vice-versa), the solution obtained is not optimal or violates some + constraints, the resolution is slow because of repeated singularities. + + The rule of thumb to interpret the condition number kappa is: + - o kappa <= 1e7: virtually no chance of numerical issues + - o 1e7 < kappa <= 1e10: small chance of numerical issues + - o 1e10 < kappa <= 1e13: medium chance of numerical issues + - o kappa > 1e13: high chance of numerical issues + + The computation of the condition number depends on the quality of the LU + decomposition, so it is not very accurate when the matrix is ill + conditioned. + """ return _pywraplp.Solver_ComputeExactConditionNumber(self) def NextSolution(self) -> "bool": + r""" + + Some solvers (MIP only, not LP) can produce multiple solutions to the + problem. Returns true when another solution is available, and updates the + MPVariable* objects to make the new solution queryable. Call only after + calling solve. + + The optimality properties of the additional solutions found, and whether or + not the solver computes them ahead of time or when NextSolution() is called + is solver specific. + + As of 2018-08-09, only Gurobi supports NextSolution(), see + linear_solver_underlying_gurobi_test for an example of how to configure + Gurobi for this purpose. The other solvers return false unconditionally. + """ return _pywraplp.Solver_NextSolution(self) def set_time_limit(self, time_limit_milliseconds: 'int64') -> "void": @@ -328,12 +611,33 @@ class Solver(object): _pywraplp.Solver_swigregister(Solver) def Solver_SupportsProblemType(problem_type: 'operations_research::MPSolver::OptimizationProblemType') -> "bool": + r""" + + Whether the given problem type is supported (this will depend on the + targets that you linked). + """ return _pywraplp.Solver_SupportsProblemType(problem_type) def Solver_SolveWithProto(model_request: 'operations_research::MPModelRequest const &', response: 'operations_research::MPSolutionResponse *') -> "operations_research::MPSolutionResponse *": + r""" + + Solves the model encoded by a MPModelRequest protocol buffer and fills the + solution encoded as a MPSolutionResponse. + + Note(user): This creates a temporary MPSolver and destroys it at the end. + If you want to keep the MPSolver alive (for debugging, or for incremental + solving), you should write another version of this function that creates + the MPSolver object on the heap and returns it. + """ return _pywraplp.Solver_SolveWithProto(model_request, response) def Solver_infinity() -> "double": + r""" + + Infinity. + + You can use -MPSolver::infinity() for negative infinity. + """ return _pywraplp.Solver_infinity() def Solver_Infinity() -> "double": @@ -343,6 +647,11 @@ def Solver_Infinity() -> "double": def __lshift__(*args) -> "std::ostream &": return _pywraplp.__lshift__(*args) class Objective(object): + r""" + + A class to express a linear objective. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') def __init__(self, *args, **kwargs): @@ -350,39 +659,104 @@ class Objective(object): __repr__ = _swig_repr def Clear(self) -> "void": + r""" + + Clears the offset, all variables and coefficients, and the optimization + direction. + """ return _pywraplp.Objective_Clear(self) def SetCoefficient(self, var: 'Variable', coeff: 'double') -> "void": + r""" + + Sets the coefficient of the variable in the objective. + + If the variable does not belong to the solver, the function just returns, + or crashes in non-opt mode. + """ return _pywraplp.Objective_SetCoefficient(self, var, coeff) def GetCoefficient(self, var: 'Variable') -> "double": + r""" + + Gets the coefficient of a given variable in the objective + + It returns 0 if the variable does not appear in the objective). + """ return _pywraplp.Objective_GetCoefficient(self, var) def SetOffset(self, value: 'double') -> "void": + r""" + + Sets the constant term in the objective. + """ return _pywraplp.Objective_SetOffset(self, value) def offset(self) -> "double": + r""" + + Gets the constant term in the objective. + """ return _pywraplp.Objective_offset(self) def SetOptimizationDirection(self, maximize: 'bool') -> "void": + r""" + + Sets the optimization direction (maximize: true or minimize: false). + """ return _pywraplp.Objective_SetOptimizationDirection(self, maximize) def SetMinimization(self) -> "void": + r""" + + Sets the optimization direction to minimize. + """ return _pywraplp.Objective_SetMinimization(self) def SetMaximization(self) -> "void": + r""" + + Sets the optimization direction to maximize. + """ return _pywraplp.Objective_SetMaximization(self) def maximization(self) -> "bool": + r""" + + Is the optimization direction set to maximize? + """ return _pywraplp.Objective_maximization(self) def minimization(self) -> "bool": + r""" + + Is the optimization direction set to minimize? + """ return _pywraplp.Objective_minimization(self) def Value(self) -> "double": + r""" + + Returns the objective value of the best solution found so far. + + It is the optimal objective value if the problem has been solved to + optimality. + + Note: the objective value may be slightly different than what you could + compute yourself using ``MPVariable::solution_value();`` please use the + --verify_solution flag to gain confidence about the numerical stability of + your solution. + """ return _pywraplp.Objective_Value(self) def BestBound(self) -> "double": + r""" + + Returns the best objective bound. + + In case of minimization, it is a lower bound on the objective value of the + optimal integer solution. Only available for discrete problems. + """ return _pywraplp.Objective_BestBound(self) def Offset(self) -> "double": @@ -393,36 +767,84 @@ class Objective(object): _pywraplp.Objective_swigregister(Objective) class Variable(object): + r""" + + The class for variables of a Mathematical Programming (MP) model. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") def name(self) -> "std::string const &": + r""" + + Returns the name of the variable. + """ return _pywraplp.Variable_name(self) def integer(self) -> "bool": + r""" + + Returns the integrality requirement of the variable. + """ return _pywraplp.Variable_integer(self) def solution_value(self) -> "double": + r""" + + Returns the value of the variable in the current solution. + + If the variable is integer, then the value will always be an integer (the + underlying solver handles floating-point values only, but this function + automatically rounds it to the nearest integer; see: man 3 round). + """ return _pywraplp.Variable_solution_value(self) def index(self) -> "int": + r""" + + Returns the index of the variable in the MPSolver::variables_. + """ return _pywraplp.Variable_index(self) def lb(self) -> "double": + r""" + + Returns the lower bound. + """ return _pywraplp.Variable_lb(self) def ub(self) -> "double": + r""" + + Returns the upper bound. + """ return _pywraplp.Variable_ub(self) def SetBounds(self, lb: 'double', ub: 'double') -> "void": + r""" + + Sets both the lower and upper bounds. + """ return _pywraplp.Variable_SetBounds(self, lb, ub) def reduced_cost(self) -> "double": + r""" + + Advanced usage: returns the reduced cost of the variable in the current + solution (only available for continuous problems). + """ return _pywraplp.Variable_reduced_cost(self) def basis_status(self) -> "operations_research::MPSolver::BasisStatus": + r""" + + Advanced usage: returns the basis status of the variable in the current solution (only available for continuous problems). + + See also: MPSolver::BasisStatus. + """ return _pywraplp.Variable_basis_status(self) def __str__(self) -> "std::string": @@ -461,6 +883,13 @@ class Variable(object): _pywraplp.Variable_swigregister(Variable) class Constraint(object): + r""" + + The class for constraints of a Mathematical Programming (MP) model. + + A constraint is represented as a linear equation or inequality. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') def __init__(self, *args, **kwargs): @@ -468,33 +897,96 @@ class Constraint(object): __repr__ = _swig_repr def name(self) -> "std::string const &": + r""" + + Returns the name of the constraint. + """ return _pywraplp.Constraint_name(self) def SetCoefficient(self, var: 'Variable', coeff: 'double') -> "void": + r""" + + Sets the coefficient of the variable on the constraint. + + If the variable does not belong to the solver, the function just returns, + or crashes in non-opt mode. + """ return _pywraplp.Constraint_SetCoefficient(self, var, coeff) def GetCoefficient(self, var: 'Variable') -> "double": + r""" + + Gets the coefficient of a given variable on the constraint (which is 0 if + the variable does not appear in the constraint). + """ return _pywraplp.Constraint_GetCoefficient(self, var) def lb(self) -> "double": + r""" + + Returns the lower bound. + """ return _pywraplp.Constraint_lb(self) def ub(self) -> "double": + r""" + + Returns the upper bound. + """ return _pywraplp.Constraint_ub(self) def SetBounds(self, lb: 'double', ub: 'double') -> "void": + r""" + + Sets both the lower and upper bounds. + """ return _pywraplp.Constraint_SetBounds(self, lb, ub) def set_is_lazy(self, laziness: 'bool') -> "void": + r""" + + Advanced usage: sets the constraint "laziness". + + **This is only supported for SCIP and has no effect on other solvers.** + + When **laziness** is true, the constraint is only considered by the Linear + Programming solver if its current solution violates the constraint. In this + case, the constraint is definitively added to the problem. This may be + useful in some MIP problems, and may have a dramatic impact on performance. + + For more info see: http://tinyurl.com/lazy-constraints. + """ return _pywraplp.Constraint_set_is_lazy(self, laziness) def index(self) -> "int": + r""" + + Returns the index of the constraint in the MPSolver::constraints_. + """ return _pywraplp.Constraint_index(self) def dual_value(self) -> "double": + r""" + + Advanced usage: returns the dual value of the constraint in the current + solution (only available for continuous problems). + """ return _pywraplp.Constraint_dual_value(self) def basis_status(self) -> "operations_research::MPSolver::BasisStatus": + r""" + + Advanced usage: returns the basis status of the constraint. + + It is only available for continuous problems). + + Note that if a constraint "linear_expression in [lb, ub]" is transformed + into "linear_expression + slack = 0" with slack in [-ub, -lb], then this + status is the same as the status of the slack variable with AT_UPPER_BOUND + and AT_LOWER_BOUND swapped. + + See also: MPSolver::BasisStatus. + """ return _pywraplp.Constraint_basis_status(self) def Lb(self) -> "double": @@ -517,38 +1009,127 @@ class Constraint(object): _pywraplp.Constraint_swigregister(Constraint) class MPSolverParameters(object): + r""" + + This class stores parameter settings for LP and MIP solvers. Some parameters + are marked as advanced: do not change their values unless you know what you + are doing! + + For developers: how to add a new parameter: + - Add the new Foo parameter in the DoubleParam or IntegerParam enum. + - If it is a categorical param, add a FooValues enum. + - Decide if the wrapper should define a default value for it: yes + if it controls the properties of the solution (example: + tolerances) or if it consistently improves performance, no + otherwise. If yes, define kDefaultFoo. + - Add a foo_value_ member and, if no default value is defined, a + foo_is_default_ member. + - Add code to handle Foo in Set...Param, Reset...Param, + Get...Param, Reset and the constructor. + - In class MPSolverInterface, add a virtual method SetFoo, add it + to SetCommonParameters or SetMIPParameters, and implement it for + each solver. Sometimes, parameters need to be implemented + differently, see for example the INCREMENTALITY implementation. + - Add a test in linear_solver_test.cc. + + TODO(user): store the parameter values in a protocol buffer + instead. We need to figure out how to deal with the subtleties of + the default values. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr RELATIVE_MIP_GAP = _pywraplp.MPSolverParameters_RELATIVE_MIP_GAP + r""" + + Limit for relative MIP gap. + """ PRIMAL_TOLERANCE = _pywraplp.MPSolverParameters_PRIMAL_TOLERANCE + r""" + Advanced usage: tolerance for primal feasibility of basic solutions. + + This does not control the integer feasibility tolerance of integer + solutions for MIP or the tolerance used during presolve. + """ DUAL_TOLERANCE = _pywraplp.MPSolverParameters_DUAL_TOLERANCE + r""" + + Advanced usage: tolerance for dual feasibility of basic solutions. + """ PRESOLVE = _pywraplp.MPSolverParameters_PRESOLVE + r""" + + Advanced usage: presolve mode. + """ LP_ALGORITHM = _pywraplp.MPSolverParameters_LP_ALGORITHM + r""" + + Algorithm to solve linear programs. + """ INCREMENTALITY = _pywraplp.MPSolverParameters_INCREMENTALITY + r""" + + Advanced usage: incrementality from one solve to the next. + """ SCALING = _pywraplp.MPSolverParameters_SCALING + r""" + + Advanced usage: enable or disable matrix scaling. + """ PRESOLVE_OFF = _pywraplp.MPSolverParameters_PRESOLVE_OFF PRESOLVE_ON = _pywraplp.MPSolverParameters_PRESOLVE_ON DUAL = _pywraplp.MPSolverParameters_DUAL PRIMAL = _pywraplp.MPSolverParameters_PRIMAL BARRIER = _pywraplp.MPSolverParameters_BARRIER INCREMENTALITY_OFF = _pywraplp.MPSolverParameters_INCREMENTALITY_OFF + r""" + + Start solve from scratch. + """ INCREMENTALITY_ON = _pywraplp.MPSolverParameters_INCREMENTALITY_ON + r""" + + Reuse results from previous solve as much as the underlying solver + allows. + """ SCALING_OFF = _pywraplp.MPSolverParameters_SCALING_OFF + r""" Scaling is off.""" SCALING_ON = _pywraplp.MPSolverParameters_SCALING_ON + r""" Scaling is on.""" def __init__(self): + r""" + + The constructor sets all parameters to their default value. + """ _pywraplp.MPSolverParameters_swiginit(self, _pywraplp.new_MPSolverParameters()) def SetDoubleParam(self, param: 'operations_research::MPSolverParameters::DoubleParam', value: 'double') -> "void": + r""" + + Sets a double parameter to a specific value. + """ return _pywraplp.MPSolverParameters_SetDoubleParam(self, param, value) def SetIntegerParam(self, param: 'operations_research::MPSolverParameters::IntegerParam', value: 'int') -> "void": + r""" + + Sets a integer parameter to a specific value. + """ return _pywraplp.MPSolverParameters_SetIntegerParam(self, param, value) def GetDoubleParam(self, param: 'operations_research::MPSolverParameters::DoubleParam') -> "double": + r""" + + Returns the value of a double parameter. + """ return _pywraplp.MPSolverParameters_GetDoubleParam(self, param) def GetIntegerParam(self, param: 'operations_research::MPSolverParameters::IntegerParam') -> "int": + r""" + + Returns the value of an integer parameter. + """ return _pywraplp.MPSolverParameters_GetIntegerParam(self, param) __swig_destroy__ = _pywraplp.delete_MPSolverParameters @@ -630,10 +1211,25 @@ for opname in LinearExpr.OVERRIDDEN_OPERATOR_METHODS: def Solver_SolveWithProto(model_request, response)
Solves the model encoded by a MPModelRequest protocol buffer and fills the +solution encoded as a MPSolutionResponse.
+Note(user): This creates a temporary MPSolver and destroys it at the end. +If you want to keep the MPSolver alive (for debugging, or for incremental +solving), you should write another version of this function that creates +the MPSolver object on the heap and returns it.
def Solver_SolveWithProto(model_request: 'operations_research::MPModelRequest const &', response: 'operations_research::MPSolutionResponse *') -> "operations_research::MPSolutionResponse *":
+ r"""
+
+ Solves the model encoded by a MPModelRequest protocol buffer and fills the
+ solution encoded as a MPSolutionResponse.
+
+ Note(user): This creates a temporary MPSolver and destroys it at the end.
+ If you want to keep the MPSolver alive (for debugging, or for incremental
+ solving), you should write another version of this function that creates
+ the MPSolver object on the heap and returns it.
+ """
return _pywraplp.Solver_SolveWithProto(model_request, response)
Whether the given problem type is supported (this will depend on the +targets that you linked).
def Solver_SupportsProblemType(problem_type: 'operations_research::MPSolver::OptimizationProblemType') -> "bool":
+ r"""
+
+ Whether the given problem type is supported (this will depend on the
+ targets that you linked).
+ """
return _pywraplp.Solver_SupportsProblemType(problem_type)
Infinity.
+You can use -MPSolver::infinity() for negative infinity.
def Solver_infinity() -> "double":
+ r"""
+
+ Infinity.
+
+ You can use -MPSolver::infinity() for negative infinity.
+ """
return _pywraplp.Solver_infinity()
The class for constraints of a Mathematical Programming (MP) model.
+A constraint is represented as a linear equation or inequality.
class Constraint(object):
+ r"""
+
+ The class for constraints of a Mathematical Programming (MP) model.
+
+ A constraint is represented as a linear equation or inequality.
+ """
+
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
def __init__(self, *args, **kwargs):
@@ -692,33 +1309,96 @@ for opname in LinearExpr.OVERRIDDEN_OPERATOR_METHODS:
__repr__ = _swig_repr
def name(self) -> "std::string const &":
+ r"""
+
+ Returns the name of the constraint.
+ """
return _pywraplp.Constraint_name(self)
def SetCoefficient(self, var: 'Variable', coeff: 'double') -> "void":
+ r"""
+
+ Sets the coefficient of the variable on the constraint.
+
+ If the variable does not belong to the solver, the function just returns,
+ or crashes in non-opt mode.
+ """
return _pywraplp.Constraint_SetCoefficient(self, var, coeff)
def GetCoefficient(self, var: 'Variable') -> "double":
+ r"""
+
+ Gets the coefficient of a given variable on the constraint (which is 0 if
+ the variable does not appear in the constraint).
+ """
return _pywraplp.Constraint_GetCoefficient(self, var)
def lb(self) -> "double":
+ r"""
+
+ Returns the lower bound.
+ """
return _pywraplp.Constraint_lb(self)
def ub(self) -> "double":
+ r"""
+
+ Returns the upper bound.
+ """
return _pywraplp.Constraint_ub(self)
def SetBounds(self, lb: 'double', ub: 'double') -> "void":
+ r"""
+
+ Sets both the lower and upper bounds.
+ """
return _pywraplp.Constraint_SetBounds(self, lb, ub)
def set_is_lazy(self, laziness: 'bool') -> "void":
+ r"""
+
+ Advanced usage: sets the constraint "laziness".
+
+ **This is only supported for SCIP and has no effect on other solvers.**
+
+ When **laziness** is true, the constraint is only considered by the Linear
+ Programming solver if its current solution violates the constraint. In this
+ case, the constraint is definitively added to the problem. This may be
+ useful in some MIP problems, and may have a dramatic impact on performance.
+
+ For more info see: http://tinyurl.com/lazy-constraints.
+ """
return _pywraplp.Constraint_set_is_lazy(self, laziness)
def index(self) -> "int":
+ r"""
+
+ Returns the index of the constraint in the MPSolver::constraints_.
+ """
return _pywraplp.Constraint_index(self)
def dual_value(self) -> "double":
+ r"""
+
+ Advanced usage: returns the dual value of the constraint in the current
+ solution (only available for continuous problems).
+ """
return _pywraplp.Constraint_dual_value(self)
def basis_status(self) -> "operations_research::MPSolver::BasisStatus":
+ r"""
+
+ Advanced usage: returns the basis status of the constraint.
+
+ It is only available for continuous problems).
+
+ Note that if a constraint "linear_expression in [lb, ub]" is transformed
+ into "linear_expression + slack = 0" with slack in [-ub, -lb], then this
+ status is the same as the status of the slack variable with AT_UPPER_BOUND
+ and AT_LOWER_BOUND swapped.
+
+ See also: MPSolver::BasisStatus.
+ """
return _pywraplp.Constraint_basis_status(self)
def Lb(self) -> "double":
@@ -765,10 +1445,16 @@ for opname in LinearExpr.OVERRIDDEN_OPERATOR_METHODS:
def GetCoefficient(self, var)
Gets the coefficient of a given variable on the constraint (which is 0 if +the variable does not appear in the constraint).
def GetCoefficient(self, var: 'Variable') -> "double":
+ r"""
+
+ Gets the coefficient of a given variable on the constraint (which is 0 if
+ the variable does not appear in the constraint).
+ """
return _pywraplp.Constraint_GetCoefficient(self, var)
Sets both the lower and upper bounds.
def SetBounds(self, lb: 'double', ub: 'double') -> "void":
+ r"""
+
+ Sets both the lower and upper bounds.
+ """
return _pywraplp.Constraint_SetBounds(self, lb, ub)
Sets the coefficient of the variable on the constraint.
+If the variable does not belong to the solver, the function just returns, +or crashes in non-opt mode.
def SetCoefficient(self, var: 'Variable', coeff: 'double') -> "void":
+ r"""
+
+ Sets the coefficient of the variable on the constraint.
+
+ If the variable does not belong to the solver, the function just returns,
+ or crashes in non-opt mode.
+ """
return _pywraplp.Constraint_SetCoefficient(self, var, coeff)
Advanced usage: returns the basis status of the constraint.
+It is only available for continuous problems).
+Note that if a constraint "linear_expression in [lb, ub]" is transformed +into "linear_expression + slack = 0" with slack in [-ub, -lb], then this +status is the same as the status of the slack variable with AT_UPPER_BOUND +and AT_LOWER_BOUND swapped.
+See also: MPSolver::BasisStatus.
def basis_status(self) -> "operations_research::MPSolver::BasisStatus":
+ r"""
+
+ Advanced usage: returns the basis status of the constraint.
+
+ It is only available for continuous problems).
+
+ Note that if a constraint "linear_expression in [lb, ub]" is transformed
+ into "linear_expression + slack = 0" with slack in [-ub, -lb], then this
+ status is the same as the status of the slack variable with AT_UPPER_BOUND
+ and AT_LOWER_BOUND swapped.
+
+ See also: MPSolver::BasisStatus.
+ """
return _pywraplp.Constraint_basis_status(self)
Advanced usage: returns the dual value of the constraint in the current +solution (only available for continuous problems).
def dual_value(self) -> "double":
+ r"""
+
+ Advanced usage: returns the dual value of the constraint in the current
+ solution (only available for continuous problems).
+ """
return _pywraplp.Constraint_dual_value(self)
Returns the index of the constraint in the MPSolver::constraints_.
def index(self) -> "int":
+ r"""
+
+ Returns the index of the constraint in the MPSolver::constraints_.
+ """
return _pywraplp.Constraint_index(self)
Returns the lower bound.
def lb(self) -> "double":
+ r"""
+
+ Returns the lower bound.
+ """
return _pywraplp.Constraint_lb(self)
Returns the name of the constraint.
def name(self) -> "std::string const &":
+ r"""
+
+ Returns the name of the constraint.
+ """
return _pywraplp.Constraint_name(self)
Advanced usage: sets the constraint "laziness".
+This is only supported for SCIP and has no effect on other solvers.
+When laziness is true, the constraint is only considered by the Linear +Programming solver if its current solution violates the constraint. In this +case, the constraint is definitively added to the problem. This may be +useful in some MIP problems, and may have a dramatic impact on performance.
+For more info see: http://tinyurl.com/lazy-constraints.
def set_is_lazy(self, laziness: 'bool') -> "void":
+ r"""
+
+ Advanced usage: sets the constraint "laziness".
+
+ **This is only supported for SCIP and has no effect on other solvers.**
+
+ When **laziness** is true, the constraint is only considered by the Linear
+ Programming solver if its current solution violates the constraint. In this
+ case, the constraint is definitively added to the problem. This may be
+ useful in some MIP problems, and may have a dramatic impact on performance.
+
+ For more info see: http://tinyurl.com/lazy-constraints.
+ """
return _pywraplp.Constraint_set_is_lazy(self, laziness)
Returns the upper bound.
def ub(self) -> "double":
+ r"""
+
+ Returns the upper bound.
+ """
return _pywraplp.Constraint_ub(self)
This class stores parameter settings for LP and MIP solvers. Some parameters +are marked as advanced: do not change their values unless you know what you +are doing!
+For developers: how to add a new parameter: +- Add the new Foo parameter in the DoubleParam or IntegerParam enum. +- If it is a categorical param, add a FooValues enum. +- Decide if the wrapper should define a default value for it: yes +if it controls the properties of the solution (example: +tolerances) or if it consistently improves performance, no +otherwise. If yes, define kDefaultFoo. +- Add a foo_value_ member and, if no default value is defined, a +foo_is_default_ member. +- Add code to handle Foo in Set…Param, Reset…Param, +Get…Param, Reset and the constructor. +- In class MPSolverInterface, add a virtual method SetFoo, add it +to SetCommonParameters or SetMIPParameters, and implement it for +each solver. Sometimes, parameters need to be implemented +differently, see for example the INCREMENTALITY implementation. +- Add a test in linear_solver_test.cc.
+TODO(user): store the parameter values in a protocol buffer +instead. We need to figure out how to deal with the subtleties of +the default values.
+The constructor sets all parameters to their default value.
class MPSolverParameters(object):
+ r"""
+
+ This class stores parameter settings for LP and MIP solvers. Some parameters
+ are marked as advanced: do not change their values unless you know what you
+ are doing!
+
+ For developers: how to add a new parameter:
+ - Add the new Foo parameter in the DoubleParam or IntegerParam enum.
+ - If it is a categorical param, add a FooValues enum.
+ - Decide if the wrapper should define a default value for it: yes
+ if it controls the properties of the solution (example:
+ tolerances) or if it consistently improves performance, no
+ otherwise. If yes, define kDefaultFoo.
+ - Add a foo_value_ member and, if no default value is defined, a
+ foo_is_default_ member.
+ - Add code to handle Foo in Set...Param, Reset...Param,
+ Get...Param, Reset and the constructor.
+ - In class MPSolverInterface, add a virtual method SetFoo, add it
+ to SetCommonParameters or SetMIPParameters, and implement it for
+ each solver. Sometimes, parameters need to be implemented
+ differently, see for example the INCREMENTALITY implementation.
+ - Add a test in linear_solver_test.cc.
+
+ TODO(user): store the parameter values in a protocol buffer
+ instead. We need to figure out how to deal with the subtleties of
+ the default values.
+ """
+
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
RELATIVE_MIP_GAP = _pywraplp.MPSolverParameters_RELATIVE_MIP_GAP
+ r"""
+
+ Limit for relative MIP gap.
+ """
PRIMAL_TOLERANCE = _pywraplp.MPSolverParameters_PRIMAL_TOLERANCE
+ r"""
+ Advanced usage: tolerance for primal feasibility of basic solutions.
+
+ This does not control the integer feasibility tolerance of integer
+ solutions for MIP or the tolerance used during presolve.
+ """
DUAL_TOLERANCE = _pywraplp.MPSolverParameters_DUAL_TOLERANCE
+ r"""
+
+ Advanced usage: tolerance for dual feasibility of basic solutions.
+ """
PRESOLVE = _pywraplp.MPSolverParameters_PRESOLVE
+ r"""
+
+ Advanced usage: presolve mode.
+ """
LP_ALGORITHM = _pywraplp.MPSolverParameters_LP_ALGORITHM
+ r"""
+
+ Algorithm to solve linear programs.
+ """
INCREMENTALITY = _pywraplp.MPSolverParameters_INCREMENTALITY
+ r"""
+
+ Advanced usage: incrementality from one solve to the next.
+ """
SCALING = _pywraplp.MPSolverParameters_SCALING
+ r"""
+
+ Advanced usage: enable or disable matrix scaling.
+ """
PRESOLVE_OFF = _pywraplp.MPSolverParameters_PRESOLVE_OFF
PRESOLVE_ON = _pywraplp.MPSolverParameters_PRESOLVE_ON
DUAL = _pywraplp.MPSolverParameters_DUAL
PRIMAL = _pywraplp.MPSolverParameters_PRIMAL
BARRIER = _pywraplp.MPSolverParameters_BARRIER
INCREMENTALITY_OFF = _pywraplp.MPSolverParameters_INCREMENTALITY_OFF
+ r"""
+
+ Start solve from scratch.
+ """
INCREMENTALITY_ON = _pywraplp.MPSolverParameters_INCREMENTALITY_ON
+ r"""
+
+ Reuse results from previous solve as much as the underlying solver
+ allows.
+ """
SCALING_OFF = _pywraplp.MPSolverParameters_SCALING_OFF
+ r""" Scaling is off."""
SCALING_ON = _pywraplp.MPSolverParameters_SCALING_ON
+ r""" Scaling is on."""
def __init__(self):
+ r"""
+
+ The constructor sets all parameters to their default value.
+ """
_pywraplp.MPSolverParameters_swiginit(self, _pywraplp.new_MPSolverParameters())
def SetDoubleParam(self, param: 'operations_research::MPSolverParameters::DoubleParam', value: 'double') -> "void":
+ r"""
+
+ Sets a double parameter to a specific value.
+ """
return _pywraplp.MPSolverParameters_SetDoubleParam(self, param, value)
def SetIntegerParam(self, param: 'operations_research::MPSolverParameters::IntegerParam', value: 'int') -> "void":
+ r"""
+
+ Sets a integer parameter to a specific value.
+ """
return _pywraplp.MPSolverParameters_SetIntegerParam(self, param, value)
def GetDoubleParam(self, param: 'operations_research::MPSolverParameters::DoubleParam') -> "double":
+ r"""
+
+ Returns the value of a double parameter.
+ """
return _pywraplp.MPSolverParameters_GetDoubleParam(self, param)
def GetIntegerParam(self, param: 'operations_research::MPSolverParameters::IntegerParam') -> "int":
+ r"""
+
+ Returns the value of an integer parameter.
+ """
return _pywraplp.MPSolverParameters_GetIntegerParam(self, param)
__swig_destroy__ = _pywraplp.delete_MPSolverParameters
var DUAL_TOLERANCEAdvanced usage: tolerance for dual feasibility of basic solutions.
var INCREMENTALITYAdvanced usage: incrementality from one solve to the next.
var INCREMENTALITY_OFFStart solve from scratch.
var INCREMENTALITY_ONReuse results from previous solve as much as the underlying solver +allows.
var LP_ALGORITHMAlgorithm to solve linear programs.
var PRESOLVEAdvanced usage: presolve mode.
var PRESOLVE_OFFvar PRIMAL_TOLERANCEAdvanced usage: tolerance for primal feasibility of basic solutions.
+This does not control the integer feasibility tolerance of integer +solutions for MIP or the tolerance used during presolve.
var RELATIVE_MIP_GAPLimit for relative MIP gap.
var SCALINGAdvanced usage: enable or disable matrix scaling.
var SCALING_OFFScaling is off.
var SCALING_ONScaling is on.
var kDefaultDualToleranceReturns the value of a double parameter.
def GetDoubleParam(self, param: 'operations_research::MPSolverParameters::DoubleParam') -> "double":
+ r"""
+
+ Returns the value of a double parameter.
+ """
return _pywraplp.MPSolverParameters_GetDoubleParam(self, param)
Returns the value of an integer parameter.
def GetIntegerParam(self, param: 'operations_research::MPSolverParameters::IntegerParam') -> "int":
+ r"""
+
+ Returns the value of an integer parameter.
+ """
return _pywraplp.MPSolverParameters_GetIntegerParam(self, param)
Sets a double parameter to a specific value.
def SetDoubleParam(self, param: 'operations_research::MPSolverParameters::DoubleParam', value: 'double') -> "void":
+ r"""
+
+ Sets a double parameter to a specific value.
+ """
return _pywraplp.MPSolverParameters_SetDoubleParam(self, param, value)
Sets a integer parameter to a specific value.
def SetIntegerParam(self, param: 'operations_research::MPSolverParameters::IntegerParam', value: 'int') -> "void":
+ r"""
+
+ Sets a integer parameter to a specific value.
+ """
return _pywraplp.MPSolverParameters_SetIntegerParam(self, param, value)
A class to express a linear objective.
class Objective(object):
+ r"""
+
+ A class to express a linear objective.
+ """
+
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
def __init__(self, *args, **kwargs):
@@ -1149,39 +2043,104 @@ for opname in LinearExpr.OVERRIDDEN_OPERATOR_METHODS:
__repr__ = _swig_repr
def Clear(self) -> "void":
+ r"""
+
+ Clears the offset, all variables and coefficients, and the optimization
+ direction.
+ """
return _pywraplp.Objective_Clear(self)
def SetCoefficient(self, var: 'Variable', coeff: 'double') -> "void":
+ r"""
+
+ Sets the coefficient of the variable in the objective.
+
+ If the variable does not belong to the solver, the function just returns,
+ or crashes in non-opt mode.
+ """
return _pywraplp.Objective_SetCoefficient(self, var, coeff)
def GetCoefficient(self, var: 'Variable') -> "double":
+ r"""
+
+ Gets the coefficient of a given variable in the objective
+
+ It returns 0 if the variable does not appear in the objective).
+ """
return _pywraplp.Objective_GetCoefficient(self, var)
def SetOffset(self, value: 'double') -> "void":
+ r"""
+
+ Sets the constant term in the objective.
+ """
return _pywraplp.Objective_SetOffset(self, value)
def offset(self) -> "double":
+ r"""
+
+ Gets the constant term in the objective.
+ """
return _pywraplp.Objective_offset(self)
def SetOptimizationDirection(self, maximize: 'bool') -> "void":
+ r"""
+
+ Sets the optimization direction (maximize: true or minimize: false).
+ """
return _pywraplp.Objective_SetOptimizationDirection(self, maximize)
def SetMinimization(self) -> "void":
+ r"""
+
+ Sets the optimization direction to minimize.
+ """
return _pywraplp.Objective_SetMinimization(self)
def SetMaximization(self) -> "void":
+ r"""
+
+ Sets the optimization direction to maximize.
+ """
return _pywraplp.Objective_SetMaximization(self)
def maximization(self) -> "bool":
+ r"""
+
+ Is the optimization direction set to maximize?
+ """
return _pywraplp.Objective_maximization(self)
def minimization(self) -> "bool":
+ r"""
+
+ Is the optimization direction set to minimize?
+ """
return _pywraplp.Objective_minimization(self)
def Value(self) -> "double":
+ r"""
+
+ Returns the objective value of the best solution found so far.
+
+ It is the optimal objective value if the problem has been solved to
+ optimality.
+
+ Note: the objective value may be slightly different than what you could
+ compute yourself using ``MPVariable::solution_value();`` please use the
+ --verify_solution flag to gain confidence about the numerical stability of
+ your solution.
+ """
return _pywraplp.Objective_Value(self)
def BestBound(self) -> "double":
+ r"""
+
+ Returns the best objective bound.
+
+ In case of minimization, it is a lower bound on the objective value of the
+ optimal integer solution. Only available for discrete problems.
+ """
return _pywraplp.Objective_BestBound(self)
def Offset(self) -> "double":
@@ -1205,10 +2164,19 @@ for opname in LinearExpr.OVERRIDDEN_OPERATOR_METHODS:
def BestBound(self)
Returns the best objective bound.
+In case of minimization, it is a lower bound on the objective value of the +optimal integer solution. Only available for discrete problems.
def BestBound(self) -> "double":
+ r"""
+
+ Returns the best objective bound.
+
+ In case of minimization, it is a lower bound on the objective value of the
+ optimal integer solution. Only available for discrete problems.
+ """
return _pywraplp.Objective_BestBound(self)
Clears the offset, all variables and coefficients, and the optimization +direction.
def Clear(self) -> "void":
+ r"""
+
+ Clears the offset, all variables and coefficients, and the optimization
+ direction.
+ """
return _pywraplp.Objective_Clear(self)
Gets the coefficient of a given variable in the objective
+It returns 0 if the variable does not appear in the objective).
def GetCoefficient(self, var: 'Variable') -> "double":
+ r"""
+
+ Gets the coefficient of a given variable in the objective
+
+ It returns 0 if the variable does not appear in the objective).
+ """
return _pywraplp.Objective_GetCoefficient(self, var)
Sets the coefficient of the variable in the objective.
+If the variable does not belong to the solver, the function just returns, +or crashes in non-opt mode.
def SetCoefficient(self, var: 'Variable', coeff: 'double') -> "void":
+ r"""
+
+ Sets the coefficient of the variable in the objective.
+
+ If the variable does not belong to the solver, the function just returns,
+ or crashes in non-opt mode.
+ """
return _pywraplp.Objective_SetCoefficient(self, var, coeff)
Sets the optimization direction to maximize.
def SetMaximization(self) -> "void":
+ r"""
+
+ Sets the optimization direction to maximize.
+ """
return _pywraplp.Objective_SetMaximization(self)
Sets the optimization direction to minimize.
def SetMinimization(self) -> "void":
+ r"""
+
+ Sets the optimization direction to minimize.
+ """
return _pywraplp.Objective_SetMinimization(self)
Sets the constant term in the objective.
def SetOffset(self, value: 'double') -> "void":
+ r"""
+
+ Sets the constant term in the objective.
+ """
return _pywraplp.Objective_SetOffset(self, value)
Sets the optimization direction (maximize: true or minimize: false).
def SetOptimizationDirection(self, maximize: 'bool') -> "void":
+ r"""
+
+ Sets the optimization direction (maximize: true or minimize: false).
+ """
return _pywraplp.Objective_SetOptimizationDirection(self, maximize)
Returns the objective value of the best solution found so far.
+It is the optimal objective value if the problem has been solved to +optimality.
+Note: the objective value may be slightly different than what you could
+compute yourself using MPVariable::solution_value(); please use the
+–verify_solution flag to gain confidence about the numerical stability of
+your solution.
def Value(self) -> "double":
+ r"""
+
+ Returns the objective value of the best solution found so far.
+
+ It is the optimal objective value if the problem has been solved to
+ optimality.
+
+ Note: the objective value may be slightly different than what you could
+ compute yourself using ``MPVariable::solution_value();`` please use the
+ --verify_solution flag to gain confidence about the numerical stability of
+ your solution.
+ """
return _pywraplp.Objective_Value(self)
Is the optimization direction set to maximize?
def maximization(self) -> "bool":
+ r"""
+
+ Is the optimization direction set to maximize?
+ """
return _pywraplp.Objective_maximization(self)
Is the optimization direction set to minimize?
def minimization(self) -> "bool":
+ r"""
+
+ Is the optimization direction set to minimize?
+ """
return _pywraplp.Objective_minimization(self)
Gets the constant term in the objective.
def offset(self) -> "double":
+ r"""
+
+ Gets the constant term in the objective.
+ """
return _pywraplp.Objective_offset(self)
This mathematical programming (MP) solver class is the main class +though which users build and solve problems.
+Create a solver with the given name and underlying solver backend.
class Solver(object):
+ r"""
+
+ This mathematical programming (MP) solver class is the main class
+ though which users build and solve problems.
+ """
+
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
CLP_LINEAR_PROGRAMMING = _pywraplp.Solver_CLP_LINEAR_PROGRAMMING
+ r""" Linear Programming solver using Coin CBC."""
GLOP_LINEAR_PROGRAMMING = _pywraplp.Solver_GLOP_LINEAR_PROGRAMMING
+ r""" Linear Programming solver using GLOP (Recommended solver)."""
CBC_MIXED_INTEGER_PROGRAMMING = _pywraplp.Solver_CBC_MIXED_INTEGER_PROGRAMMING
+ r""" Mixed integer Programming Solver using Coin CBC."""
BOP_INTEGER_PROGRAMMING = _pywraplp.Solver_BOP_INTEGER_PROGRAMMING
+ r""" Linear Boolean Programming Solver."""
def __init__(self, name: 'std::string const &', problem_type: 'operations_research::MPSolver::OptimizationProblemType'):
+ r"""
+
+ Create a solver with the given name and underlying solver backend.
+ """
_pywraplp.Solver_swiginit(self, _pywraplp.new_Solver(name, problem_type))
__swig_destroy__ = _pywraplp.delete_Solver
@staticmethod
def SupportsProblemType(problem_type: 'operations_research::MPSolver::OptimizationProblemType') -> "bool":
+ r"""
+
+ Whether the given problem type is supported (this will depend on the
+ targets that you linked).
+ """
return _pywraplp.Solver_SupportsProblemType(problem_type)
def Clear(self) -> "void":
+ r"""
+
+ Clears the objective (including the optimization direction), all variables
+ and constraints. All the other properties of the MPSolver (like the time
+ limit) are kept untouched.
+ """
return _pywraplp.Solver_Clear(self)
def NumVariables(self) -> "int":
+ r"""
+
+ Returns the number of variables.
+ """
return _pywraplp.Solver_NumVariables(self)
def variables(self) -> "std::vector< operations_research::MPVariable * > const &":
+ r"""
+
+ Returns the array of variables handled by the MPSolver. (They are listed in
+ the order in which they were created.)
+ """
return _pywraplp.Solver_variables(self)
def LookupVariable(self, var_name: 'std::string const &') -> "operations_research::MPVariable *":
+ r"""
+
+ Looks up a variable by name, and returns nullptr if it does not exist. The
+ first call has a O(n) complexity, as the variable name index is lazily
+ created upon first use. Will crash if variable names are not unique.
+ """
return _pywraplp.Solver_LookupVariable(self, var_name)
def Var(self, lb: 'double', ub: 'double', integer: 'bool', name: 'std::string const &') -> "operations_research::MPVariable *":
+ r"""
+
+ Creates a variable with the given bounds, integrality requirement and
+ name. Bounds can be finite or +/- MPSolver::infinity(). The MPSolver owns
+ the variable (i.e. the returned pointer is borrowed). Variable names are
+ optional. If you give an empty name, name() will auto-generate one for you
+ upon request.
+ """
return _pywraplp.Solver_Var(self, lb, ub, integer, name)
def NumVar(self, lb: 'double', ub: 'double', name: 'std::string const &') -> "operations_research::MPVariable *":
+ r"""
+
+ Creates a continuous variable.
+ """
return _pywraplp.Solver_NumVar(self, lb, ub, name)
def IntVar(self, lb: 'double', ub: 'double', name: 'std::string const &') -> "operations_research::MPVariable *":
+ r"""
+
+ Creates an integer variable.
+ """
return _pywraplp.Solver_IntVar(self, lb, ub, name)
def BoolVar(self, name: 'std::string const &') -> "operations_research::MPVariable *":
+ r"""
+
+ Creates a boolean variable.
+ """
return _pywraplp.Solver_BoolVar(self, name)
def NumConstraints(self) -> "int":
+ r"""
+
+ Returns the number of constraints.
+ """
return _pywraplp.Solver_NumConstraints(self)
def constraints(self) -> "std::vector< operations_research::MPConstraint * > const &":
+ r"""
+
+ Returns the array of constraints handled by the MPSolver.
+
+ They are listed in the order in which they were created.
+ """
return _pywraplp.Solver_constraints(self)
def LookupConstraint(self, constraint_name: 'std::string const &') -> "operations_research::MPConstraint *":
+ r"""
+
+ Looks up a constraint by name, and returns nullptr if it does not exist.
+
+ The first call has a O(n) complexity, as the constraint name index is
+ lazily created upon first use. Will crash if constraint names are not
+ unique.
+ """
return _pywraplp.Solver_LookupConstraint(self, constraint_name)
def Constraint(self, *args) -> "operations_research::MPConstraint *":
+ r"""
+ *Overload 1:*
+
+ Creates a linear constraint with given bounds.
+
+ Bounds can be finite or +/- MPSolver::infinity(). The MPSolver class
+ assumes ownership of the constraint.
+
+ :rtype: :py:class:`MPConstraint`
+ :return: a pointer to the newly created constraint.
+
+ |
+
+ *Overload 2:*
+
+ Creates a constraint with -infinity and +infinity bounds.
+
+ |
+
+ *Overload 3:*
+
+ Creates a named constraint with given bounds.
+
+ |
+
+ *Overload 4:*
+
+ Creates a named constraint with -infinity and +infinity bounds.
+ """
return _pywraplp.Solver_Constraint(self, *args)
def Objective(self) -> "operations_research::MPObjective *":
+ r"""
+
+ Returns the mutable objective object.
+ """
return _pywraplp.Solver_Objective(self)
OPTIMAL = _pywraplp.Solver_OPTIMAL
+ r""" optimal."""
FEASIBLE = _pywraplp.Solver_FEASIBLE
+ r""" feasible, or stopped by limit."""
INFEASIBLE = _pywraplp.Solver_INFEASIBLE
+ r""" proven infeasible."""
UNBOUNDED = _pywraplp.Solver_UNBOUNDED
+ r""" proven unbounded."""
ABNORMAL = _pywraplp.Solver_ABNORMAL
+ r""" abnormal, i.e., error of some kind."""
NOT_SOLVED = _pywraplp.Solver_NOT_SOLVED
+ r""" not been solved yet."""
def Solve(self, *args) -> "operations_research::MPSolver::ResultStatus":
+ r"""
+ *Overload 1:*
+
+ Solves the problem using default parameter values.
+
+ |
+
+ *Overload 2:*
+
+ Solves the problem using the specified parameter values.
+ """
return _pywraplp.Solver_Solve(self, *args)
def ComputeConstraintActivities(self) -> "std::vector< double >":
+ r"""
+
+ Advanced usage: compute the "activities" of all constraints, which are the
+ sums of their linear terms. The activities are returned in the same order
+ as constraints(), which is the order in which constraints were added; but
+ you can also use MPConstraint::index() to get a constraint's index.
+ """
return _pywraplp.Solver_ComputeConstraintActivities(self)
def VerifySolution(self, tolerance: 'double', log_errors: 'bool') -> "bool":
+ r"""
+
+ Advanced usage: Verifies the *correctness* of the solution.
+
+ It verifies that all variables must be within their domains, all
+ constraints must be satisfied, and the reported objective value must be
+ accurate.
+
+ Usage:
+ - This can only be called after Solve() was called.
+ - "tolerance" is interpreted as an absolute error threshold.
+ - For the objective value only, if the absolute error is too large,
+ the tolerance is interpreted as a relative error threshold instead.
+ - If "log_errors" is true, every single violation will be logged.
+ - If "tolerance" is negative, it will be set to infinity().
+
+ Most users should just set the --verify_solution flag and not bother using
+ this method directly.
+ """
return _pywraplp.Solver_VerifySolution(self, tolerance, log_errors)
def InterruptSolve(self) -> "bool":
+ r"""
+ Interrupts the Solve() execution to terminate processing if possible.
+
+ If the underlying interface supports interruption; it does that and returns
+ true regardless of whether there's an ongoing Solve() or not. The Solve()
+ call may still linger for a while depending on the conditions. If
+ interruption is not supported; returns false and does nothing.
+ """
return _pywraplp.Solver_InterruptSolve(self)
def FillSolutionResponseProto(self, response: 'operations_research::MPSolutionResponse *') -> "void":
+ r"""
+
+ Encodes the current solution in a solution response protocol buffer.
+ """
return _pywraplp.Solver_FillSolutionResponseProto(self, response)
@staticmethod
def SolveWithProto(model_request: 'operations_research::MPModelRequest const &', response: 'operations_research::MPSolutionResponse *') -> "operations_research::MPSolutionResponse *":
+ r"""
+
+ Solves the model encoded by a MPModelRequest protocol buffer and fills the
+ solution encoded as a MPSolutionResponse.
+
+ Note(user): This creates a temporary MPSolver and destroys it at the end.
+ If you want to keep the MPSolver alive (for debugging, or for incremental
+ solving), you should write another version of this function that creates
+ the MPSolver object on the heap and returns it.
+ """
return _pywraplp.Solver_SolveWithProto(model_request, response)
def ExportModelToProto(self, output_model: 'operations_research::MPModelProto *') -> "void":
+ r"""
+
+ Exports model to protocol buffer.
+ """
return _pywraplp.Solver_ExportModelToProto(self, output_model)
def LoadSolutionFromProto(self, *args) -> "util::Status":
+ r"""
+
+ Load a solution encoded in a protocol buffer onto this solver for easy
+ access via the MPSolver interface.
+
+ IMPORTANT: This may only be used in conjunction with ExportModel(),
+ following this example:
+
+
+ .. code-block:: c++
+
+
+ MPSolver my_solver;
+ ... add variables and constraints ...
+ MPModelProto model_proto;
+ my_solver.ExportModelToProto(model_proto);
+ MPSolutionResponse solver_response;
+ MPSolver::SolveWithProto(model_proto, solver_response);
+ if (solver_response.result_status() == MPSolutionResponse::OPTIMAL) {
+ CHECK_OK(my_solver.LoadSolutionFromProto(solver_response));
+ ... inspect the solution using the usual API: solution_value(), etc...
+ }
+
+
+ The response must be in OPTIMAL or FEASIBLE status.
+
+ Returns a non-OK status if a problem arised (typically, if it wasn't used
+ like it should be):
+ - loading a solution whose variables don't correspond to the solver's
+ current variables
+ - loading a solution with a status other than OPTIMAL / FEASIBLE.
+
+ Note: the objective value isn't checked. You can use VerifySolution() for
+ that.
+ """
return _pywraplp.Solver_LoadSolutionFromProto(self, *args)
def SetSolverSpecificParametersAsString(self, parameters: 'std::string const &') -> "bool":
+ r"""
+
+ Advanced usage: pass solver specific parameters in text format.
+
+ The format is solver-specific and is the same as the corresponding solver
+ configuration file format. Returns true if the operation was successful.
+
+ TODO(user): Currently SCIP will always return true even if the format is
+ wrong (you can check the log if you suspect an issue there). This seems to
+ be a bug in SCIP though.
+ """
return _pywraplp.Solver_SetSolverSpecificParametersAsString(self, parameters)
FREE = _pywraplp.Solver_FREE
AT_LOWER_BOUND = _pywraplp.Solver_AT_LOWER_BOUND
@@ -1450,24 +2714,81 @@ for opname in LinearExpr.OVERRIDDEN_OPERATOR_METHODS:
@staticmethod
def infinity() -> "double":
+ r"""
+
+ Infinity.
+
+ You can use -MPSolver::infinity() for negative infinity.
+ """
return _pywraplp.Solver_infinity()
def EnableOutput(self) -> "void":
+ r""" Enable output."""
return _pywraplp.Solver_EnableOutput(self)
def SuppressOutput(self) -> "void":
+ r""" Suppress output."""
return _pywraplp.Solver_SuppressOutput(self)
def iterations(self) -> "int64":
+ r"""
+
+ Returns the number of simplex iterations.
+ """
return _pywraplp.Solver_iterations(self)
def nodes(self) -> "int64":
+ r"""
+
+ Returns the number of branch-and-bound nodes evaluated during the solve.
+
+ Only available for discrete problems.
+ """
return _pywraplp.Solver_nodes(self)
def ComputeExactConditionNumber(self) -> "double":
+ r"""
+ Advanced usage: computes the exact condition number of the current scaled
+ basis: L1norm(B) * L1norm(inverse(B)), where B is the scaled basis.
+
+ This method requires that a basis exists: it should be called after Solve.
+ It is only available for continuous problems. It is implemented for GLPK
+ but not CLP because CLP does not provide the API for doing it.
+
+ The condition number measures how well the constraint matrix is conditioned
+ and can be used to predict whether numerical issues will arise during the
+ solve: the model is declared infeasible whereas it is feasible (or
+ vice-versa), the solution obtained is not optimal or violates some
+ constraints, the resolution is slow because of repeated singularities.
+
+ The rule of thumb to interpret the condition number kappa is:
+ - o kappa <= 1e7: virtually no chance of numerical issues
+ - o 1e7 < kappa <= 1e10: small chance of numerical issues
+ - o 1e10 < kappa <= 1e13: medium chance of numerical issues
+ - o kappa > 1e13: high chance of numerical issues
+
+ The computation of the condition number depends on the quality of the LU
+ decomposition, so it is not very accurate when the matrix is ill
+ conditioned.
+ """
return _pywraplp.Solver_ComputeExactConditionNumber(self)
def NextSolution(self) -> "bool":
+ r"""
+
+ Some solvers (MIP only, not LP) can produce multiple solutions to the
+ problem. Returns true when another solution is available, and updates the
+ MPVariable* objects to make the new solution queryable. Call only after
+ calling solve.
+
+ The optimality properties of the additional solutions found, and whether or
+ not the solver computes them ahead of time or when NextSolution() is called
+ is solver specific.
+
+ As of 2018-08-09, only Gurobi supports NextSolution(), see
+ linear_solver_underlying_gurobi_test for an example of how to configure
+ Gurobi for this purpose. The other solvers return false unconditionally.
+ """
return _pywraplp.Solver_NextSolution(self)
def set_time_limit(self, time_limit_milliseconds: 'int64') -> "void":
@@ -1551,7 +2872,7 @@ for opname in LinearExpr.OVERRIDDEN_OPERATOR_METHODS:
var ABNORMAL
-
-
+
abnormal, i.e., error of some kind.
var AT_LOWER_BOUND
-
@@ -1567,19 +2888,19 @@ for opname in LinearExpr.OVERRIDDEN_OPERATOR_METHODS:
var BOP_INTEGER_PROGRAMMING
-
-
+
Linear Boolean Programming Solver.
var CBC_MIXED_INTEGER_PROGRAMMING
-
-
+
Mixed integer Programming Solver using Coin CBC.
var CLP_LINEAR_PROGRAMMING
-
-
+
Linear Programming solver using Coin CBC.
var FEASIBLE
-
-
+
feasible, or stopped by limit.
var FIXED_VALUE
-
@@ -1591,23 +2912,23 @@ for opname in LinearExpr.OVERRIDDEN_OPERATOR_METHODS:
var GLOP_LINEAR_PROGRAMMING
-
-
+
Linear Programming solver using GLOP (Recommended solver).
var INFEASIBLE
-
-
+
proven infeasible.
var NOT_SOLVED
-
-
+
not been solved yet.
var OPTIMAL
-
-
+
optimal.
var UNBOUNDED
-
-
+
proven unbounded.
Static methods
@@ -1628,11 +2949,26 @@ def Infinity() -> "double":
def SolveWithProto(model_request, response)
Solves the model encoded by a MPModelRequest protocol buffer and fills the +solution encoded as a MPSolutionResponse.
+Note(user): This creates a temporary MPSolver and destroys it at the end. +If you want to keep the MPSolver alive (for debugging, or for incremental +solving), you should write another version of this function that creates +the MPSolver object on the heap and returns it.
@staticmethod
def SolveWithProto(model_request: 'operations_research::MPModelRequest const &', response: 'operations_research::MPSolutionResponse *') -> "operations_research::MPSolutionResponse *":
+ r"""
+
+ Solves the model encoded by a MPModelRequest protocol buffer and fills the
+ solution encoded as a MPSolutionResponse.
+
+ Note(user): This creates a temporary MPSolver and destroys it at the end.
+ If you want to keep the MPSolver alive (for debugging, or for incremental
+ solving), you should write another version of this function that creates
+ the MPSolver object on the heap and returns it.
+ """
return _pywraplp.Solver_SolveWithProto(model_request, response)
Whether the given problem type is supported (this will depend on the +targets that you linked).
@staticmethod
def SupportsProblemType(problem_type: 'operations_research::MPSolver::OptimizationProblemType') -> "bool":
+ r"""
+
+ Whether the given problem type is supported (this will depend on the
+ targets that you linked).
+ """
return _pywraplp.Solver_SupportsProblemType(problem_type)
Infinity.
+You can use -MPSolver::infinity() for negative infinity.
@staticmethod
def infinity() -> "double":
+ r"""
+
+ Infinity.
+
+ You can use -MPSolver::infinity() for negative infinity.
+ """
return _pywraplp.Solver_infinity()
Creates a boolean variable.
def BoolVar(self, name: 'std::string const &') -> "operations_research::MPVariable *":
+ r"""
+
+ Creates a boolean variable.
+ """
return _pywraplp.Solver_BoolVar(self, name)
Clears the objective (including the optimization direction), all variables +and constraints. All the other properties of the MPSolver (like the time +limit) are kept untouched.
def Clear(self) -> "void":
+ r"""
+
+ Clears the objective (including the optimization direction), all variables
+ and constraints. All the other properties of the MPSolver (like the time
+ limit) are kept untouched.
+ """
return _pywraplp.Solver_Clear(self)
Advanced usage: compute the "activities" of all constraints, which are the +sums of their linear terms. The activities are returned in the same order +as constraints(), which is the order in which constraints were added; but +you can also use MPConstraint::index() to get a constraint's index.
def ComputeConstraintActivities(self) -> "std::vector< double >":
+ r"""
+
+ Advanced usage: compute the "activities" of all constraints, which are the
+ sums of their linear terms. The activities are returned in the same order
+ as constraints(), which is the order in which constraints were added; but
+ you can also use MPConstraint::index() to get a constraint's index.
+ """
return _pywraplp.Solver_ComputeConstraintActivities(self)
Advanced usage: computes the exact condition number of the current scaled +basis: L1norm(B) * L1norm(inverse(B)), where B is the scaled basis.
+This method requires that a basis exists: it should be called after Solve. +It is only available for continuous problems. It is implemented for GLPK +but not CLP because CLP does not provide the API for doing it.
+The condition number measures how well the constraint matrix is conditioned +and can be used to predict whether numerical issues will arise during the +solve: the model is declared infeasible whereas it is feasible (or +vice-versa), the solution obtained is not optimal or violates some +constraints, the resolution is slow because of repeated singularities.
+The rule of thumb to interpret the condition number kappa is: +- o kappa <= 1e7: virtually no chance of numerical issues +- o 1e7 < kappa <= 1e10: small chance of numerical issues +- o 1e10 < kappa <= 1e13: medium chance of numerical issues +- o kappa > 1e13: high chance of numerical issues
+The computation of the condition number depends on the quality of the LU +decomposition, so it is not very accurate when the matrix is ill +conditioned.
def ComputeExactConditionNumber(self) -> "double":
+ r"""
+ Advanced usage: computes the exact condition number of the current scaled
+ basis: L1norm(B) * L1norm(inverse(B)), where B is the scaled basis.
+
+ This method requires that a basis exists: it should be called after Solve.
+ It is only available for continuous problems. It is implemented for GLPK
+ but not CLP because CLP does not provide the API for doing it.
+
+ The condition number measures how well the constraint matrix is conditioned
+ and can be used to predict whether numerical issues will arise during the
+ solve: the model is declared infeasible whereas it is feasible (or
+ vice-versa), the solution obtained is not optimal or violates some
+ constraints, the resolution is slow because of repeated singularities.
+
+ The rule of thumb to interpret the condition number kappa is:
+ - o kappa <= 1e7: virtually no chance of numerical issues
+ - o 1e7 < kappa <= 1e10: small chance of numerical issues
+ - o 1e10 < kappa <= 1e13: medium chance of numerical issues
+ - o kappa > 1e13: high chance of numerical issues
+
+ The computation of the condition number depends on the quality of the LU
+ decomposition, so it is not very accurate when the matrix is ill
+ conditioned.
+ """
return _pywraplp.Solver_ComputeExactConditionNumber(self)
Overload 1:
+Creates a linear constraint with given bounds.
+Bounds can be finite or +/- MPSolver::infinity(). The MPSolver class +assumes ownership of the constraint.
+:rtype: :py:class:MPConstraint
+:return: a pointer to the newly created constraint.
|
+Overload 2:
+Creates a constraint with -infinity and +infinity bounds.
+|
+Overload 3:
+Creates a named constraint with given bounds.
+|
+Overload 4:
+Creates a named constraint with -infinity and +infinity bounds.
def Constraint(self, *args) -> "operations_research::MPConstraint *":
+ r"""
+ *Overload 1:*
+
+ Creates a linear constraint with given bounds.
+
+ Bounds can be finite or +/- MPSolver::infinity(). The MPSolver class
+ assumes ownership of the constraint.
+
+ :rtype: :py:class:`MPConstraint`
+ :return: a pointer to the newly created constraint.
+
+ |
+
+ *Overload 2:*
+
+ Creates a constraint with -infinity and +infinity bounds.
+
+ |
+
+ *Overload 3:*
+
+ Creates a named constraint with given bounds.
+
+ |
+
+ *Overload 4:*
+
+ Creates a named constraint with -infinity and +infinity bounds.
+ """
return _pywraplp.Solver_Constraint(self, *args)
Enable output.
def EnableOutput(self) -> "void":
+ r""" Enable output."""
return _pywraplp.Solver_EnableOutput(self)
Exports model to protocol buffer.
def ExportModelToProto(self, output_model: 'operations_research::MPModelProto *') -> "void":
+ r"""
+
+ Exports model to protocol buffer.
+ """
return _pywraplp.Solver_ExportModelToProto(self, output_model)
Encodes the current solution in a solution response protocol buffer.
def FillSolutionResponseProto(self, response: 'operations_research::MPSolutionResponse *') -> "void":
+ r"""
+
+ Encodes the current solution in a solution response protocol buffer.
+ """
return _pywraplp.Solver_FillSolutionResponseProto(self, response)
Creates an integer variable.
def IntVar(self, lb: 'double', ub: 'double', name: 'std::string const &') -> "operations_research::MPVariable *":
+ r"""
+
+ Creates an integer variable.
+ """
return _pywraplp.Solver_IntVar(self, lb, ub, name)
Interrupts the Solve() execution to terminate processing if possible.
+If the underlying interface supports interruption; it does that and returns +true regardless of whether there's an ongoing Solve() or not. The Solve() +call may still linger for a while depending on the conditions. +If +interruption is not supported; returns false and does nothing.
def InterruptSolve(self) -> "bool":
+ r"""
+ Interrupts the Solve() execution to terminate processing if possible.
+
+ If the underlying interface supports interruption; it does that and returns
+ true regardless of whether there's an ongoing Solve() or not. The Solve()
+ call may still linger for a while depending on the conditions. If
+ interruption is not supported; returns false and does nothing.
+ """
return _pywraplp.Solver_InterruptSolve(self)
Load a solution encoded in a protocol buffer onto this solver for easy +access via the MPSolver interface.
+IMPORTANT: This may only be used in conjunction with ExportModel(), +following this example:
+.. code-block:: c++
+ MPSolver my_solver;
+ ... add variables and constraints ...
+ MPModelProto model_proto;
+ my_solver.ExportModelToProto(model_proto);
+ MPSolutionResponse solver_response;
+ MPSolver::SolveWithProto(model_proto, solver_response);
+ if (solver_response.result_status() == MPSolutionResponse::OPTIMAL) {
+ CHECK_OK(my_solver.LoadSolutionFromProto(solver_response));
+ ... inspect the solution using the usual API: solution_value(), etc...
+ }
+
+The response must be in OPTIMAL or FEASIBLE status.
+Returns a non-OK status if a problem arised (typically, if it wasn't used +like it should be): +- loading a solution whose variables don't correspond to the solver's +current variables +- loading a solution with a status other than OPTIMAL / FEASIBLE.
+Note: the objective value isn't checked. You can use VerifySolution() for +that.
def LoadSolutionFromProto(self, *args) -> "util::Status":
+ r"""
+
+ Load a solution encoded in a protocol buffer onto this solver for easy
+ access via the MPSolver interface.
+
+ IMPORTANT: This may only be used in conjunction with ExportModel(),
+ following this example:
+
+
+ .. code-block:: c++
+
+
+ MPSolver my_solver;
+ ... add variables and constraints ...
+ MPModelProto model_proto;
+ my_solver.ExportModelToProto(model_proto);
+ MPSolutionResponse solver_response;
+ MPSolver::SolveWithProto(model_proto, solver_response);
+ if (solver_response.result_status() == MPSolutionResponse::OPTIMAL) {
+ CHECK_OK(my_solver.LoadSolutionFromProto(solver_response));
+ ... inspect the solution using the usual API: solution_value(), etc...
+ }
+
+
+ The response must be in OPTIMAL or FEASIBLE status.
+
+ Returns a non-OK status if a problem arised (typically, if it wasn't used
+ like it should be):
+ - loading a solution whose variables don't correspond to the solver's
+ current variables
+ - loading a solution with a status other than OPTIMAL / FEASIBLE.
+
+ Note: the objective value isn't checked. You can use VerifySolution() for
+ that.
+ """
return _pywraplp.Solver_LoadSolutionFromProto(self, *args)
Looks up a constraint by name, and returns nullptr if it does not exist.
+The first call has a O(n) complexity, as the constraint name index is +lazily created upon first use. Will crash if constraint names are not +unique.
def LookupConstraint(self, constraint_name: 'std::string const &') -> "operations_research::MPConstraint *":
+ r"""
+
+ Looks up a constraint by name, and returns nullptr if it does not exist.
+
+ The first call has a O(n) complexity, as the constraint name index is
+ lazily created upon first use. Will crash if constraint names are not
+ unique.
+ """
return _pywraplp.Solver_LookupConstraint(self, constraint_name)
Looks up a variable by name, and returns nullptr if it does not exist. The +first call has a O(n) complexity, as the variable name index is lazily +created upon first use. Will crash if variable names are not unique.
def LookupVariable(self, var_name: 'std::string const &') -> "operations_research::MPVariable *":
+ r"""
+
+ Looks up a variable by name, and returns nullptr if it does not exist. The
+ first call has a O(n) complexity, as the variable name index is lazily
+ created upon first use. Will crash if variable names are not unique.
+ """
return _pywraplp.Solver_LookupVariable(self, var_name)
Some solvers (MIP only, not LP) can produce multiple solutions to the +problem. Returns true when another solution is available, and updates the +MPVariable* objects to make the new solution queryable. Call only after +calling solve.
+The optimality properties of the additional solutions found, and whether or +not the solver computes them ahead of time or when NextSolution() is called +is solver specific.
+As of 2018-08-09, only Gurobi supports NextSolution(), see +linear_solver_underlying_gurobi_test for an example of how to configure +Gurobi for this purpose. The other solvers return false unconditionally.
def NextSolution(self) -> "bool":
+ r"""
+
+ Some solvers (MIP only, not LP) can produce multiple solutions to the
+ problem. Returns true when another solution is available, and updates the
+ MPVariable* objects to make the new solution queryable. Call only after
+ calling solve.
+
+ The optimality properties of the additional solutions found, and whether or
+ not the solver computes them ahead of time or when NextSolution() is called
+ is solver specific.
+
+ As of 2018-08-09, only Gurobi supports NextSolution(), see
+ linear_solver_underlying_gurobi_test for an example of how to configure
+ Gurobi for this purpose. The other solvers return false unconditionally.
+ """
return _pywraplp.Solver_NextSolution(self)
Returns the number of constraints.
def NumConstraints(self) -> "int":
+ r"""
+
+ Returns the number of constraints.
+ """
return _pywraplp.Solver_NumConstraints(self)
Creates a continuous variable.
def NumVar(self, lb: 'double', ub: 'double', name: 'std::string const &') -> "operations_research::MPVariable *":
+ r"""
+
+ Creates a continuous variable.
+ """
return _pywraplp.Solver_NumVar(self, lb, ub, name)
Returns the number of variables.
def NumVariables(self) -> "int":
+ r"""
+
+ Returns the number of variables.
+ """
return _pywraplp.Solver_NumVariables(self)
Returns the mutable objective object.
def Objective(self) -> "operations_research::MPObjective *":
+ r"""
+
+ Returns the mutable objective object.
+ """
return _pywraplp.Solver_Objective(self)
Advanced usage: pass solver specific parameters in text format.
+The format is solver-specific and is the same as the corresponding solver +configuration file format. Returns true if the operation was successful.
+TODO(user): Currently SCIP will always return true even if the format is +wrong (you can check the log if you suspect an issue there). This seems to +be a bug in SCIP though.
def SetSolverSpecificParametersAsString(self, parameters: 'std::string const &') -> "bool":
+ r"""
+
+ Advanced usage: pass solver specific parameters in text format.
+
+ The format is solver-specific and is the same as the corresponding solver
+ configuration file format. Returns true if the operation was successful.
+
+ TODO(user): Currently SCIP will always return true even if the format is
+ wrong (you can check the log if you suspect an issue there). This seems to
+ be a bug in SCIP though.
+ """
return _pywraplp.Solver_SetSolverSpecificParametersAsString(self, parameters)
Overload 1:
+Solves the problem using default parameter values.
+|
+Overload 2:
+Solves the problem using the specified parameter values.
def Solve(self, *args) -> "operations_research::MPSolver::ResultStatus":
+ r"""
+ *Overload 1:*
+
+ Solves the problem using default parameter values.
+
+ |
+
+ *Overload 2:*
+
+ Solves the problem using the specified parameter values.
+ """
return _pywraplp.Solver_Solve(self, *args)
Suppress output.
def SuppressOutput(self) -> "void":
+ r""" Suppress output."""
return _pywraplp.Solver_SuppressOutput(self)
Creates a variable with the given bounds, integrality requirement and +name. Bounds can be finite or +/- MPSolver::infinity(). The MPSolver owns +the variable (i.e. the returned pointer is borrowed). Variable names are +optional. If you give an empty name, name() will auto-generate one for you +upon request.
def Var(self, lb: 'double', ub: 'double', integer: 'bool', name: 'std::string const &') -> "operations_research::MPVariable *":
+ r"""
+
+ Creates a variable with the given bounds, integrality requirement and
+ name. Bounds can be finite or +/- MPSolver::infinity(). The MPSolver owns
+ the variable (i.e. the returned pointer is borrowed). Variable names are
+ optional. If you give an empty name, name() will auto-generate one for you
+ upon request.
+ """
return _pywraplp.Solver_Var(self, lb, ub, integer, name)
Advanced usage: Verifies the correctness of the solution.
+It verifies that all variables must be within their domains, all +constraints must be satisfied, and the reported objective value must be +accurate.
+Usage: +- This can only be called after Solve() was called. +- "tolerance" is interpreted as an absolute error threshold. +- For the objective value only, if the absolute error is too large, +the tolerance is interpreted as a relative error threshold instead. +- If "log_errors" is true, every single violation will be logged. +- If "tolerance" is negative, it will be set to infinity().
+Most users should just set the –verify_solution flag and not bother using +this method directly.
def VerifySolution(self, tolerance: 'double', log_errors: 'bool') -> "bool":
+ r"""
+
+ Advanced usage: Verifies the *correctness* of the solution.
+
+ It verifies that all variables must be within their domains, all
+ constraints must be satisfied, and the reported objective value must be
+ accurate.
+
+ Usage:
+ - This can only be called after Solve() was called.
+ - "tolerance" is interpreted as an absolute error threshold.
+ - For the objective value only, if the absolute error is too large,
+ the tolerance is interpreted as a relative error threshold instead.
+ - If "log_errors" is true, every single violation will be logged.
+ - If "tolerance" is negative, it will be set to infinity().
+
+ Most users should just set the --verify_solution flag and not bother using
+ this method directly.
+ """
return _pywraplp.Solver_VerifySolution(self, tolerance, log_errors)
Returns the array of constraints handled by the MPSolver.
+They are listed in the order in which they were created.
def constraints(self) -> "std::vector< operations_research::MPConstraint * > const &":
+ r"""
+
+ Returns the array of constraints handled by the MPSolver.
+
+ They are listed in the order in which they were created.
+ """
return _pywraplp.Solver_constraints(self)
Returns the number of simplex iterations.
def iterations(self) -> "int64":
+ r"""
+
+ Returns the number of simplex iterations.
+ """
return _pywraplp.Solver_iterations(self)
Returns the number of branch-and-bound nodes evaluated during the solve.
+Only available for discrete problems.
def nodes(self) -> "int64":
+ r"""
+
+ Returns the number of branch-and-bound nodes evaluated during the solve.
+
+ Only available for discrete problems.
+ """
return _pywraplp.Solver_nodes(self)
Returns the array of variables handled by the MPSolver. (They are listed in +the order in which they were created.)
def variables(self) -> "std::vector< operations_research::MPVariable * > const &":
+ r"""
+
+ Returns the array of variables handled by the MPSolver. (They are listed in
+ the order in which they were created.)
+ """
return _pywraplp.Solver_variables(self)
The class for variables of a Mathematical Programming (MP) model.
class Variable(object):
+ r"""
+
+ The class for variables of a Mathematical Programming (MP) model.
+ """
+
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
def name(self) -> "std::string const &":
+ r"""
+
+ Returns the name of the variable.
+ """
return _pywraplp.Variable_name(self)
def integer(self) -> "bool":
+ r"""
+
+ Returns the integrality requirement of the variable.
+ """
return _pywraplp.Variable_integer(self)
def solution_value(self) -> "double":
+ r"""
+
+ Returns the value of the variable in the current solution.
+
+ If the variable is integer, then the value will always be an integer (the
+ underlying solver handles floating-point values only, but this function
+ automatically rounds it to the nearest integer; see: man 3 round).
+ """
return _pywraplp.Variable_solution_value(self)
def index(self) -> "int":
+ r"""
+
+ Returns the index of the variable in the MPSolver::variables_.
+ """
return _pywraplp.Variable_index(self)
def lb(self) -> "double":
+ r"""
+
+ Returns the lower bound.
+ """
return _pywraplp.Variable_lb(self)
def ub(self) -> "double":
+ r"""
+
+ Returns the upper bound.
+ """
return _pywraplp.Variable_ub(self)
def SetBounds(self, lb: 'double', ub: 'double') -> "void":
+ r"""
+
+ Sets both the lower and upper bounds.
+ """
return _pywraplp.Variable_SetBounds(self, lb, ub)
def reduced_cost(self) -> "double":
+ r"""
+
+ Advanced usage: returns the reduced cost of the variable in the current
+ solution (only available for continuous problems).
+ """
return _pywraplp.Variable_reduced_cost(self)
def basis_status(self) -> "operations_research::MPSolver::BasisStatus":
+ r"""
+
+ Advanced usage: returns the basis status of the variable in the current solution (only available for continuous problems).
+
+ See also: MPSolver::BasisStatus.
+ """
return _pywraplp.Variable_basis_status(self)
def __str__(self) -> "std::string":
@@ -2288,10 +4033,14 @@ def infinity() -> "double":
def SetBounds(self, lb, ub)
Sets both the lower and upper bounds.
def SetBounds(self, lb: 'double', ub: 'double') -> "void":
+ r"""
+
+ Sets both the lower and upper bounds.
+ """
return _pywraplp.Variable_SetBounds(self, lb, ub)
Advanced usage: returns the basis status of the variable in the current solution (only available for continuous problems).
+See also: MPSolver::BasisStatus.
def basis_status(self) -> "operations_research::MPSolver::BasisStatus":
+ r"""
+
+ Advanced usage: returns the basis status of the variable in the current solution (only available for continuous problems).
+
+ See also: MPSolver::BasisStatus.
+ """
return _pywraplp.Variable_basis_status(self)
Returns the index of the variable in the MPSolver::variables_.
def index(self) -> "int":
+ r"""
+
+ Returns the index of the variable in the MPSolver::variables_.
+ """
return _pywraplp.Variable_index(self)
Returns the integrality requirement of the variable.
def integer(self) -> "bool":
+ r"""
+
+ Returns the integrality requirement of the variable.
+ """
return _pywraplp.Variable_integer(self)
Returns the lower bound.
def lb(self) -> "double":
+ r"""
+
+ Returns the lower bound.
+ """
return _pywraplp.Variable_lb(self)
Returns the name of the variable.
def name(self) -> "std::string const &":
+ r"""
+
+ Returns the name of the variable.
+ """
return _pywraplp.Variable_name(self)
Advanced usage: returns the reduced cost of the variable in the current +solution (only available for continuous problems).
def reduced_cost(self) -> "double":
+ r"""
+
+ Advanced usage: returns the reduced cost of the variable in the current
+ solution (only available for continuous problems).
+ """
return _pywraplp.Variable_reduced_cost(self)
Returns the value of the variable in the current solution.
+If the variable is integer, then the value will always be an integer (the +underlying solver handles floating-point values only, but this function +automatically rounds it to the nearest integer; see: man 3 round).
def solution_value(self) -> "double":
+ r"""
+
+ Returns the value of the variable in the current solution.
+
+ If the variable is integer, then the value will always be an integer (the
+ underlying solver handles floating-point values only, but this function
+ automatically rounds it to the nearest integer; see: man 3 round).
+ """
return _pywraplp.Variable_solution_value(self)
Returns the upper bound.
def ub(self) -> "double":
+ r"""
+
+ Returns the upper bound.
+ """
return _pywraplp.Variable_ub(self)
@@ -4104,8 +4101,8 @@ Raises:
cp_model_helper.AssertIsBoolean(arg)
return self.GetOrMakeIndexFromConstant(arg)
else:
- raise TypeError(
- 'NotSupported: model.GetOrMakeBooleanIndex(' + str(arg) + ')')
+ raise TypeError('NotSupported: model.GetOrMakeBooleanIndex(' +
+ str(arg) + ')')
@@ -4126,8 +4123,8 @@ Raises:
cp_model_helper.AssertIsInt64(arg)
return self.GetOrMakeIndexFromConstant(arg)
else:
- raise TypeError(
- 'NotSupported: model.GetOrMakeIndex(' + str(arg) + ')')
+ raise TypeError('NotSupported: model.GetOrMakeIndex(' + str(arg) +
+ ')')
@@ -4901,8 +4898,8 @@ and Value() methods.
index = lit.Index()
return self.SolutionBooleanValue(index)
else:
- raise TypeError(
- 'Cannot interpret %s as a boolean expression.' % lit)
+ raise TypeError('Cannot interpret %s as a boolean expression.' %
+ lit)
def Value(self, expression):
"""Evaluates an linear expression in the current solution.
@@ -4926,8 +4923,8 @@ and Value() methods.
while to_process:
expr, coef = to_process.pop()
if isinstance(expr, _ProductCst):
- to_process.append((expr.Expression(),
- coef * expr.Coefficient()))
+ to_process.append(
+ (expr.Expression(), coef * expr.Coefficient()))
elif isinstance(expr, _SumArray):
for e in expr.Expressions():
to_process.append((e, coef))
@@ -4939,8 +4936,8 @@ and Value() methods.
elif isinstance(expr, IntVar):
value += coef * self.SolutionIntegerValue(expr.Index())
elif isinstance(expr, _NotBooleanVariable):
- value += coef * (
- 1 - self.SolutionIntegerValue(expr.Not().Index()))
+ value += coef * (1 -
+ self.SolutionIntegerValue(expr.Not().Index()))
return value
@@ -5055,8 +5052,8 @@ Raises:
while to_process:
expr, coef = to_process.pop()
if isinstance(expr, _ProductCst):
- to_process.append((expr.Expression(),
- coef * expr.Coefficient()))
+ to_process.append(
+ (expr.Expression(), coef * expr.Coefficient()))
elif isinstance(expr, _SumArray):
for e in expr.Expressions():
to_process.append((e, coef))
@@ -5068,8 +5065,8 @@ Raises:
elif isinstance(expr, IntVar):
value += coef * self.SolutionIntegerValue(expr.Index())
elif isinstance(expr, _NotBooleanVariable):
- value += coef * (
- 1 - self.SolutionIntegerValue(expr.Not().Index()))
+ value += coef * (1 -
+ self.SolutionIntegerValue(expr.Not().Index()))
return value
@@ -5302,14 +5299,14 @@ intervals into the schedule.
if self.__ct.enforcement_literal:
return '%s(start = %s, size = %s, end = %s, is_present = %s)' % (
self.__ct.name, ShortName(self.__model, interval.start),
- ShortName(self.__model, interval.size),
- ShortName(self.__model, interval.end),
+ ShortName(self.__model,
+ interval.size), ShortName(self.__model, interval.end),
ShortName(self.__model, self.__ct.enforcement_literal[0]))
else:
return '%s(start = %s, size = %s, end = %s)' % (
self.__ct.name, ShortName(self.__model, interval.start),
- ShortName(self.__model, interval.size),
- ShortName(self.__model, interval.end))
+ ShortName(self.__model,
+ interval.size), ShortName(self.__model, interval.end))
def Name(self):
return self.__ct.name
@@ -5422,8 +5419,8 @@ model.Add(cp_model.LinearExpr.ScalProd(expressions, coefficients) >= 0)
while to_process: # Flatten to avoid recursion.
expr, coef = to_process.pop()
if isinstance(expr, _ProductCst):
- to_process.append((expr.Expression(),
- coef * expr.Coefficient()))
+ to_process.append(
+ (expr.Expression(), coef * expr.Coefficient()))
elif isinstance(expr, _SumArray):
for e in expr.Expressions():
to_process.append((e, coef))
@@ -5611,8 +5608,8 @@ def Sum(cls, expressions):
while to_process: # Flatten to avoid recursion.
expr, coef = to_process.pop()
if isinstance(expr, _ProductCst):
- to_process.append((expr.Expression(),
- coef * expr.Coefficient()))
+ to_process.append(
+ (expr.Expression(), coef * expr.Coefficient()))
elif isinstance(expr, _SumArray):
for e in expr.Expressions():
to_process.append((e, coef))
diff --git a/ortools/linear_solver/linear_solver.h b/ortools/linear_solver/linear_solver.h
index 3a58358b34..e5a33cbde4 100644
--- a/ortools/linear_solver/linear_solver.h
+++ b/ortools/linear_solver/linear_solver.h
@@ -11,8 +11,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-//
-//
// A C++ wrapper that provides a simple and unified interface to
// several linear programming and mixed integer programming solvers:
// GLOP, GLPK, CLP, CBC, and SCIP. The wrapper can also be used in Java, C#,
@@ -169,344 +167,489 @@ class MPSolverInterface;
class MPSolverParameters;
class MPVariable;
-// This mathematical programming (MP) solver class is the main class
-// though which users build and solve problems.
+/**
+ * This mathematical programming (MP) solver class is the main class
+ * though which users build and solve problems.
+ */
class MPSolver {
public:
- // The type of problems (LP or MIP) that will be solved and the
- // underlying solver (GLOP, GLPK, CLP, CBC or SCIP) that will solve them.
- // This must remain consistent with MPModelRequest::OptimizationProblemType
- // (take particular care of the open-source version).
- enum OptimizationProblemType {
-// Linear programming problems.
+ /**
+ * The type of problems (LP or MIP) that will be solved and the underlying
+ * solver (GLOP, GLPK, CLP, CBC or SCIP) that will solve them. This must
+ * remain consistent with MPModelRequest::OptimizationProblemType
+ * (take particular care of the open-source version).
+ */
+ enum OptimizationProblemType {
#ifdef USE_CLP
- CLP_LINEAR_PROGRAMMING = 0, // Recommended default value.
+ /** Linear Programming solver using Coin CBC. */
+ CLP_LINEAR_PROGRAMMING = 0,
#endif
#ifdef USE_GLPK
- GLPK_LINEAR_PROGRAMMING = 1,
+ /** Linear Programming solver using GLPK. */
+ GLPK_LINEAR_PROGRAMMING = 1,
#endif
#ifdef USE_GLOP
- GLOP_LINEAR_PROGRAMMING = 2,
+ /** Linear Programming solver using GLOP (Recommended solver). */
+ GLOP_LINEAR_PROGRAMMING = 2,
#endif
#ifdef USE_GUROBI
- GUROBI_LINEAR_PROGRAMMING = 6,
+ /** Linear Programming solver using GUROBI. */
+ GUROBI_LINEAR_PROGRAMMING = 6,
#endif
#ifdef USE_CPLEX
- CPLEX_LINEAR_PROGRAMMING = 10,
+ /** Linear Programming solver using CPLEX. */
+ CPLEX_LINEAR_PROGRAMMING = 10,
#endif
// Integer programming problems.
#ifdef USE_SCIP
- SCIP_MIXED_INTEGER_PROGRAMMING = 3, // Recommended default value.
+ /** Mixed integer Programming Solver using SCIP. (Recommended for problems
+ with continous variables) */
+ SCIP_MIXED_INTEGER_PROGRAMMING = 3, // Recommended default value.
#endif
#ifdef USE_GLPK
- GLPK_MIXED_INTEGER_PROGRAMMING = 4,
+ /** Mixed integer Programming Solver using SCIP. */
+ GLPK_MIXED_INTEGER_PROGRAMMING = 4,
#endif
#ifdef USE_CBC
- CBC_MIXED_INTEGER_PROGRAMMING = 5,
+ /** Mixed integer Programming Solver using Coin CBC. */
+ CBC_MIXED_INTEGER_PROGRAMMING = 5,
#endif
#if defined(USE_GUROBI)
- GUROBI_MIXED_INTEGER_PROGRAMMING = 7,
+ /** Mixed integer Programming Solver using GUROBI. */
+ GUROBI_MIXED_INTEGER_PROGRAMMING = 7,
#endif
#if defined(USE_CPLEX)
- CPLEX_MIXED_INTEGER_PROGRAMMING = 11,
+ /** Mixed integer Programming Solver using CPLEX. */
+ CPLEX_MIXED_INTEGER_PROGRAMMING = 11,
#endif
#if defined(USE_BOP)
- BOP_INTEGER_PROGRAMMING = 12,
+ /** Linear Boolean Programming Solver. */
+ BOP_INTEGER_PROGRAMMING = 12,
#endif
- };
+ };
+ /**
+ * Create a solver with the given name and underlying solver backend.
+ */
MPSolver(const std::string& name, OptimizationProblemType problem_type);
virtual ~MPSolver();
- // Whether the given problem type is supported (this will depend on the
- // targets that you linked).
+ /**
+ * Whether the given problem type is supported (this will depend on the
+ * targets that you linked).
+ */
static bool SupportsProblemType(OptimizationProblemType problem_type);
- // Parses the name of the solver. Returns true if the solver type is
- // successfully parsed as one of the OptimizationProblemType.
+ /**
+ * Parses the name of the solver. Returns true if the solver type is
+ * successfully parsed as one of the OptimizationProblemType.
+ */
static bool ParseSolverType(absl::string_view solver,
OptimizationProblemType* type);
bool IsMIP() const;
+ /**
+ * Returns the name of the model set at construction.
+ */
const std::string& Name() const {
return name_; // Set at construction.
}
+ /**
+ * Returns the optimization problem type set at construction
+ */
virtual OptimizationProblemType ProblemType() const {
return problem_type_; // Set at construction.
}
- // Clears the objective (including the optimization direction), all
- // variables and constraints. All the other properties of the MPSolver
- // (like the time limit) are kept untouched.
+ /**
+ * Clears the objective (including the optimization direction), all variables
+ * and constraints. All the other properties of the MPSolver (like the time
+ * limit) are kept untouched.
+ */
void Clear();
- // ----- Variables ------
- // Returns the number of variables.
+ /**
+ * Returns the number of variables.
+ */
int NumVariables() const { return variables_.size(); }
- // Returns the array of variables handled by the MPSolver.
- // (They are listed in the order in which they were created.)
+
+ /**
+ * Returns the array of variables handled by the MPSolver. (They are listed in
+ * the order in which they were created.)
+ */
const std::vector