Loading...
Searching...
No Matches
fastjet::MinHeap Class Reference

More...

`#include <fastjet/internal/MinHeap.hh>`

## Public Member Functions

| MinHeap (const std::vector< double > &values, unsigned int max_size)
| construct a MinHeap from the vector of values, allowing future expansion to a maximum size max_size;
| MinHeap (unsigned int max_size)
| do the minimal setup for a MinHeap that can reach max_size; initialisation must be performed later with the actual values.
| MinHeap (const std::vector< double > &values)
| constructor in which the the maximum size is the size of the values array
void | initialise (const std::vector< double > &values)
| initialise the heap with the supplied values.
unsigned int | minloc () const
| return the location of the minimal value on the heap
double | minval () const
| return the minimal value on the heap
double | operator[] (int i) const
void | remove (unsigned int loc)
| remove the value at the specified location (i.e.
void | update (unsigned int, double)
| update the value at the specified location

## Detailed Description

Definition at line 49 of file MinHeap.hh.

## Constructor & Destructor Documentation

## MinHeap() [1/3]

fastjet::MinHeap::MinHeap | ( | const std::vector< double > & | values,
|  | unsigned int | max_size )

inline

construct a MinHeap from the vector of values, allowing future expansion to a maximum size max_size;

Definition at line 53 of file MinHeap.hh.

## MinHeap() [2/3]

fastjet::MinHeap::MinHeap | ( | unsigned int | max_size | ) |

inline

do the minimal setup for a MinHeap that can reach max_size; initialisation must be performed later with the actual values.

Definition at line 58 of file MinHeap.hh.

## MinHeap() [3/3]

fastjet::MinHeap::MinHeap | ( | const std::vector< double > & | values | ) |

inline

constructor in which the the maximum size is the size of the values array

Definition at line 61 of file MinHeap.hh.

## Member Function Documentation

## initialise()

void fastjet::MinHeap::initialise | ( | const std::vector< double > & | values | ) |

initialise the heap with the supplied values.

construct the MinHeap; structure will be as follows: Should only be called if the constructor did not supply values.

_heap[0].minloc points to globally smallest entry _heap[1].minloc points to smallest entry in one half of heap _heap[2].minloc points to smallest entry in other half of heap

. for _heap[i], the "parent" is to be found at (i-1)/2

Definition at line 47 of file MinHeap.cc.

## minloc()

unsigned int fastjet::MinHeap::minloc | ( |  | ) | const

inline

return the location of the minimal value on the heap

Definition at line 69 of file MinHeap.hh.

## minval()

double fastjet::MinHeap::minval | ( |  | ) | const

inline

return the minimal value on the heap

Definition at line 73 of file MinHeap.hh.

## operator[]()

double fastjet::MinHeap::operator[] | ( | int | i | ) | const

inline

Definition at line 75 of file MinHeap.hh.

## remove()

void fastjet::MinHeap::remove | ( | unsigned int | loc | ) |

inline

remove the value at the specified location (i.e.

replace it with the largest possible value).

Definition at line 79 of file MinHeap.hh.

## update()

void fastjet::MinHeap::update | ( | unsigned int | loc,
|  | double | new_value )

update the value at the specified location

Definition at line 79 of file MinHeap.cc.

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

- include/fastjet/internal/MinHeap.hh
- src/MinHeap.cc