![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
A value type that references a linear constraint from ModelStorage. Usually this type is passed by copy.
Definition at line 40 of file linear_constraint.h.
#include <linear_constraint.h>
Public Member Functions | |
double | lower_bound () const |
double | upper_bound () const |
absl::string_view | name () const |
bool | is_coefficient_nonzero (Variable variable) const |
double | coefficient (Variable variable) const |
Returns 0.0 if the variable is not used in the constraint. | |
BoundedLinearExpression | AsBoundedLinearExpression () const |
std::string | ToString () const |
ModelStorageElement (ModelStorageCPtr storage, IdType id) | |
ModelStorageElement (const ModelStorageElement &)=default | |
ModelStorageElement (ModelStorageElement &&)=default | |
Public Member Functions inherited from operations_research::math_opt::ModelStorageElement< ElementType::kLinearConstraint, LinearConstraint > | |
ModelStorageElement (ModelStorageCPtr storage, IdType id) | |
int64_t | id () const |
IdType | typed_id () const |
Public Member Functions inherited from operations_research::math_opt::ModelStorageItem | |
ModelStorageCPtr | storage () const |
Additional Inherited Members | |
Public Types inherited from operations_research::math_opt::ModelStorageElement< ElementType::kLinearConstraint, LinearConstraint > | |
using | IdType |
The typed integer used for ids. | |
Protected Member Functions inherited from operations_research::math_opt::ModelStorageElement< ElementType::kLinearConstraint, LinearConstraint > | |
ModelStorageElement & | operator= (const ModelStorageElement &)=default |
~ModelStorageElement ()=default | |
Protected Member Functions inherited from operations_research::math_opt::ModelStorageItem | |
ModelStorageItem (ModelStorageCPtr storage) | |
ModelStorageItem (const ModelStorageItem &)=default | |
ModelStorageItem & | operator= (const ModelStorageItem &)=default |
ModelStorageItem (ModelStorageItem &&)=default | |
ModelStorageItem & | operator= (ModelStorageItem &&)=default |
~ModelStorageItem ()=default |
|
inline |
Returns the constraints as a bounded linear expression.
The linear expression will have a zero offset, even if the constraint was created with a non-zero one. For example:
const LinearConstraint c = model.AddLinearConstraint(3.2 <= x + 1.0 <= 4.2);
///< Here e will contain 3.2 - 1.0 <= x <= 4.2 - 1.0. const BoundedLinearExpression e = c.AsBoundedLinearExpression();
Definition at line 110 of file linear_constraint.h.
|
inline |
Returns 0.0 if the variable is not used in the constraint.
Definition at line 103 of file linear_constraint.h.
|
inline |
Definition at line 96 of file linear_constraint.h.
|
inline |
Inline function implementations
Definition at line 81 of file linear_constraint.h.
|
default |
Disallow slicing (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-copy-virtual):
|
inline |
Definition at line 81 of file model_storage_item.h.
|
default |
|
inline |
Definition at line 89 of file linear_constraint.h.
|
inline |
Returns a detailed string description of the contents of the constraint (not its name, use << for that instead).
Definition at line 122 of file linear_constraint.h.
|
inline |
Definition at line 85 of file linear_constraint.h.