![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
A flat linear expression sum(vars[i] * coeffs[i]) + offset. More...
#include <model_builder_helper.h>
Public Member Functions | |
FlatExpr (std::shared_ptr< LinearExpr > expr) | |
FlatExpr (std::shared_ptr< LinearExpr > pos, std::shared_ptr< LinearExpr > neg) | |
Flatten pos - neg. | |
FlatExpr (const std::vector< std::shared_ptr< Variable > > &, const std::vector< double > &, double) | |
FlatExpr (double offset) | |
const std::vector< std::shared_ptr< Variable > > & | vars () const |
std::vector< int > | VarIndices () const |
const std::vector< double > & | coeffs () const |
double | offset () const |
void | Visit (ExprVisitor &lin, double c) override |
std::string | ToString () const override |
std::string | DebugString () const override |
![]() | |
virtual | ~LinearExpr ()=default |
std::shared_ptr< LinearExpr > | Add (std::shared_ptr< LinearExpr > expr) |
std::shared_ptr< LinearExpr > | AddFloat (double cst) |
std::shared_ptr< LinearExpr > | Sub (std::shared_ptr< LinearExpr > expr) |
std::shared_ptr< LinearExpr > | SubFloat (double cst) |
std::shared_ptr< LinearExpr > | RSubFloat (double cst) |
std::shared_ptr< LinearExpr > | MulFloat (double cst) |
std::shared_ptr< LinearExpr > | Neg () |
std::shared_ptr< BoundedLinearExpression > | Eq (std::shared_ptr< LinearExpr > rhs) |
std::shared_ptr< BoundedLinearExpression > | EqCst (double rhs) |
std::shared_ptr< BoundedLinearExpression > | Ge (std::shared_ptr< LinearExpr > rhs) |
std::shared_ptr< BoundedLinearExpression > | GeCst (double rhs) |
std::shared_ptr< BoundedLinearExpression > | Le (std::shared_ptr< LinearExpr > rhs) |
std::shared_ptr< BoundedLinearExpression > | LeCst (double rhs) |
Additional Inherited Members | |
![]() | |
static std::shared_ptr< LinearExpr > | Term (std::shared_ptr< LinearExpr > expr, double coeff) |
Expressions. | |
static std::shared_ptr< LinearExpr > | Affine (std::shared_ptr< LinearExpr > expr, double coeff, double constant) |
static std::shared_ptr< LinearExpr > | AffineCst (double value, double coeff, double constant) |
static std::shared_ptr< LinearExpr > | Constant (double value) |
A flat linear expression sum(vars[i] * coeffs[i]) + offset.
Definition at line 125 of file model_builder_helper.h.
|
explicit |
Definition at line 897 of file model_builder_helper.cc.
operations_research::mb::FlatExpr::FlatExpr | ( | std::shared_ptr< LinearExpr > | pos, |
std::shared_ptr< LinearExpr > | neg ) |
Flatten pos - neg.
Definition at line 903 of file model_builder_helper.cc.
operations_research::mb::FlatExpr::FlatExpr | ( | const std::vector< std::shared_ptr< Variable > > & | vars, |
const std::vector< double > & | coeffs, | ||
double | offset ) |
Definition at line 911 of file model_builder_helper.cc.
|
explicit |
Definition at line 915 of file model_builder_helper.cc.
|
inline |
Definition at line 135 of file model_builder_helper.h.
|
overridevirtual |
Implements operations_research::mb::LinearExpr.
Definition at line 982 of file model_builder_helper.cc.
|
inline |
Definition at line 136 of file model_builder_helper.h.
|
overridevirtual |
If there are no terms, just print the offset.
If there is an offset, print it.
Implements operations_research::mb::LinearExpr.
Definition at line 933 of file model_builder_helper.cc.
std::vector< int > operations_research::mb::FlatExpr::VarIndices | ( | ) | const |
Definition at line 917 of file model_builder_helper.cc.
|
inline |
Definition at line 133 of file model_builder_helper.h.
|
overridevirtual |
Implements operations_research::mb::LinearExpr.
Definition at line 926 of file model_builder_helper.cc.