#include <SortableResizeArray.h>
Inheritance diagram for SortableResizeArray< Elem >:

Public Member Functions | |
| SortableResizeArray (void) | |
| SortableResizeArray (int size) | |
| SortableResizeArray (ResizeArray< Elem > &ra) | |
| SortableResizeArray (SortableResizeArray< Elem > &ra) | |
| SortableResizeArray (const ResizeArray< Elem > *ra) | |
| SortableResizeArray (const SortableResizeArray< Elem > *ra) | |
| SortableResizeArray (Elem **const r, int numElem, int maxElem) | |
| SortableResizeArray< Elem > & | operator= (SortableResizeArray< Elem > &sa) |
| ~SortableResizeArray (void) | |
| void | init (void) |
| void | sort (void) |
| void | sort (int bot, int top) |
| void | uniq (void) |
| int | bsearch (const Elem &elem) const |
Definition at line 13 of file SortableResizeArray.h.
|
||||||||||
|
Definition at line 49 of file SortableResizeArray.h. 00049 : ResizeArray<Elem>() { init(); }
|
|
||||||||||
|
Definition at line 51 of file SortableResizeArray.h. 00051 : ResizeArray<Elem>(size) { init(); }
|
|
||||||||||
|
Definition at line 53 of file SortableResizeArray.h. 00053 : 00054 ResizeArray<Elem>(ra) { init(); }
|
|
||||||||||
|
Definition at line 56 of file SortableResizeArray.h. 00056 : 00057 ResizeArray<Elem>(ra) { init(); }
|
|
||||||||||
|
Definition at line 59 of file SortableResizeArray.h. 00059 : 00060 ResizeArray<Elem>(ra) { init(); }
|
|
||||||||||
|
Definition at line 62 of file SortableResizeArray.h. 00062 : 00063 ResizeArray<Elem>(ra) { init(); }
|
|
||||||||||||||||||||
|
Definition at line 65 of file SortableResizeArray.h. 00065 : 00066 ResizeArray<Elem>(r,numElem,maxElem) { init(); }
|
|
||||||||||
|
Definition at line 73 of file SortableResizeArray.h. 00073 { }
|
|
||||||||||
|
Definition at line 106 of file SortableResizeArray.h. Referenced by SortedArray< PatchElem >::bsearch(). 00106 {
00107 int test;
00108 int bot = -1;
00109 int top = this->size();
00110 if (this->size() == 0) return (-1);
00111 while (top - bot > 1) {
00112 if ( this->rep->array[test = (bot+top)/2] < elem )
00113 bot = test;
00114 else
00115 top = test;
00116 }
00117 return(top);
00118 }
|
|
||||||||||
|
Definition at line 75 of file SortableResizeArray.h. Referenced by SortableResizeArray< PatchElem >::SortableResizeArray(). 00075 { }
|
|
||||||||||
|
Reimplemented in SortedArray< Elem >, SortedArray< MovePatch >, SortedArray< ComputeID >, SortedArray< HomePatchElem >, and SortedArray< PatchElem >. Definition at line 68 of file SortableResizeArray.h. Referenced by SortedArray< PatchElem >::operator=(). 00068 {
00069 ResizeArray<Elem>::operator=(sa);
00070 return(*this);
00071 }
|
|
||||||||||||||||
|
Definition at line 82 of file SortableResizeArray.h. 00082 {
00083 int index, size;
00084 if (top > this->rep->size()) top = this->rep->size();
00085 size = top - bot + 1;
00086
00087 // Make all sub-heaps
00088 for ( index = size/2-1; index > 0; index-- )
00089 siftup(bot, index, size);
00090
00091 // Take top element of overall heap, and put on top
00092 for ( index = size; index > 1; index-- ) {
00093 siftup(bot, 0, index);
00094 swap(bot, 0, index-1);
00095 }
00096 }
|
|
||||||||||
|
Reimplemented in SortedArray< Elem >, SortedArray< MovePatch >, SortedArray< ComputeID >, SortedArray< HomePatchElem >, and SortedArray< PatchElem >. Definition at line 77 of file SortableResizeArray.h. Referenced by PDB::find_extremes(), generatePmePeList(), generatePmePeList2(), ComputePmeMgr::initialize(), SortedArray< PatchElem >::sort(), and SortableResizeArray< PatchElem >::sort(). 00077 { sort(0, this->rep->size()-1); }
|
|
||||||||||
|
Definition at line 123 of file SortableResizeArray.h. References ResizeArray< Elem >::size(). Referenced by UniqueSortedArray< PatchElem >::operator=(), and UniqueSortedArray< PatchElem >::UniqueSortedArray(). 00123 {
00124 if (this->size()) {
00125 int oldIndex=0;
00126 int newIndex=0;
00127 while (++oldIndex < this->size()) {
00128 if ( ! ( this->rep->array[oldIndex] == this->rep->array[newIndex] ) ) {
00129 if (++newIndex != oldIndex)
00130 memcpy((void *)&(this->rep->array[newIndex]),
00131 (void *)&(this->rep->array[oldIndex]),
00132 sizeof(Elem));
00133 } else {
00134 this->rep->array[oldIndex].~Elem();
00135 }
00136 }
00137 this->rep->arraySize = ++newIndex;
00138 }
00139 }
|
1.3.9.1