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

Detailed Description

Definition at line 714 of file variable_and_expressions.h.

#include <variable_and_expressions.h>

Inheritance diagram for operations_research::math_opt::QuadraticExpression:
operations_research::math_opt::ModelStorageItemContainer

Public Member Functions

 QuadraticExpression ()=default
 QuadraticExpression (const QuadraticExpression &other)=default
 QuadraticExpression (std::initializer_list< QuadraticTerm > quadratic_terms, std::initializer_list< LinearTerm > linear_terms, double offset)
 QuadraticExpression (double offset)
 QuadraticExpression (Variable variable)
 QuadraticExpression (const LinearTerm &term)
 QuadraticExpression (LinearExpression expr)
 QuadraticExpression (const QuadraticTerm &term)
QuadraticExpressionoperator= (const QuadraticExpression &other)=default
 QuadraticExpression (QuadraticExpression &&other) noexcept
QuadraticExpressionoperator= (QuadraticExpression &&other) noexcept
double offset () const
const VariableMap< double > & linear_terms () const
const QuadraticTermMap< double > & quadratic_terms () const
QuadraticExpressionoperator+= (double value)
QuadraticExpressionoperator+= (Variable variable)
QuadraticExpressionoperator+= (const LinearTerm &term)
QuadraticExpressionoperator+= (const LinearExpression &expr)
QuadraticExpressionoperator+= (const QuadraticTerm &term)
QuadraticExpressionoperator+= (const QuadraticExpression &expr)
QuadraticExpressionoperator-= (double value)
QuadraticExpressionoperator-= (Variable variable)
QuadraticExpressionoperator-= (const LinearTerm &term)
QuadraticExpressionoperator-= (const LinearExpression &expr)
QuadraticExpressionoperator-= (const QuadraticTerm &term)
QuadraticExpressionoperator-= (const QuadraticExpression &expr)
QuadraticExpressionoperator*= (double value)
QuadraticExpressionoperator/= (double value)
template<typename Iterable>
void AddSum (const Iterable &items)
template<typename LeftIterable, typename RightIterable>
void AddInnerProduct (const LeftIterable &left, const RightIterable &right)
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 QuadraticExpression Sum (const Iterable &items)
static RightIterable QuadraticExpression InnerProduct (const LeftIterable &left, const RightIterable &right)

Public Attributes

this = item

Friends

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

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

◆ QuadraticExpression() [1/9]

operations_research::math_opt::QuadraticExpression::QuadraticExpression ( )
default

◆ QuadraticExpression() [2/9]

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

◆ QuadraticExpression() [3/9]

operations_research::math_opt::QuadraticExpression::QuadraticExpression ( std::initializer_list< QuadraticTerm > quadratic_terms,
std::initializer_list< LinearTerm > linear_terms,
double offset )
inline

Definition at line 2094 of file variable_and_expressions.h.

◆ QuadraticExpression() [4/9]

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

Definition at line 2112 of file variable_and_expressions.h.

◆ QuadraticExpression() [5/9]

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

Definition at line 2115 of file variable_and_expressions.h.

◆ QuadraticExpression() [6/9]

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

Definition at line 2118 of file variable_and_expressions.h.

◆ QuadraticExpression() [7/9]

operations_research::math_opt::QuadraticExpression::QuadraticExpression ( LinearExpression expr)
inline

Definition at line 2121 of file variable_and_expressions.h.

◆ QuadraticExpression() [8/9]

operations_research::math_opt::QuadraticExpression::QuadraticExpression ( const QuadraticTerm & term)
inline

Definition at line 2130 of file variable_and_expressions.h.

◆ QuadraticExpression() [9/9]

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

Definition at line 2069 of file variable_and_expressions.h.

Member Function Documentation

◆ AddInnerProduct()

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

Definition at line 2680 of file variable_and_expressions.h.

◆ AddSum()

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

Definition at line 2666 of file variable_and_expressions.h.

◆ Evaluate()

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

Definition at line 123 of file variable_and_expressions.cc.

◆ EvaluateWithDefaultZero()

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

Definition at line 145 of file variable_and_expressions.cc.

◆ InnerProduct()

QuadraticExpression operations_research::math_opt::QuadraticExpression::InnerProduct ( const LeftIterable & left,
const RightIterable & right )
inlinestatic

Definition at line 2686 of file variable_and_expressions.h.

◆ linear_terms()

const VariableMap< double > & operations_research::math_opt::QuadraticExpression::linear_terms ( ) const
inline

Definition at line 2135 of file variable_and_expressions.h.

◆ offset()

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

Definition at line 2133 of file variable_and_expressions.h.

◆ operator*=()

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

Definition at line 2632 of file variable_and_expressions.h.

◆ operator+=() [1/6]

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

Definition at line 2533 of file variable_and_expressions.h.

◆ operator+=() [2/6]

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

Definition at line 2527 of file variable_and_expressions.h.

◆ operator+=() [3/6]

QuadraticExpression & operations_research::math_opt::QuadraticExpression::operator+= ( const QuadraticExpression & expr)
inline

Definition at line 2554 of file variable_and_expressions.h.

◆ operator+=() [4/6]

QuadraticExpression & operations_research::math_opt::QuadraticExpression::operator+= ( const QuadraticTerm & term)
inline

Definition at line 2546 of file variable_and_expressions.h.

◆ operator+=() [5/6]

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

Definition at line 2515 of file variable_and_expressions.h.

◆ operator+=() [6/6]

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

Definition at line 2521 of file variable_and_expressions.h.

◆ operator-=() [1/6]

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

Definition at line 2588 of file variable_and_expressions.h.

◆ operator-=() [2/6]

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

Definition at line 2582 of file variable_and_expressions.h.

◆ operator-=() [3/6]

QuadraticExpression & operations_research::math_opt::QuadraticExpression::operator-= ( const QuadraticExpression & expr)
inline

Definition at line 2609 of file variable_and_expressions.h.

◆ operator-=() [4/6]

QuadraticExpression & operations_research::math_opt::QuadraticExpression::operator-= ( const QuadraticTerm & term)
inline

Definition at line 2601 of file variable_and_expressions.h.

◆ operator-=() [5/6]

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

Definition at line 2570 of file variable_and_expressions.h.

◆ operator-=() [6/6]

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

Definition at line 2576 of file variable_and_expressions.h.

◆ operator/=()

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

Definition at line 2652 of file variable_and_expressions.h.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Definition at line 2082 of file variable_and_expressions.h.

◆ quadratic_terms()

const QuadraticTermMap< double > & operations_research::math_opt::QuadraticExpression::quadratic_terms ( ) const
inline

Definition at line 2139 of file variable_and_expressions.h.

◆ Sum()

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

Definition at line 2673 of file variable_and_expressions.h.

◆ operator-

QuadraticExpression operator- ( QuadraticExpression expr)
friend

Definition at line 2266 of file variable_and_expressions.h.

◆ operator<<

std::ostream & operator<< ( std::ostream & ostr,
const QuadraticExpression & expr )
friend

Definition at line 160 of file variable_and_expressions.cc.

Member Data Documentation

◆ this

* operations_research::math_opt::QuadraticExpression::this = item

Definition at line 787 of file variable_and_expressions.h.


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