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

#include <variable_and_expressions.h>

Public Member Functions

 QuadraticTerm ()=delete
 
 QuadraticTerm (Variable first_variable, Variable second_variable, double coefficient)
 
double coefficient () const
 
Variable first_variable () const
 
Variable second_variable () const
 
QuadraticTermKey GetKey () const
 This is useful for working with IdMaps.
 
QuadraticTermoperator*= (double value)
 
QuadraticTermoperator/= (double value)
 

Friends

QuadraticTerm operator- (QuadraticTerm term)
 ------------------------— Subtraction (-) ------------------------------—
 
QuadraticTerm operator* (double lhs, QuadraticTerm rhs)
 -------------------------— Multiplication (*) --------------------------—
 
QuadraticTerm operator* (QuadraticTerm lhs, double rhs)
 
QuadraticTerm operator/ (QuadraticTerm lhs, double rhs)
 ----------------------------— Division (/) -----------------------------—
 

Detailed Description

Represents a quadratic term in a sum: coefficient * variable_1 * variable_2. Invariant:

  • first_variable.storage() == second_variable.storage(). The constructor will CHECK fail if not satisfied.

Definition at line 691 of file variable_and_expressions.h.

Constructor & Destructor Documentation

◆ QuadraticTerm() [1/2]

operations_research::math_opt::QuadraticTerm::QuadraticTerm ( )
delete

◆ QuadraticTerm() [2/2]

operations_research::math_opt::QuadraticTerm::QuadraticTerm ( Variable first_variable,
Variable second_variable,
double coefficient )
inline
Note
This will CHECK fail if first_variable.storage() != second_variable.storage().

QuadraticTerm (no arithmetic)

Definition at line 2122 of file variable_and_expressions.h.

Member Function Documentation

◆ coefficient()

double operations_research::math_opt::QuadraticTerm::coefficient ( ) const
inline

Definition at line 2131 of file variable_and_expressions.h.

◆ first_variable()

Variable operations_research::math_opt::QuadraticTerm::first_variable ( ) const
inline

Definition at line 2132 of file variable_and_expressions.h.

◆ GetKey()

QuadraticTermKey operations_research::math_opt::QuadraticTerm::GetKey ( ) const
inline

This is useful for working with IdMaps.

Definition at line 2135 of file variable_and_expressions.h.

◆ operator*=()

QuadraticTerm & operations_research::math_opt::QuadraticTerm::operator*= ( double value)
inline
Note
Not touching variables in term, just modifying coefficient, so no need to check that models agree.

Definition at line 2712 of file variable_and_expressions.h.

◆ operator/=()

QuadraticTerm & operations_research::math_opt::QuadraticTerm::operator/= ( double value)
inline
Note
Not touching variables in term, just modifying coefficient, so no need to check that models agree.

Definition at line 2732 of file variable_and_expressions.h.

◆ second_variable()

Variable operations_research::math_opt::QuadraticTerm::second_variable ( ) const
inline

Definition at line 2133 of file variable_and_expressions.h.

Friends And Related Symbol Documentation

◆ operator* [1/2]

QuadraticTerm operator* ( double lhs,
QuadraticTerm rhs )
friend

-------------------------— Multiplication (*) --------------------------—

Note
A friend of QuadraticTerm, but does not touch variables

Definition at line 2474 of file variable_and_expressions.h.

◆ operator* [2/2]

QuadraticTerm operator* ( QuadraticTerm lhs,
double rhs )
friend
Note
A friend of QuadraticTerm, but does not touch variables

Definition at line 2569 of file variable_and_expressions.h.

◆ operator-

QuadraticTerm operator- ( QuadraticTerm term)
friend

------------------------— Subtraction (-) ------------------------------—

We declare those operator overloads that result in a QuadraticTerm, stated in lexicographic ordering based on lhs type, rhs type):

Note
A friend of QuadraticTerm, but does not touch variables

Definition at line 2347 of file variable_and_expressions.h.

◆ operator/

QuadraticTerm operator/ ( QuadraticTerm lhs,
double rhs )
friend

----------------------------— Division (/) -----------------------------—

Note
A friend of QuadraticTerm, but does not touch variables

Definition at line 2582 of file variable_and_expressions.h.


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