14 #ifndef OR_TOOLS_LINEAR_SOLVER_LINEAR_EXPR_H_ 15 #define OR_TOOLS_LINEAR_SOLVER_LINEAR_EXPR_H_ 82 #include "absl/container/flat_hash_map.h" 142 double offset()
const {
return offset_; }
143 const absl::flat_hash_map<const MPVariable*, double>&
terms()
const {
162 absl::flat_hash_map<const MPVariable*, double> terms_;
165 std::ostream&
operator<<(std::ostream& stream,
const LinearExpr& linear_expr);
174 LinearExpr
operator+(LinearExpr lhs,
const LinearExpr& rhs);
175 LinearExpr
operator-(LinearExpr lhs,
const LinearExpr& rhs);
176 LinearExpr
operator*(LinearExpr lhs,
double rhs);
177 LinearExpr
operator/(LinearExpr lhs,
double rhs);
178 LinearExpr
operator*(
double lhs, LinearExpr rhs);
216 LinearRange
operator<=(
const LinearExpr& lhs,
const LinearExpr& rhs);
217 LinearRange
operator==(
const LinearExpr& lhs,
const LinearExpr& rhs);
218 LinearRange
operator>=(
const LinearExpr& lhs,
const LinearExpr& rhs);
225 #endif // OR_TOOLS_LINEAR_SOLVER_LINEAR_EXPR_H_ LinearExpr & operator/=(double rhs)
double lower_bound() const
LinearExpr & operator+=(const LinearExpr &rhs)
LinearExpr operator+(LinearExpr lhs, const LinearExpr &rhs)
LinearRange operator==(const LinearExpr &lhs, const LinearExpr &rhs)
double SolutionValue() const
Evaluates the value of this expression at the solution found.
The class for variables of a Mathematical Programming (MP) model.
const absl::flat_hash_map< const MPVariable *, double > & terms() const
LinearExpr operator *(LinearExpr lhs, double rhs)
std::string ToString() const
A human readable representation of this.
LinearExpr & operator *=(double rhs)
LinearRange operator>=(const LinearExpr &lhs, const LinearExpr &rhs)
LinearExpr operator/(LinearExpr lhs, double rhs)
double upper_bound() const
LinearExpr models a quantity that is linear in the decision variables (MPVariable) of an optimization...
LinearExpr & operator-=(const LinearExpr &rhs)
Collection of objects used to extend the Constraint Solver library.
std::ostream & operator<<(std::ostream &out, const Assignment &assignment)
const LinearExpr & linear_expr() const
LinearExpr operator-(LinearExpr lhs, const LinearExpr &rhs)
An expression of the form:
static LinearExpr NotVar(LinearExpr var)
Returns 1-var.
LinearRange operator<=(const LinearExpr &lhs, const LinearExpr &rhs)
LinearExpr operator-() const