14 #ifndef OR_TOOLS_LINEAR_SOLVER_LINEAR_EXPR_H_ 15 #define OR_TOOLS_LINEAR_SOLVER_LINEAR_EXPR_H_ 80 #include "absl/container/flat_hash_map.h" 142 double offset()
const {
return offset_; }
143 const absl::flat_hash_map<const MPVariable*, double>&
terms()
const {
156 absl::flat_hash_map<const MPVariable*, double> terms_;
166 LinearExpr
operator+(LinearExpr lhs,
const LinearExpr& rhs);
167 LinearExpr
operator-(LinearExpr lhs,
const LinearExpr& rhs);
168 LinearExpr
operator*(LinearExpr lhs,
double rhs);
169 LinearExpr
operator/(LinearExpr lhs,
double rhs);
170 LinearExpr
operator*(
double lhs, LinearExpr rhs);
202 LinearRange
operator<=(
const LinearExpr& lhs,
const LinearExpr& rhs);
203 LinearRange
operator==(
const LinearExpr& lhs,
const LinearExpr& rhs);
204 LinearRange
operator>=(
const LinearExpr& lhs,
const LinearExpr& rhs);
211 #endif // OR_TOOLS_LINEAR_SOLVER_LINEAR_EXPR_H_ const LinearExpr & linear_expr() const
LinearExpr operator+(LinearExpr lhs, const LinearExpr &rhs)
LinearExpr operator *(LinearExpr lhs, double rhs)
LinearRange operator<=(const LinearExpr &lhs, const LinearExpr &rhs)
An expression of the form:
double SolutionValue() const
Evaluates the value of this expression at the solution found.
LinearRange operator==(const LinearExpr &lhs, const LinearExpr &rhs)
LinearExpr & operator *=(double rhs)
double lower_bound() const
double upper_bound() const
LinearExpr models a quantity that is linear in the decision variables (MPVariable) of an optimization...
const absl::flat_hash_map< const MPVariable *, double > & terms() const
LinearExpr & operator+=(const LinearExpr &rhs)
LinearExpr & operator/=(double rhs)
LinearRange operator>=(const LinearExpr &lhs, const LinearExpr &rhs)
LinearExpr operator-(LinearExpr lhs, const LinearExpr &rhs)
The class for variables of a Mathematical Programming (MP) model.
static LinearExpr NotVar(LinearExpr var)
Returns 1-var.
LinearExpr & operator-=(const LinearExpr &rhs)
LinearExpr operator-() const
LinearExpr operator/(LinearExpr lhs, double rhs)