| java.lang.Object org.python.core.MergeState
MergeState | class MergeState (Code) | | The MergeState class is a java implementation of the sort created
Tim Peters and added to CPython2.3.
The algorithm is described in details in the file
python/dist/src/Objects/listsort.txt in the CPython development CVS.
|
Field Summary | |
final static int | MAX_MERGE_PENDING The maximum number of entries in a MergeState's pending-runs stack.
This is enough to sort arrays of size up to about
32 * phi ** MAX_MERGE_PENDING
where phi ~= 1.618. | final static int | MERGESTATE_TEMP_SIZE | final static int | MIN_GALLOP If a run wins MIN_GALLOP times in a row, we switch to galloping mode,
and stay there until both runs win less often than MIN_GALLOP
consecutive times. |
Method Summary | |
void | assert_(boolean expr) | void | binarysort(int lo, int hi, int start) | int | count_run(int lo, int hi, boolean[] descending) | public void | getmem(int need) | void | merge_at(int i) | void | merge_collapse() | int | merge_compute_minrun(int localN) | void | merge_force_collapse() | void | merge_hi(int pa, int na, int pb, int nb) | void | merge_lo(int pa, int na, int pb, int nb) | void | reverse_slice(int lo, int hi) | public void | sort() |
MAX_MERGE_PENDING | final static int MAX_MERGE_PENDING(Code) | | The maximum number of entries in a MergeState's pending-runs stack.
This is enough to sort arrays of size up to about
32 * phi ** MAX_MERGE_PENDING
where phi ~= 1.618. 85 is ridiculously large enough, good for an
array with 2**64 elements.
|
MERGESTATE_TEMP_SIZE | final static int MERGESTATE_TEMP_SIZE(Code) | | Initial temp array size
|
MIN_GALLOP | final static int MIN_GALLOP(Code) | | If a run wins MIN_GALLOP times in a row, we switch to galloping mode,
and stay there until both runs win less often than MIN_GALLOP
consecutive times. See listsort.txt for more info.
|
assert_ | void assert_(boolean expr)(Code) | | |
binarysort | void binarysort(int lo, int hi, int start)(Code) | | |
count_run | int count_run(int lo, int hi, boolean[] descending)(Code) | | |
getmem | public void getmem(int need)(Code) | | |
merge_at | void merge_at(int i)(Code) | | |
merge_collapse | void merge_collapse()(Code) | | |
merge_compute_minrun | int merge_compute_minrun(int localN)(Code) | | |
merge_force_collapse | void merge_force_collapse()(Code) | | |
merge_hi | void merge_hi(int pa, int na, int pb, int nb)(Code) | | |
merge_lo | void merge_lo(int pa, int na, int pb, int nb)(Code) | | |
reverse_slice | void reverse_slice(int lo, int hi)(Code) | | |
|
|