14 #ifndef OR_TOOLS_LINEAR_SOLVER_LINEAR_EXPR_H_ 15 #define OR_TOOLS_LINEAR_SOLVER_LINEAR_EXPR_H_ 78 #include "absl/container/flat_hash_map.h" 138 double offset()
const {
return offset_; }
139 const absl::flat_hash_map<const MPVariable*, double>&
terms()
const {
152 absl::flat_hash_map<const MPVariable*, double> terms_;
162 LinearExpr
operator+(LinearExpr lhs,
const LinearExpr& rhs);
163 LinearExpr
operator-(LinearExpr lhs,
const LinearExpr& rhs);
164 LinearExpr
operator*(LinearExpr lhs,
double rhs);
165 LinearExpr
operator/(LinearExpr lhs,
double rhs);
166 LinearExpr
operator*(
double lhs, LinearExpr rhs);
204 LinearRange
operator<=(
const LinearExpr& lhs,
const LinearExpr& rhs);
205 LinearRange
operator==(
const LinearExpr& lhs,
const LinearExpr& rhs);
206 LinearRange
operator>=(
const LinearExpr& lhs,
const LinearExpr& rhs);
213 #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)