85 int temp_val =
heap_[0];
161 if ( index == -1 )
return;
163 if (
coheap_[ index ] < coval ) {
165 }
else if (
coheap_[ index ] > coval ) {
211 int indx,iv,cv2,last;
215 if ( last <= 0 )
return;
216 if ( indx > last )
return;
221 while ( indx < last ) {
222 int child = 2*indx+1;
224 if ( child > last )
break;
226 int cv =
heap_[child];
229 if ( child < last ) {
230 cv2 =
heap_[child+1];
233 if ( cocv2 < cocv ) {
241 if ( coiv <= cocv )
break;
269 while ( indx != 0 ) {
270 int parent =
static_cast< int >((indx-1)/2);
273 if ( copv < covalue )
break;
void heap_replace(int val, float coval)
void increase_coval(int index, float coval)
void heap_insert(int val, float coval, bool &err)
Inserts a value into the heap that is sorted by coval.
void heap_extract(int &val, float &coval, bool &err)
Extracts the val,coval pair with the lowest coval from the heap. This modifies the heap...
utility::vector0< float > coheap_
Fstring::size_type index(Fstring const &s, Fstring const &ss)
First Index Position of a Substring in an Fstring.
float heap_head() const
returns the smallest covalue stored in the heap.
void heap_init(int max_items)
sets up an empty heap and stores the dimensioned size
void heap_down(int index_in)
void decrease_coval(int index, float coval)
class definition for a heap object based on Charlie Strauss's heap code ported over from rosetta++...
int index_for_val(int val)
void reset_coval(int val, float coval)
utility::vector0< int > heap_
void heap_up(int index_in)
float coval(int index) const