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

A class to hold a weighted sum of floating point linear expressions. More...

#include <model_builder_helper.h>

Inheritance diagram for operations_research::mb::WeightedSumArray:
operations_research::mb::LinearExpr

Public Member Functions

 WeightedSumArray (const std::vector< std::shared_ptr< LinearExpr > > &exprs, const std::vector< double > &coeffs, double offset)
 
 ~WeightedSumArray () override=default
 
void Visit (ExprVisitor &lin, double c) override
 
std::string ToString () const override
 
std::string DebugString () const override
 
- Public Member Functions inherited from operations_research::mb::LinearExpr
virtual ~LinearExpr ()=default
 
std::shared_ptr< LinearExprAdd (std::shared_ptr< LinearExpr > expr)
 
std::shared_ptr< LinearExprAddFloat (double cst)
 
std::shared_ptr< LinearExprSub (std::shared_ptr< LinearExpr > expr)
 
std::shared_ptr< LinearExprSubFloat (double cst)
 
std::shared_ptr< LinearExprRSubFloat (double cst)
 
std::shared_ptr< LinearExprMulFloat (double cst)
 
std::shared_ptr< LinearExprNeg ()
 
std::shared_ptr< BoundedLinearExpressionEq (std::shared_ptr< LinearExpr > rhs)
 
std::shared_ptr< BoundedLinearExpressionEqCst (double rhs)
 
std::shared_ptr< BoundedLinearExpressionGe (std::shared_ptr< LinearExpr > rhs)
 
std::shared_ptr< BoundedLinearExpressionGeCst (double rhs)
 
std::shared_ptr< BoundedLinearExpressionLe (std::shared_ptr< LinearExpr > rhs)
 
std::shared_ptr< BoundedLinearExpressionLeCst (double rhs)
 

Additional Inherited Members

- Static Public Member Functions inherited from operations_research::mb::LinearExpr
static std::shared_ptr< LinearExprTerm (std::shared_ptr< LinearExpr > expr, double coeff)
 Expressions.
 
static std::shared_ptr< LinearExprAffine (std::shared_ptr< LinearExpr > expr, double coeff, double constant)
 
static std::shared_ptr< LinearExprAffineCst (double value, double coeff, double constant)
 
static std::shared_ptr< LinearExprConstant (double value)
 

Detailed Description

A class to hold a weighted sum of floating point linear expressions.

Definition at line 215 of file model_builder_helper.h.

Constructor & Destructor Documentation

◆ WeightedSumArray()

operations_research::mb::WeightedSumArray::WeightedSumArray ( const std::vector< std::shared_ptr< LinearExpr > > & exprs,
const std::vector< double > & coeffs,
double offset )

Definition at line 1006 of file model_builder_helper.cc.

◆ ~WeightedSumArray()

operations_research::mb::WeightedSumArray::~WeightedSumArray ( )
overridedefault

Member Function Documentation

◆ DebugString()

std::string operations_research::mb::WeightedSumArray::DebugString ( ) const
overridevirtual

Implements operations_research::mb::LinearExpr.

Definition at line 1066 of file model_builder_helper.cc.

◆ ToString()

std::string operations_research::mb::WeightedSumArray::ToString ( ) const
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 1020 of file model_builder_helper.cc.

◆ Visit()

void operations_research::mb::WeightedSumArray::Visit ( ExprVisitor & lin,
double c )
overridevirtual

Implements operations_research::mb::LinearExpr.

Definition at line 1013 of file model_builder_helper.cc.


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