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

#include <markowitz.h>

Public Member Functions

 ColumnPriorityQueue ()=default
 
 ColumnPriorityQueue (const ColumnPriorityQueue &)=delete
 This type is neither copyable nor movable.
 
ColumnPriorityQueueoperator= (const ColumnPriorityQueue &)=delete
 
void Clear ()
 Releases the memory used by this class.
 
void Reset (int32_t max_degree, ColIndex num_cols)
 
void PushOrAdjust (ColIndex col, int32_t degree)
 
ColIndex Pop ()
 

Detailed Description

Adjustable priority queue of columns. Pop() returns a column with the smallest degree first (degree = number of entries in the column). Empty columns (i.e. with degree 0) are not stored in the queue.

Definition at line 210 of file markowitz.h.

Constructor & Destructor Documentation

◆ ColumnPriorityQueue() [1/2]

operations_research::glop::ColumnPriorityQueue::ColumnPriorityQueue ( )
default

◆ ColumnPriorityQueue() [2/2]

operations_research::glop::ColumnPriorityQueue::ColumnPriorityQueue ( const ColumnPriorityQueue & )
delete

This type is neither copyable nor movable.

Member Function Documentation

◆ Clear()

void operations_research::glop::ColumnPriorityQueue::Clear ( )

Releases the memory used by this class.

Definition at line 813 of file markowitz.cc.

◆ operator=()

ColumnPriorityQueue & operations_research::glop::ColumnPriorityQueue::operator= ( const ColumnPriorityQueue & )
delete

◆ Pop()

ColIndex operations_research::glop::ColumnPriorityQueue::Pop ( )

Removes the column index with higher priority from the queue and returns it. Returns kInvalidCol if the queue is empty.

Definition at line 853 of file markowitz.cc.

◆ PushOrAdjust()

void operations_research::glop::ColumnPriorityQueue::PushOrAdjust ( ColIndex col,
int32_t degree )

Changes the degree of a column and make sure it is in the queue. The degree must be non-negative (>= 0) and at most equal to the value of num_cols used in Reset(). A degree of zero will remove the column from the queue.

Definition at line 827 of file markowitz.cc.

◆ Reset()

void operations_research::glop::ColumnPriorityQueue::Reset ( int32_t max_degree,
ColIndex num_cols )

Clears the queue and prepares it to store up to num_cols column indices with a degree from 1 to max_degree included.

Definition at line 819 of file markowitz.cc.


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