H. S. Teoh
0b6bfd5aa7
Cross-reference among
from canFind
.
...
For newbies' ease of discovering the right function to use (issue 13467).
2014-09-18 13:02:43 -07:00
H. S. Teoh
575b4aec7f
Merge pull request #1266 from idanarye/add-functional-pattern-matching-for-object-references
...
fix issue 9959 - Add functional pattern matching for object references
2014-09-16 07:15:10 -07:00
Vladimir Panteleev
c506b03ec4
fix Issue 13441 - joiner asserts with only(x) separator
2014-09-09 11:35:20 +00:00
Per Nordlöw
7f3611a5ed
Add empty check for haystack range r in skipOver()
...
Remove space
2014-09-02 14:28:35 +02:00
H. S. Teoh
6c53bfc58f
Use auto instead of explicit array type.
2014-08-30 07:09:57 -07:00
H. S. Teoh
76db0de19c
Eliminate C-style array declarations.
2014-08-30 06:51:27 -07:00
monarch dodra
dd4b204d5b
Merge pull request #2473 from quickfur/issue13393
...
Fix regression 13393: cartesianProduct + joiner = runtime assertion failure
2014-08-30 00:10:29 +02:00
H. S. Teoh
6e31087817
Simplify unittest.
2014-08-28 17:03:07 -07:00
H. S. Teoh
ca96460a1e
Fix regression 13393.
...
Caused by .save failing to save entire state, causing inconsistency in
.save'd objects.
2014-08-28 16:49:24 -07:00
Peter Alexander
5e0532b9e7
Fix Issue 10460 - auto ref for Union, SetDifference, SetSymmetricDifference
...
https://issues.dlang.org/show_bug.cgi?id=10460
The rearrangement of SetSymmetricDifference.front was needed since auto ref doesn't deduce correctly when there are multiple return statements (by design), so a single return statement with the ternary operator was used.
2014-08-25 13:32:34 +01:00
Михаил Страшун
bfebba8683
Merge pull request #2431 from monarchdodra/13304
...
Fix reduce regression 13304.
2014-08-21 22:30:51 +02:00
monarchdodra
76f994abf9
Fix reduce regression 13304.
...
Also cover test case 10709.
2014-08-21 20:17:22 +02:00
Михаил Страшун
676290c36d
Merge pull request #2415 from quickfur/issue13257
...
Workaround deprecation of splitter.{back,popBack} in std.algorithm.map.
2014-08-18 22:07:03 +02:00
IdanArye
cf1aa96bc4
fix issue 9959 - Add functional pattern matching for object references
...
Add the function std.algorithm.castSwitch, which chooses a delegate
based on the class of an object and run that delegate with that object.
2014-08-18 22:15:00 +03:00
H. S. Teoh
3c6efdf4e3
Reenable ancient failing unittest.
...
Fix unittest to not require unreasonable amounts of stack space.
2014-08-13 11:32:20 -07:00
H. S. Teoh
b97b396864
Workaround deprecation of splitter.{back,popBack} in std.algorithm.map.
2014-08-10 15:47:13 -07:00
IdanArye
0318f0ffba
fix issue 9942 - Add a functional switch function
...
std.algorithm.predSwitch is the functional version of the `switch`
statement(without a lookup table).
2014-08-09 17:13:15 +03:00
Dmitry Olshansky
53de1da98b
Merge pull request #2060 from monarchdodra/reduceReimpl
...
Re-implement reduce
2014-07-28 03:59:46 +04:00
monarchdodra
096ae6ab87
Use assertThrown
in reduce unittest
2014-07-27 22:59:07 +02:00
monarchdodra
2572cef9d4
Reduce unittest for 10709, 12569, and...
...
...an unfiled issue from the forums
2014-07-27 22:59:07 +02:00
monarch dodra
91d1864c2f
Re-implement reduce.
...
Consolidates the implementation, prepares for "fold", and also fixes a couple of issues:
http://forum.dlang.org/thread/oghtttkopzjshsuflelk@forum.dlang.org
https://issues.dlang.org/show_bug.cgi?id=10709
https://issues.dlang.org/show_bug.cgi?id=12569
2014-07-27 22:59:07 +02:00
monarchdodra
9d158ba52d
Fix Issue 8866 - Splitter(R1, R2) CANNOT be bidirectional.
2014-07-27 18:35:25 +02:00
Nils Boßung
4ebca8c2bd
change |=
to ||
2014-07-23 14:22:03 +02:00
Nils Boßung
a6da3ece06
fix Issue 13171 - std.algorithm.until(range, sentinel, OpenRight.no) doesn't propagate popping of sentinel to range
2014-07-20 23:39:49 +02:00
sinkuu
e989418fa5
Use unsigned-safe comparing in clamp contract
2014-07-19 08:10:25 +09:00
Dicebot
fe230e674f
Mention 'clamp' in the cheatsheet
2014-07-17 14:51:48 +02:00
Dicebot
8dc16d8109
Add in contract for clamp()
...
lower bound should not be larger than higher one
2014-07-17 14:47:34 +02:00
Dicebot
136e8661b6
Adjust clamp signature and tests
...
signed is now deduced over unsigned, added small documented unittest
instead of full block
2014-07-17 14:47:34 +02:00
Andreas Zwinkau
5cde6f5fd5
Add clamp function
...
Request in issue 10039
http://d.puremagic.com/issues/show_bug.cgi?id=10039
2014-07-17 14:47:34 +02:00
Dmitry Olshansky
1f4c14a067
Merge pull request #2195 from JamesDavidCarr/master
...
Changed distance() to be more memory efficient based on email from mailing list.
2014-07-17 00:40:57 +04:00
Михаил Страшун
04dee6bfe5
Merge pull request #2328 from quickfur/issue10693
...
Fix range violation for cartesianProduct of empty ranges.
2014-07-15 00:06:47 +03:00
H. S. Teoh
5f0155b0c8
.init value of cartesianProduct should be empty.
2014-07-14 12:47:28 -07:00
James Carr
0a7d2c9b10
Removed the accidental semicolon
2014-07-13 15:21:05 +01:00
James Carr
4beda7da9c
Changed the implementation of distance() so that it uses the memory inefficient version to prevent breakage in the API. Efficient version has been moved to distanceLowMem() in the struct and is called internally by levenshteinDistance()
2014-07-13 14:01:56 +01:00
James Carr
5102e9e273
Removed calls to matrix() in distance()
...
Since _matrix is now a single dimension matrix, calls to matrix() have
been removed and replaced with direct access equivalents.
2014-07-13 13:26:38 +01:00
James Carr
3e037f463e
Refactored distance() and corrected path()
...
Refactored distacen() so that it now accepts the lengths of the ranges
because we already calculate these in levenshteinDistance().
Altered ss in distance() and tt in distanceWithPath().
Moved popFront()’s to after their final usage to handle transitive
ranges.
Corrected path() so that it calls distanceWithPath() instead of
distance().
2014-07-13 13:26:38 +01:00
James Carr
0d0a2c0308
Refactored, added unit tests and removed opIndex.
...
Moved checks for which Range is longer to levenshteinDistance() method.
Reverted to implementation found in original distance() with regards to
using front/popFront instead of opIndex.
Fixed formatting of return statement.
Added two unit tests for levenshteinDistance().
Credit to @Poita.
2014-07-13 13:26:38 +01:00
James Carr
a9ae1023a2
Moved previous distance() implementation
...
Moved to be a private method and only expose new more memory efficient
distance(). This is done because we need the old implementation for
path(). Modified levenshteinDistanceAndPath() to use the old distance()
to reflect this.
2014-07-13 13:26:37 +01:00
James Carr
7f5aff5693
Fixed formatting
...
Moved all braces so that they are on their own lines and removed the trailing whitespace after function declaration;
2014-07-13 13:26:37 +01:00
James Carr
3a87433439
Modified Levenshtein distance()
...
Modified the implementation of Levenshtein distance so that it now uses O(n) memory but retains the same time complexity. However, does not work with path().
2014-07-13 13:26:37 +01:00
James Carr
4c9c85c183
Modified Levenshtein distance()
...
Modified the implementation of Levenshtein distance so that it now uses O(n) memory but retains the same time complexity. However, does not work with path().
2014-07-13 13:26:37 +01:00
Lionello Lunesu
2815d548d3
Added std.algorithm.safeLess for safe signed/unsigned comparison; rewrote min/max
2014-07-13 13:09:45 +08:00
H. S. Teoh
6e51fdf469
Fix range violation for cartesianProduct of empty ranges.
...
Completes the fix for: https://issues.dlang.org/show_bug.cgi?id=10693
2014-07-12 07:07:52 -07:00
Walter Bright
bcceb5424b
Merge pull request #2276 from quickfur/cprod_improve1
...
cartesianProduct improvement
2014-07-10 14:11:41 -07:00
safety0ff
b54f32eee6
std.algorithm.remove: Change pop____N to pop____Exactly
2014-07-02 19:57:44 -04:00
safety0ff
93068b15bd
std.algorithm.remove: Fix constraints and change popBack loop to popBackN
2014-07-02 19:57:44 -04:00
H. S. Teoh
95ea9c82ea
Get rid of exponential template bloat for most common use case of cartesianProduct.
2014-07-02 16:01:35 -07:00
H. S. Teoh
66287d0f29
Update unittest and example code to reflect new ordering.
2014-07-02 15:59:32 -07:00
H. S. Teoh
a8f80e04f2
cartesianProduct: default order should be lexicographically sorted.
2014-07-02 15:59:32 -07:00
David Nadlinger
733b895a8a
[trivial] Fix copy/paste error in minPos doc comment.
2014-06-28 09:09:00 +02:00