Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::LinearExpression Class Referencefinal

Detailed Description

Definition at line 207 of file variable_and_expressions.h.

#include <variable_and_expressions.h>

Inheritance diagram for operations_research::math_opt::LinearExpression:
operations_research::math_opt::ModelStorageItemContainer

Public Member Functions

 LinearExpression ()=default
 LinearExpression (const LinearExpression &other)=default
 LinearExpression (std::initializer_list< LinearTerm > terms, double offset)
 LinearExpression (double offset)
 LinearExpression (Variable variable)
 LinearExpression (const LinearTerm &term)
LinearExpressionoperator= (const LinearExpression &other)=default
 LinearExpression (LinearExpression &&other) noexcept
LinearExpressionoperator= (LinearExpression &&other) noexcept
LinearExpressionoperator+= (const LinearExpression &other)
LinearExpressionoperator+= (const LinearTerm &term)
LinearExpressionoperator+= (Variable variable)
LinearExpressionoperator+= (double value)
LinearExpressionoperator-= (const LinearExpression &other)
LinearExpressionoperator-= (const LinearTerm &term)
LinearExpressionoperator-= (Variable variable)
LinearExpressionoperator-= (double value)
LinearExpressionoperator*= (double value)
LinearExpressionoperator/= (double value)
template<typename Iterable>
void AddSum (const Iterable &items)
template<typename LeftIterable, typename RightIterable>
void AddInnerProduct (const LeftIterable &left, const RightIterable &right)
const VariableMap< double > & terms () const
double offset () const
double Evaluate (const VariableMap< double > &variable_values) const
double EvaluateWithDefaultZero (const VariableMap< double > &variable_values) const
Public Member Functions inherited from operations_research::math_opt::ModelStorageItemContainer
NullableModelStorageCPtr storage () const

Static Public Member Functions

template<typename Iterable>
static LinearExpression Sum (const Iterable &items)
template<typename LeftIterable, typename RightIterable>
static LinearExpression InnerProduct (const LeftIterable &left, const RightIterable &right)

Public Attributes

this = item

Friends

LinearExpression operator- (LinearExpression expr)
std::ostream & operator<< (std::ostream &ostr, const LinearExpression &expression)

Additional Inherited Members

Protected Member Functions inherited from operations_research::math_opt::ModelStorageItemContainer
 ModelStorageItemContainer (const NullableModelStorageCPtr storage=nullptr)
 ModelStorageItemContainer (const ModelStorageItemContainer &other)=default
ModelStorageItemContaineroperator= (const ModelStorageItemContainer &other)=default
 ModelStorageItemContainer (ModelStorageItemContainer &&other) noexcept
ModelStorageItemContaineroperator= (ModelStorageItemContainer &&other) noexcept
void SetOrCheckStorage (const ModelStorageItem &item)
void SetOrCheckStorage (const ModelStorageItemContainer &container)

Constructor & Destructor Documentation

◆ LinearExpression() [1/7]

operations_research::math_opt::LinearExpression::LinearExpression ( )
default

◆ LinearExpression() [2/7]

operations_research::math_opt::LinearExpression::LinearExpression ( const LinearExpression & other)
default

◆ LinearExpression() [3/7]

operations_research::math_opt::LinearExpression::LinearExpression ( std::initializer_list< LinearTerm > terms,
double offset )
inline

Definition at line 1335 of file variable_and_expressions.h.

◆ LinearExpression() [4/7]

operations_research::math_opt::LinearExpression::LinearExpression ( double offset)
inline

Definition at line 1349 of file variable_and_expressions.h.

◆ LinearExpression() [5/7]

operations_research::math_opt::LinearExpression::LinearExpression ( Variable variable)
inline

Definition at line 1352 of file variable_and_expressions.h.

◆ LinearExpression() [6/7]

operations_research::math_opt::LinearExpression::LinearExpression ( const LinearTerm & term)
inline

Definition at line 1355 of file variable_and_expressions.h.

◆ LinearExpression() [7/7]

operations_research::math_opt::LinearExpression::LinearExpression ( LinearExpression && other)
inlinenoexcept

Definition at line 1314 of file variable_and_expressions.h.

Member Function Documentation

◆ AddInnerProduct()

template<typename LeftIterable, typename RightIterable>
void operations_research::math_opt::LinearExpression::AddInnerProduct ( const LeftIterable & left,
const RightIterable & right )
inline

