On 09/30/2013 05:45 PM, Andrei Alexandrescu wrote:
B-M has significant preprocessing costs, so it's not appropriate for all
cases. A function specialized in finding runs would be optimal without
preprocessing.
...
I guess another point is that Boyer-Moore requires more capabilities of
the i
On 09/30/2013 05:45 PM, Andrei Alexandrescu wrote:
On 9/30/13 5:04 AM, Timon Gehr wrote:
On 09/30/2013 11:59 AM, Peter Alexander wrote:
On Monday, 30 September 2013 at 09:15:22 UTC, Timon Gehr wrote:
On 09/30/2013 04:35 AM, Andrei Alexandrescu wrote:
2. We should statically specialize find(r1
On 9/30/13 5:04 AM, Timon Gehr wrote:
On 09/30/2013 11:59 AM, Peter Alexander wrote:
On Monday, 30 September 2013 at 09:15:22 UTC, Timon Gehr wrote:
On 09/30/2013 04:35 AM, Andrei Alexandrescu wrote:
2. We should statically specialize find(r1, r2) for the case r2 is an
instance of Repeat. The
On 9/30/13 2:15 AM, Timon Gehr wrote:
What is the optimization that would the specialized algorithm run faster
though?
Upon mismatch, restart search right after the mismatch point.
Andrei
On 09/30/2013 11:59 AM, Peter Alexander wrote:
On Monday, 30 September 2013 at 09:15:22 UTC, Timon Gehr wrote:
On 09/30/2013 04:35 AM, Andrei Alexandrescu wrote:
2. We should statically specialize find(r1, r2) for the case r2 is an
instance of Repeat. The specialization runs the tailored algori
On Monday, 30 September 2013 at 09:15:22 UTC, Timon Gehr wrote:
On 09/30/2013 04:35 AM, Andrei Alexandrescu wrote:
2. We should statically specialize find(r1, r2) for the case
r2 is an
instance of Repeat. The specialization runs the tailored
algorithm. The
user is supposed to call e.g. find(r,
On 09/30/2013 04:35 AM, Andrei Alexandrescu wrote:
I need a function that finds a run of length k of elements equal to x in
a range r, and I presume such a simple yet nontrivial algorithm (a
dozen-liner) should be part of std.algorithm.
This raises an interesting question - what form should the
I need a function that finds a run of length k of elements equal to x in
a range r, and I presume such a simple yet nontrivial algorithm (a
dozen-liner) should be part of std.algorithm.
This raises an interesting question - what form should the API have. I
see three options:
1. The existing