#include <linear_constraint.h>
|
using | IdType = LinearConstraintId |
| The typed integer used for ids.
|
|
A value type that references a linear constraint from ModelStorage. Usually this type is passed by copy.
This type implements https://abseil.io/docs/cpp/guides/hash.
Definition at line 43 of file linear_constraint.h.
◆ IdType
◆ LinearConstraint()
operations_research::math_opt::LinearConstraint::LinearConstraint |
( |
const ModelStorage * | storage, |
|
|
LinearConstraintId | id ) |
|
inline |
◆ AsBoundedLinearExpression()
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 142 of file linear_constraint.h.
◆ coefficient()
double operations_research::math_opt::LinearConstraint::coefficient |
( |
Variable | variable | ) |
const |
|
inline |
Returns 0.0 if the variable is not used in the constraint.
Definition at line 136 of file linear_constraint.h.
◆ id()
int64_t operations_research::math_opt::LinearConstraint::id |
( |
| ) |
const |
|
inline |
◆ is_coefficient_nonzero()
bool operations_research::math_opt::LinearConstraint::is_coefficient_nonzero |
( |
Variable | variable | ) |
const |
|
inline |
◆ lower_bound()
double operations_research::math_opt::LinearConstraint::lower_bound |
( |
| ) |
const |
|
inline |
◆ name()
absl::string_view operations_research::math_opt::LinearConstraint::name |
( |
| ) |
const |
|
inline |
◆ storage()
const ModelStorage * operations_research::math_opt::LinearConstraint::storage |
( |
| ) |
const |
|
inline |
◆ ToString()
std::string operations_research::math_opt::LinearConstraint::ToString |
( |
| ) |
const |
|
inline |
Returns a detailed string description of the contents of the constraint (not its name, use <<
for that instead).
Definition at line 154 of file linear_constraint.h.
◆ typed_id()
LinearConstraintId operations_research::math_opt::LinearConstraint::typed_id |
( |
| ) |
const |
|
inline |
◆ upper_bound()
double operations_research::math_opt::LinearConstraint::upper_bound |
( |
| ) |
const |
|
inline |
◆ AbslHashValue
◆ operator!=
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & | ostr, |
|
|
const LinearConstraint & | linear_constraint ) |
|
friend |
Streams the name of the constraint, as registered upon constraint creation, or a short default if none was provided.
- Todo
- (b/170992529): handle quoting of invalid characters in the name.
Definition at line 177 of file linear_constraint.h.
◆ operator==
The documentation for this class was generated from the following file: