Changeset 49234af in git for external/fastjet/internal/MinHeap.hh
- Timestamp:
- Dec 9, 2014, 1:27:13 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 37deb3b, 9e991f8
- Parents:
- f6b6ee7 (diff), e7e90df (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/internal/MinHeap.hh
rf6b6ee7 r49234af 1 // STARTHEADER2 // $Id: MinHeap.hh 2577 2011-09-13 15:11:38Z salam $1 //FJSTARTHEADER 2 // $Id: MinHeap.hh 3433 2014-07-23 08:17:03Z salam $ 3 3 // 4 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 5 5 // 6 6 //---------------------------------------------------------------------- … … 13 13 // 14 14 // The algorithms that underlie FastJet have required considerable 15 // development and are described in hep-ph/0512210. If you use 15 // development. They are described in the original FastJet paper, 16 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 16 17 // FastJet as part of work towards a scientific publication, please 17 // include a citation to the FastJet paper. 18 // quote the version you use and include a citation to the manual and 19 // optionally also to hep-ph/0512210. 18 20 // 19 21 // FastJet is distributed in the hope that it will be useful, … … 25 27 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 28 //---------------------------------------------------------------------- 27 // ENDHEADER29 //FJENDHEADER 28 30 29 31 #ifndef __FASTJET_MINHEAP__HH__ … … 50 52 /// expansion to a maximum size max_size; 51 53 MinHeap (const std::vector<double> & values, unsigned int max_size) : 52 _heap(max_size) {_initialise(values);}; 54 _heap(max_size) {initialise(values);} 55 56 /// do the minimal setup for a MinHeap that can reach max_size; 57 /// initialisation must be performed later with the actual values. 58 MinHeap (unsigned int max_size) : _heap(max_size) {} 53 59 54 60 /// constructor in which the the maximum size is the size of the values array 55 61 MinHeap (const std::vector<double> & values) : 56 _heap(values.size()) {_initialise(values);}; 57 62 _heap(values.size()) {initialise(values);} 63 64 /// initialise the heap with the supplied values. Should only be called if 65 /// the constructor did not supply values. 66 void initialise(const std::vector<double> & values); 67 58 68 /// return the location of the minimal value on the heap 59 69 inline unsigned int minloc() const { 60 return (_heap[0].minloc) - &(_heap[0]);} ;70 return (_heap[0].minloc) - &(_heap[0]);} 61 71 62 72 /// return the minimal value on the heap 63 inline double minval() const {return _heap[0].minloc->value;} ;73 inline double minval() const {return _heap[0].minloc->value;} 64 74 65 inline double operator[](int i) const {return _heap[i].value;} ;75 inline double operator[](int i) const {return _heap[i].value;} 66 76 67 77 /// remove the value at the specified location (i.e. replace it with … … 82 92 std::vector<ValueLoc> _heap; 83 93 84 void _initialise(const std::vector<double> & values);85 94 86 95
Note:
See TracChangeset
for help on using the changeset viewer.