Commit graph

115 commits

Author SHA1 Message Date
David Nadlinger
bf61ad682f Merge pull request #4826 from andralex/6192-redivivus
Use medianOf 3 and 5 to estimate pivot
2016-10-01 14:41:56 +01:00
Andrei Alexandrescu
2f8e693e5d Merge pull request #4814 from e-y-e/fixflags
[trivial] [large diff] Update uses of Flag to use the Yes/No structs.
2016-09-30 18:25:44 -04:00
Andrei Alexandrescu
26f47b1e2e Watermarks slightly different for debug vs release 2016-09-30 17:44:38 -04:00
Andrei Alexandrescu
3cb9e4d821 Use medianOf 3 and 5 to estimate pivot 2016-09-30 16:10:40 -04:00
Walter Bright
c5f289156e Merge pull request #4809 from andralex/pivotPartition
Add pivotPartition
2016-09-30 12:09:39 -07:00
Andrei Alexandrescu
b2978040ca Merge pull request #4429 from JackStouffer/issue16170
[Issue 16170] Partial Fix for Broken std.algorithm.sorting.partition
2016-09-30 11:43:19 -04:00
Jack Stouffer
e21f2729ba [Issue 16170] Seperate std.algorithm.sorting.partition into various overloads in order to facilitate further improvements 2016-09-30 15:16:36 +01:00
Andrei Alexandrescu
a9b7fb0313 Add back the entropy following dmd bug fix 2016-09-30 09:13:30 -04:00
Andrei Alexandrescu
d5e2b607d7 Fix dox 2016-09-30 09:08:01 -04:00
Andrei Alexandrescu
63f9713feb Add some dox 2016-09-30 09:08:01 -04:00
Andrei Alexandrescu
40df929b37 Add pivotPartition 2016-09-30 09:08:01 -04:00
Andrei Alexandrescu
25dac83dbc medianOf restricted for now to only size_t indexes 2016-09-29 18:45:42 -04:00
Andrei Alexandrescu
1859f0dc19 Make medianOf private for now to have freedom in choosing a public spec later 2016-09-29 16:22:21 -04:00
Andrei Alexandrescu
0a967579bb @wilzbach review 2016-09-29 16:21:04 -04:00
Andrei Alexandrescu
15ee49f84f Review 2016-09-29 16:21:04 -04:00
Andrei Alexandrescu
dcd00a7609 Add medianOf 2016-09-29 16:20:11 -04:00
e-y-e
befa0bfb6e Updated Flag uses to Yes/No structs 2016-09-29 14:45:20 +01:00
Andrei Alexandrescu
a4393248ba Tighter loop for insertion sorting 2016-09-25 18:13:58 +02:00
Martin Nowak
97f58eac9d don't preincrement j index to match else branch
- was confusing to use different index flavours for the 2 "memmoves"
2016-09-25 11:51:53 +02:00
Martin Nowak
a0eec9d86b dedicated sort5 unittest
- test all permutations of 5 integers
- remove scope success assertion in sort5
- move shortSort test below shortSort as it now tests only one function
2016-09-25 11:26:16 +02:00
Martin Nowak
5901459850 replace a-e indices w/ 0-4 2016-09-25 11:12:39 +02:00
Andrei Alexandrescu
56f511c020 Workaround for https://issues.dlang.org/show_bug.cgi?id=16534 2016-09-24 11:46:47 -04:00
Andrei Alexandrescu
9e84e1a247 Optimized sort, 4%-8% speed improvements 2016-09-24 11:10:42 -04:00
e-y-e
669fa67b1d Change yes/no enum SortOutput to a Flag 2016-09-23 10:32:43 +01:00
Sebastian Wilzbach
501a1d5f41 fix issue 15960 - deprecate setUnion in favor of merge 2016-08-28 17:51:29 +02:00
John Colvin
7c7af21d48 add test for Issue 16413 2016-08-27 15:06:22 +01:00
Sebastian Wilzbach
9abe256cab Merge pull request #4740 from togrue/bugfix_16179
Fix issue 16179 - multiSort no longer callable with delegate with context
2016-08-26 21:47:54 +02:00
togrue
7f88a93227 Fixed issue 16179
(multiSort no longer callable with delegate with context)

