Google OR-Tools v9.12
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 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 211 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

◆ 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 872 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 855 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.

These are not used as long as the degree is zero.

Definition at line 809 of file markowitz.cc.


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