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

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.

This type can be used as a key in ABSL hash containers.

Definition at line 619 of file variable_and_expressions.h.

#include <variable_and_expressions.h>

Inheritance diagram for operations_research::math_opt::QuadraticTermKey:
operations_research::math_opt::ModelStorageItem

Public Types

using IdType = QuadraticProductId

Public Member Functions

 QuadraticTermKey (ModelStorageCPtr storage, QuadraticProductId id)
 QuadraticTermKey (Variable first_variable, Variable second_variable)
QuadraticProductId typed_id () const
Variable first () const
 Returns the Variable with the smallest id.
Variable second () const
 Returns the Variable the largest id.
Public Member Functions inherited from operations_research::math_opt::ModelStorageItem
ModelStorageCPtr storage () const

Friends

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

Additional Inherited Members

Protected Member Functions inherited from operations_research::math_opt::ModelStorageItem
 ModelStorageItem (ModelStorageCPtr storage)
 ModelStorageItem (const ModelStorageItem &)=default
ModelStorageItemoperator= (const ModelStorageItem &)=default
 ModelStorageItem (ModelStorageItem &&)=default
ModelStorageItemoperator= (ModelStorageItem &&)=default
 ~ModelStorageItem ()=default

Member Typedef Documentation

◆ IdType

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

Definition at line 622 of file variable_and_expressions.h.

Constructor & Destructor Documentation

◆ QuadraticTermKey() [1/2]

operations_research::math_opt::QuadraticTermKey::QuadraticTermKey ( ModelStorageCPtr 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 1998 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 2008 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 636 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 639 of file variable_and_expressions.h.

◆ typed_id()

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

Definition at line 2016 of file variable_and_expressions.h.

◆ AbslHashValue

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

Definition at line 2019 of file variable_and_expressions.h.


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