- Moved out nested functions inside multiSort to the module scope.
- Added a unittest
2016-08-26 21:04:01 +02:00
Andrei Alexandrescu
66ba7b87f0 This is 3% faster because of better use of speculative hardware 2016-08-12 17:09:47 -04:00
Andrei Alexandrescu
30cb5191b0 Simplify, eliminate redundant work in sort 2016-08-12 15:55:45 -04:00
Walter Bright
ec8534d58b sorting.d: add overflow checks 2016-08-05 00:44:20 -07:00
Walter Bright
03a5eae0f4 fix .ptr safety problem in schwartzSort() 2016-08-03 00:03:21 -07:00
Jack Stouffer
f30c6a106c Enable always true assert checks in Travis 2016-07-31 10:47:26 -04:00
Walter Bright
c6aa7e19d5 Merge pull request #4685 from wilzbach/std_algorithm_sorting
add unittest attributes to std.algorithm.sorting
2016-07-29 15:09:35 -07:00
Sebastian Wilzbach
790aada728 replace functions with lambda aliases 2016-07-29 18:16:34 +02:00
Sebastian Wilzbach
fde82ff034 std.algorithm.sorting: enable CTFE test for Timsort 2016-07-29 17:31:20 +02:00
Sebastian Wilzbach
016d5145b2 make std.algorithm.sorting @safe-er 2016-07-29 17:14:20 +02:00
Nick Treleaven
46a08e86d7 [trivial] Tweak docs for std.algorithm.sort 2016-07-18 12:03:37 +01:00
Jack Stouffer
b24000513d Removed unused variables from std.algorithm.sorting 2016-07-08 11:34:48 -04:00
Andrei Alexandrescu
e59c06b410 Merge pull request #4431 from wilzbach/document_std_algorithm_test
add external imports to documented unittests in std.algorithm
2016-06-18 06:38:44 -04:00
Sebastian Wilzbach
ec47ac4224 Remove the WEB macro in favor of HTTP
replacement: sed 's/\$(WEB/\$(HTTP/g' -i **/*.d
2016-06-16 00:14:51 +02:00
Sebastian Wilzbach
8b60ec24b0 add external imports to documented unittests in std.algorithm 2016-06-15 03:42:28 +02:00
Steven Schveighoffer
c5bb43ce54 Merge pull request #4425 from JackStouffer/issue16073
Partial Fix for Issue 16073 (part 2)
2016-06-14 11:01:59 -04:00
Jack Stouffer
94d74ac8f5 [Issue 16073] Fix incorrect uses of random access range primitives in std.algorithm.sorting 2016-06-14 10:04:01 -04:00
Dmitry Olshansky
6dc8e467b0 Merge pull request #4415 from WalterBright/safeSchwartz
make the Schwartz @safe
2016-06-10 21:10:00 +04:00
Walter Bright
23613c2189 make the Schwartz @safe 2016-06-07 04:19:06 -07:00
Sebastian Wilzbach
1d34a121e9 apply all-man braces in Phobos
// find common cases
sed -E "s/^(\s*)((if|static if|for|foreach|foreach_reverse|while|unittest|switch|else|version).*)\s*\{$/\1\2\n\1{/" -i **/*.d
// catch else-if
sed -E "s/^(\s*)} (else static if| if|else if|else)(.*)\s*\{$/\1}\n\1\2\3\n\1{/" -i **/*.d
// remove created trailing whitespace
sed -i 's/[ \t]*$//' **/*.d
2016-05-31 13:07:53 +02:00
Sebastian Wilzbach
2dfbc51f17 Standardize whitespace after imports
Unified with:

sed -E "s/import\s*([^ ]+)\s*:\s*(.*(,|;))/import \1 : \2/" -i **/*.d
2016-05-29 22:09:56 +02:00
anonymous
ef9722928c XREF_PACK_NAMED -> REF_ALTTEXT (sed)
Done by:

arg='\s*([^(),]*)'
from='\$\(XREF_PACK_NAMED\s'$arg','$arg','$arg','$arg'\)'
to='$(REF_ALTTEXT \4, \3, std,\1,\2)'
(find . -type f -name "*.d" -print0; \
    find . -type f -name "*.dd" -print0) | \
xargs -0 sed -i -r "s/$from/$to/g"
2016-05-27 21:32:46 +02:00
anonymous
d648f9320e XREF_PACK -> REF (sed)
Done by:

from='\$\(XREF_PACK\s+([^(),]*),\s*([^(),]*),\s*([^(),]*)\)'
to='$(REF \3, std,\1,\2)'
(find . -type f -name "*.d" -print0; \
    find . -type f -name "*.dd" -print0) | \
xargs -0 sed -i -r "s/$from/$to/g"
2016-05-27 21:32:46 +02:00