Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::LinearRange Class Reference

#include <linear_expr.h>

Public Member Functions

 LinearRange ()
 
 LinearRange (double lower_bound, const LinearExpr &linear_expr, double upper_bound)
 
double lower_bound () const
 
const LinearExprlinear_expr () const
 
double upper_bound () const
 

Detailed Description

An expression of the form:

lower_bound <= sum_{i in S} a_i*x_i <= upper_bound.

The sum is represented as a LinearExpr with offset 0.

Must be added to model with

MPSolver::AddRowConstraint(const LinearRange& range,
const std::string& name);
const std::string name
A name for logging purposes.
const std::optional< Range > & range
Definition statistics.cc:37

Definition at line 192 of file linear_expr.h.

Constructor & Destructor Documentation

◆ LinearRange() [1/2]

operations_research::LinearRange::LinearRange ( )
inline

Definition at line 194 of file linear_expr.h.

◆ LinearRange() [2/2]

operations_research::LinearRange::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", i.e., we form the range:

lower_bound - offset <= linear_expr - offset <= upper_bound - offset.
const LinearExpr & linear_expr() const

Definition at line 173 of file linear_expr.cc.

Member Function Documentation

◆ linear_expr()

const LinearExpr & operations_research::LinearRange::linear_expr ( ) const
inline

Definition at line 206 of file linear_expr.h.

◆ lower_bound()

double operations_research::LinearRange::lower_bound ( ) const
inline

Definition at line 205 of file linear_expr.h.

◆ upper_bound()

double operations_research::LinearRange::upper_bound ( ) const
inline

Definition at line 207 of file linear_expr.h.


The documentation for this class was generated from the following files: