Commit graph

92 commits

Author SHA1 Message Date
Jack Stouffer
c5d537f06e Fix spelling mistake in iteration.d 2016-08-24 15:45:47 -04:00
Sebastian Wilzbach
d7a18dc52e add unittest attributes to std.algorithm.iteration 2016-07-29 12:25:22 +02:00
Ilya Yaroshenko
efe33e3470 fix docs in iteration
`sum` is not precise. Precise algorithms are Python `fsum` and Mir's [`sum!(Summation.precise)`](http://docs.mir.dlang.io/latest/mir_sum.html)
2016-07-26 10:07:42 +02:00
Andrei Alexandrescu
cd68d1a582 Merge pull request #4603 from JackStouffer/cache
Enhanced cache and map to provide length info for their slices
2016-07-15 16:45:30 -04:00
Jack Stouffer
fcb57098d1 Enhanced cache and map to provide length info for their slices 2016-07-14 14:03:25 -04:00
Jack Stouffer
c9222e1ecc Added messages to asserts in std.algorithm.iteration 2016-07-14 13:16:23 -04:00
Steven Schveighoffer
c74537000c Fix all windows cycles 2016-07-08 21:07:15 -04:00
Jack Stouffer
6b22c63c5b Enable long line checks in travis 2016-07-02 01:10:29 -04:00
Jack Stouffer
268fa2538d Add some const and immutable to std.algorithm 2016-07-01 17:11:09 -04:00
Jack Stouffer
ad7dbaa050 Fixed Issue 14485: .front of empty filtered zip range is accessible 2016-06-28 09:48:56 -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
Andrei Alexandrescu
ac9c93cb9e Merge pull request #4315 from wilzbach/algorithms_private_cleanup
std.algorithm: set accidentally exposed methods to private
2016-06-18 04:27:58 -04:00
Andrei Alexandrescu
7172eda466 Merge pull request #4327 from tsbockman/isPowerOf2
Add `std.math.isPowerOf2()`. Supports floating-point and integers.
2016-06-16 23:09:02 -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
tsbockman
18d1b436e4 Update Phobos to use the new std.math.isPowerOf2() everywhere.
`std.uni` looks like it may depend upon its local `isPowerOf2()` implementation
to return `true` for `0`. Since the semantics are different from the standard
version, I have renamed it to `isPow2OrZero()` to avoid confusion.
2016-06-04 21:19:38 -07:00
Sebastian Wilzbach
0c100a7b5a std.algorithm: set accidentally exposed methods to private 2016-06-04 16:13:07 +02:00
Steven Schveighoffer
e216c10b2c Merge pull request #4383 from JackStouffer/issue16073
Partial Fix for Issue 16073
2016-06-02 14:30:24 -04:00
Jack Stouffer
a818c7e059 [Issue 16073] Fix incorrect uses of random access range primitives in std.algorithm.iteration 2016-06-02 09:31:01 -04:00
Sebastian Wilzbach
ca098c57d2 manual allman brace fixup 2016-05-31 13:07:53 +02: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
641d6ff8d7 clean up remaining XREFs (manual)
Found by: grep -r '$(XREF'

std.experimental.allocator has a custom XREF2. Leaving that as is for now.
2016-05-27 21:40:46 +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
anonymous
764caefa36 XREF -> REF (sed)
Done by:

(find . -type f -name "*.d" -print0; \
    find . -type f -name "*.dd" -print0) | \
xargs -0 sed -i -r \
    's/\$\(XREF\s+([^(),]*),\s*([^(),]*)\)/$(REF \2, std,\1)/g'
2016-05-27 21:32:46 +02:00
Sebastian Wilzbach
614294cd70 remove whitespace in ddoc output of std/algorithm 2016-05-25 03:57:01 +02:00
Vladimir Panteleev
38a6370788 Merge pull request #4303 from wilzbach/mref_phobos
use mref macro instead of link2
2016-05-24 03:12:08 +03:00
Sebastian Wilzbach
89a2dd5f11 use mref macro instead of link2 2016-05-16 03:30:08 +03:00
Sebastian Wilzbach
b8f17e2531 std.algorithms: document public methods 2016-05-12 17:53:03 +03:00
Jack Stouffer
3890f5d804 Fixed long lines in std/algorithm/iteration.d 2016-05-10 20:51:39 -04:00
Ryan Roden-Corrent
ed03b22bc0 Support multi-arg opApply/range for each.
std.algorithm.iteration.each can now be called with a lambda taking >2
args. This should work for any input range that returns a tuple and any
type with a non-templated opApply that takes a multi-arg delegate.

Determining the arity of a templated opApply still poses a problem, so
that case is not supported.

This also adds support for `each` with two ref args.

When given a binary function that takes two args by ref,
std.algorithm.iteration.each should use both args by ref.

It was previously discarding ref on the first arg, assuming it was for
an index.

Resolves #15358.
2016-05-08 07:22:48 -04:00
Dragos Carp
984fbb487d Address review comments 2016-04-27 22:12:33 +02:00
Dragos Carp
5a9cedf1bd Add std.algorithm.iteration.cumulativeFold 2016-04-27 22:12:32 +02:00
Sebastian Wilzbach
3d67cd228c style fix: space between operators 2016-04-26 22:26:20 +03:00
Brian Schott
edbb7a1537 Merge pull request #4030 from dcarp/issue15735
Fix issue 15735
2016-04-25 18:21:16 -07:00
Dmitry Olshansky
1d2e88c266 Merge pull request #4069 from John-Colvin/patch-16
faster pairwise summation
2016-04-12 13:17:18 +04:00
Jack Stouffer
12c17d4fd0 Cleaned up std.algorithm.joiner's docs 2016-04-11 22:38:35 -04:00
Dragos Carp
b438bf5a06 Fix issue 15735 2016-04-11 20:58:23 +02:00
Ilya Yaroshenko
d4fa64bb42 fix index types to size_t 2016-04-10 12:46:51 +02:00
John Colvin
678a511ff2 faster pairwise summation 2016-03-24 13:14:42 +00:00
Brian Schott
f63523b1a8 Merge pull request #4065 from tsbockman/pr3969_fixup
Fixup for PR#3969
2016-03-18 16:58:13 -07:00
tsbockman
6c8333627c Fix map() to work with multi-module overload sets.
Verify return values for multiple lambda unittest.
2016-03-07 12:48:06 -08:00
Atila Neves
9cc2a5ae59 Replace 'reduce' with 'fold' in the documentation 2016-03-05 18:50:11 +01:00
Atila Neves
5d0ff1e1e5 Introduce "fold" as an alternative to "reduce" 2016-02-26 18:36:34 +01:00
H. S. Teoh
5bb30cc23c Fix broken links and missing ddoc identifier escapes. 2016-02-15 08:08:35 -08:00
Basile Burg
c871ab44cc fixed issue 15683 2016-02-15 06:08:07 +01:00
tsbockman
b23608b635 Fix Phobos issue 15480 2016-02-04 12:01:36 -08:00
Andrei Alexandrescu
731e47e242 Merge pull request #3800 from JackStouffer/lambda
Removed string predicates from std.algorithm.iteration documentation
2016-01-15 20:32:40 -05:00
Andrei Alexandrescu
47259a4267 Merge pull request #3923 from JakobOvrum/tls_in_reduce
Remove TLS variables from ReduceSeedType
2016-01-12 00:30:00 -05:00