C++ Reference
C++ Reference: Linear solver
linear_expr.h
Go to the documentation of this file.
LinearExpr models a quantity that is linear in the decision variables (MPVariable) of an optimization...
Definition: linear_expr.h:114
double SolutionValue() const
Evaluates the value of this expression at the solution found.
std::string ToString() const
A human readable representation of this.
LinearExpr operator-() const
LinearExpr & operator*=(double rhs)
const absl::flat_hash_map< const MPVariable *, double > & terms() const
Definition: linear_expr.h:143
LinearExpr()
LinearExpr(double constant)
Possible implicit conversions are intentional.
LinearExpr(const MPVariable *var)
LinearExpr & operator-=(const LinearExpr &rhs)
LinearExpr & operator/=(double rhs)
LinearExpr & operator+=(const LinearExpr &rhs)
double upper_bound() const
Definition: linear_expr.h:207
double lower_bound() const
Definition: linear_expr.h:205
LinearRange(double lower_bound, const LinearExpr &linear_expr, double upper_bound)
The bounds of the linear range are updated so that they include the offset from "linear_expr",...
const LinearExpr & linear_expr() const
Definition: linear_expr.h:206
The class for variables of a Mathematical Programming (MP) model.
Definition: linear_solver.h:1053
Definition: linear_expr.h:84
LinearRange operator==(const LinearExpr &lhs, const LinearExpr &rhs)
LinearExpr operator*(LinearExpr lhs, double rhs)
LinearExpr operator-(LinearExpr lhs, const LinearExpr &rhs)
LinearRange operator<=(const LinearExpr &lhs, const LinearExpr &rhs)
LinearExpr operator+(LinearExpr lhs, const LinearExpr &rhs)
LinearExpr operator/(LinearExpr lhs, double rhs)
LinearRange operator>=(const LinearExpr &lhs, const LinearExpr &rhs)
std::ostream & operator<<(std::ostream &stream, const LinearExpr &linear_expr)