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

#include <variable_and_expressions.h>

Public Types

using IdType = QuadraticProductId
 

Public Member Functions

 QuadraticTermKey (const ModelStorage *storage, QuadraticProductId id)
 
 QuadraticTermKey (Variable first_variable, Variable second_variable)
 
QuadraticProductId typed_id () const
 
const ModelStorage * storage () const
 
Variable first () const
 Returns the Variable with the smallest id.
 
Variable second () const
 Returns the Variable the largest id.
 

Friends

template<typename H >
AbslHashValue (H h, const QuadraticTermKey &key)
 

Detailed Description

Couples a QuadraticProductId with a ModelStorage, for use with IdMaps. Namely, this key type satisfies the requirements stated in key_types.h. Invariant:

  • variable_ids_.first <= variable_ids_.second. The constructor will silently correct this if not satisfied by the inputs.

Definition at line 645 of file variable_and_expressions.h.

Member Typedef Documentation

◆ IdType

Note
this definition is for use by IdMap; clients should not rely upon it.

Definition at line 648 of file variable_and_expressions.h.

Constructor & Destructor Documentation

◆ QuadraticTermKey() [1/2]

operations_research::math_opt::QuadraticTermKey::QuadraticTermKey ( const ModelStorage * storage,
QuadraticProductId id )
inline
Note
This constructor will silently re-order the passed id so that, upon exiting the constructor, variable_ids_.first <= variable_ids_.second.

QuadraticTermKey

See https://en.cppreference.com/w/cpp/named_req/Swappable for details.

Definition at line 2068 of file variable_and_expressions.h.

◆ QuadraticTermKey() [2/2]

operations_research::math_opt::QuadraticTermKey::QuadraticTermKey ( Variable first_variable,
Variable second_variable )
inline
Note
This constructor will CHECK fail if the variable models do not agree, i.e. first_variable.storage() != second_variable.storage(). It will also silently re-order the passed id so that, upon exiting the constructor, variable_ids_.first <= variable_ids_.second.

Definition at line 2078 of file variable_and_expressions.h.

Member Function Documentation

◆ first()

Variable operations_research::math_opt::QuadraticTermKey::first ( ) const
inline

Returns the Variable with the smallest id.

Definition at line 663 of file variable_and_expressions.h.

◆ second()

Variable operations_research::math_opt::QuadraticTermKey::second ( ) const
inline

Returns the Variable the largest id.

Definition at line 666 of file variable_and_expressions.h.

◆ storage()

const ModelStorage * operations_research::math_opt::QuadraticTermKey::storage ( ) const
inline

Definition at line 2088 of file variable_and_expressions.h.

◆ typed_id()

QuadraticProductId operations_research::math_opt::QuadraticTermKey::typed_id ( ) const
inline

Definition at line 2086 of file variable_and_expressions.h.

Friends And Related Symbol Documentation

◆ AbslHashValue

template<typename H >
H AbslHashValue ( H h,
const QuadraticTermKey & key )
friend

Definition at line 2091 of file variable_and_expressions.h.


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