18#ifndef OR_TOOLS_MATH_OPT_CPP_LINEAR_CONSTRAINT_H_
19#define OR_TOOLS_MATH_OPT_CPP_LINEAR_CONSTRAINT_H_
25#include "absl/container/flat_hash_map.h"
26#include "absl/log/check.h"
27#include "absl/strings/string_view.h"
48 inline absl::string_view
name()
const;
95 CHECK_EQ(variable.storage(),
storage())
97 return storage()->is_linear_constraint_coefficient_nonzero(
105 variable.typed_id());
124 std::stringstream str;
double upper_bound() const
absl::string_view name() const
BoundedLinearExpression AsBoundedLinearExpression() const
bool is_coefficient_nonzero(Variable variable) const
ModelStorageElement(ModelStorageCPtr storage, IdType id)
std::string ToString() const
double lower_bound() const
double coefficient(Variable variable) const
Returns 0.0 if the variable is not used in the constraint.
ModelStorageElement(ModelStorageCPtr storage, IdType id)
ModelStorageCPtr storage() const
constexpr absl::string_view kObjectsFromOtherModelStorage
An object oriented wrapper for quadratic constraints in ModelStorage.
absl::flat_hash_map< LinearConstraint, V > LinearConstraintMap
constexpr absl::string_view kDeletedConstraintDefaultDescription
ElementId< ElementType::kVariable > VariableId
In SWIG mode, we don't want anything besides these top-level includes.
A LinearExpression with upper and lower bounds.