#include <quadratic_constraint.h>
|
using | IdType = QuadraticConstraintId |
| The typed integer used for ids.
|
|
A value type that references a quadratic 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 quadratic_constraint.h.
◆ IdType
◆ QuadraticConstraint()
operations_research::math_opt::QuadraticConstraint::QuadraticConstraint |
( |
const ModelStorage * | storage, |
|
|
QuadraticConstraintId | id ) |
|
inline |
◆ AsBoundedQuadraticExpression()
Returns the constraints as a bounded quadratic expression.
The quadratic expression will have a zero offset, even if the constraint was created with a non-zero one. For example:
const LinearConstraint c = model.AddQuadraticConstraint(3.2 <= x*x + 1.0 <= 4.2);
///< Here e
will contain 3.2 - 1.0 <= x*x <= 4.2 - 1.0. const BoundedQuadraticExpression e = c.AsBoundedQuadraticExpression();
Definition at line 26 of file quadratic_constraint.cc.
◆ id()
int64_t operations_research::math_opt::QuadraticConstraint::id |
( |
| ) |
const |
|
inline |
◆ is_linear_coefficient_nonzero()
bool operations_research::math_opt::QuadraticConstraint::is_linear_coefficient_nonzero |
( |
Variable | variable | ) |
const |
|
inline |
◆ is_quadratic_coefficient_nonzero()
bool operations_research::math_opt::QuadraticConstraint::is_quadratic_coefficient_nonzero |
( |
Variable | first_variable, |
|
|
Variable | second_variable ) const |
|
inline |
◆ linear_coefficient()
double operations_research::math_opt::QuadraticConstraint::linear_coefficient |
( |
Variable | variable | ) |
const |
|
inline |
Returns 0.0 if the variable does not appear in the linear part of the constraint.
Definition at line 149 of file quadratic_constraint.h.
◆ lower_bound()
double operations_research::math_opt::QuadraticConstraint::lower_bound |
( |
| ) |
const |
|
inline |
◆ name()
absl::string_view operations_research::math_opt::QuadraticConstraint::name |
( |
| ) |
const |
|
inline |
◆ NonzeroVariables()
std::vector< Variable > operations_research::math_opt::QuadraticConstraint::NonzeroVariables |
( |
| ) |
const |
|
inline |
All variables that appear in the quadratic constraint with a nonzero coefficient: in the linear terms, the quadratic terms, or both. Order is not defined.
Definition at line 165 of file quadratic_constraint.h.
◆ quadratic_coefficient()
double operations_research::math_opt::QuadraticConstraint::quadratic_coefficient |
( |
Variable | first_variable, |
|
|
Variable | second_variable ) const |
|
inline |
Returns 0.0 if the variable does not appear in the quadratic part of the constraint.
Definition at line 155 of file quadratic_constraint.h.
◆ storage()
const ModelStorage * operations_research::math_opt::QuadraticConstraint::storage |
( |
| ) |
const |
|
inline |
◆ ToString()
std::string operations_research::math_opt::QuadraticConstraint::ToString |
( |
| ) |
const |
|
inline |
Returns a detailed string description of the contents of the constraint (not its name, use <<
for that instead).
Definition at line 169 of file quadratic_constraint.h.
◆ typed_id()
QuadraticConstraintId operations_research::math_opt::QuadraticConstraint::typed_id |
( |
| ) |
const |
|
inline |
◆ upper_bound()
double operations_research::math_opt::QuadraticConstraint::upper_bound |
( |
| ) |
const |
|
inline |
◆ AbslHashValue
◆ operator!=
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & | ostr, |
|
|
const QuadraticConstraint & | quadratic_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 194 of file quadratic_constraint.h.
◆ operator==
The documentation for this class was generated from the following files: