Public Member Functions | Private Attributes | List of all members
gtsam::MinHeap Class Reference

Min-Heap class to help with pruning. The top element is always the smallest value. More...

Public Member Functions

bool empty () const
 Return true if heap is empty. More...
 
 MinHeap ()
 Default constructor. More...
 
double pop ()
 Pop the top value of the heap. More...
 
void print (const std::string &s="")
 Print the heap as a sequence. More...
 
void push (double x)
 Push value onto the heap. More...
 
void push (double x, size_t n)
 Push value x, n number of times. More...
 
size_t size () const
 Return the size of the heap. More...
 
double top ()
 Return the top value of the heap without popping it. More...
 

Private Attributes

std::vector< double > v_
 

Detailed Description

Min-Heap class to help with pruning. The top element is always the smallest value.

Definition at line 356 of file DecisionTreeFactor.cpp.

Constructor & Destructor Documentation

◆ MinHeap()

gtsam::MinHeap::MinHeap ( )
inline

Default constructor.

Definition at line 361 of file DecisionTreeFactor.cpp.

Member Function Documentation

◆ empty()

bool gtsam::MinHeap::empty ( ) const
inline

Return true if heap is empty.

Definition at line 403 of file DecisionTreeFactor.cpp.

◆ pop()

double gtsam::MinHeap::pop ( )
inline

Pop the top value of the heap.

Definition at line 378 of file DecisionTreeFactor.cpp.

◆ print()

void gtsam::MinHeap::print ( const std::string &  s = "")
inline

Print the heap as a sequence.

Parameters
sA string to prologue the output.

Definition at line 393 of file DecisionTreeFactor.cpp.

◆ push() [1/2]

void gtsam::MinHeap::push ( double  x)
inline

Push value onto the heap.

Definition at line 364 of file DecisionTreeFactor.cpp.

◆ push() [2/2]

void gtsam::MinHeap::push ( double  x,
size_t  n 
)
inline

Push value x, n number of times.

Definition at line 370 of file DecisionTreeFactor.cpp.

◆ size()

size_t gtsam::MinHeap::size ( ) const
inline

Return the size of the heap.

Definition at line 406 of file DecisionTreeFactor.cpp.

◆ top()

double gtsam::MinHeap::top ( )
inline

Return the top value of the heap without popping it.

Definition at line 386 of file DecisionTreeFactor.cpp.

Member Data Documentation

◆ v_

std::vector<double> gtsam::MinHeap::v_
private

Definition at line 357 of file DecisionTreeFactor.cpp.


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


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:23:58