Definition at line 1629 of file variable_and_expressions.h.

◆ AddSum()

template<typename Iterable>
void operations_research::math_opt::LinearExpression::AddSum ( const Iterable & items)
inline

Definition at line 1588 of file variable_and_expressions.h.

◆ Evaluate()

double operations_research::math_opt::LinearExpression::Evaluate ( const VariableMap< double > & variable_values) const

Definition at line 64 of file variable_and_expressions.cc.

◆ EvaluateWithDefaultZero()

double operations_research::math_opt::LinearExpression::EvaluateWithDefaultZero ( const VariableMap< double > & variable_values) const

Definition at line 76 of file variable_and_expressions.cc.

◆ InnerProduct()

template<typename LeftIterable, typename RightIterable>
LinearExpression operations_research::math_opt::LinearExpression::InnerProduct ( const LeftIterable & left,
const RightIterable & right )
inlinestatic

Definition at line 1635 of file variable_and_expressions.h.

◆ offset()

double operations_research::math_opt::LinearExpression::offset ( ) const
inline

Definition at line 1650 of file variable_and_expressions.h.

◆ operator*=()

LinearExpression & operations_research::math_opt::LinearExpression::operator*= ( double value)
inline

Definition at line 1571 of file variable_and_expressions.h.

◆ operator+=() [1/4]

LinearExpression & operations_research::math_opt::LinearExpression::operator+= ( const LinearExpression & other)
inline

Definition at line 1513 of file variable_and_expressions.h.

◆ operator+=() [2/4]

LinearExpression & operations_research::math_opt::LinearExpression::operator+= ( const LinearTerm & term)
inline

Definition at line 1527 of file variable_and_expressions.h.

◆ operator+=() [3/4]

LinearExpression & operations_research::math_opt::LinearExpression::operator+= ( double value)
inline

Definition at line 1538 of file variable_and_expressions.h.

◆ operator+=() [4/4]

LinearExpression & operations_research::math_opt::LinearExpression::operator+= ( Variable variable)
inline

Definition at line 1533 of file variable_and_expressions.h.

◆ operator-=() [1/4]

LinearExpression & operations_research::math_opt::LinearExpression::operator-= ( const LinearExpression & other)
inline

Definition at line 1543 of file variable_and_expressions.h.

◆ operator-=() [2/4]

LinearExpression & operations_research::math_opt::LinearExpression::operator-= ( const LinearTerm & term)
inline

Definition at line 1555 of file variable_and_expressions.h.

◆ operator-=() [3/4]

LinearExpression & operations_research::math_opt::LinearExpression::operator-= ( double value)
inline

Definition at line 1566 of file variable_and_expressions.h.

◆ operator-=() [4/4]

LinearExpression & operations_research::math_opt::LinearExpression::operator-= ( Variable variable)
inline

Definition at line 1561 of file variable_and_expressions.h.

◆ operator/=()

LinearExpression & operations_research::math_opt::LinearExpression::operator/= ( double value)
inline

Definition at line 1579 of file variable_and_expressions.h.

◆ operator=() [1/2]

LinearExpression & operations_research::math_opt::LinearExpression::operator= ( const LinearExpression & other)
default

◆ operator=() [2/2]

LinearExpression & operations_research::math_opt::LinearExpression::operator= ( LinearExpression && other)
inlinenoexcept

Definition at line 1325 of file variable_and_expressions.h.

◆ Sum()

template<typename Iterable>
LinearExpression operations_research::math_opt::LinearExpression::Sum ( const Iterable & items)
inlinestatic

Definition at line 1595 of file variable_and_expressions.h.

◆ terms()

const VariableMap< double > & operations_research::math_opt::LinearExpression::terms ( ) const
inline

Definition at line 1648 of file variable_and_expressions.h.

◆ operator-

LinearExpression operator- ( LinearExpression expr)
friend

Definition at line 1358 of file variable_and_expressions.h.

◆ operator<<

std::ostream & operator<< ( std::ostream & ostr,
const LinearExpression & expression )
friend

Definition at line 86 of file variable_and_expressions.cc.

Member Data Documentation

◆ this

* operations_research::math_opt::LinearExpression::this = item

Definition at line 268 of file variable_and_expressions.h.


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