On Friday, 20 May 2016 at 20:04:35 UTC, Andrei Alexandrescu wrote:
On 5/20/16 2:13 PM, Jens Müller wrote:
No it doesn't work because you need to break in the last case.
Consider
the case when the last element of a is equal to an element in
b. Next
iteration you overrun a.
I'm not that
On Friday, 20 May 2016 at 14:14:18 UTC, Andrei Alexandrescu wrote:
On 05/19/2016 06:50 PM, Jens Müller wrote:
What if you stomped over an index in a that has as an equal
index in b
(it could be anywhere in b).
Hmmm, you're right. So that doesn't work, or at least not
efficiently (the fixup
On Thursday, 19 May 2016 at 22:04:56 UTC, Andrei Alexandrescu
wrote:
On 05/19/2016 05:36 PM, Jens Müller wrote:
I removed the code to optimize for large gaps. Because it is
only
confusing. I may generate some benchmark data with larger gaps
later to
see whether it is worthwhile for such data.
On Thursday, 19 May 2016 at 22:02:53 UTC, Andrei Alexandrescu
wrote:
On 05/19/2016 05:36 PM, Jens Müller wrote:
I'm not seeing it. Let me explain.
Consider the input a = [1] and b = [2, 3] (I only write the
indices).
The smallest back index is 1, i.e., a.back is the chosen
sentinel.
Nonono,
On Thursday, 19 May 2016 at 12:04:31 UTC, Andrei Alexandrescu
wrote:
On 5/19/16 4:12 AM, Jens Müller wrote:
---
if (a.length == 0 || b.length == 0)
return 0;
const amax = a.length - 1, bmax = b.length - 1;
size_t i,j = 0;
double sum = 0;
for (;;)
{
if (a[i].index < b[j].index) {
On Thursday, 19 May 2016 at 12:04:31 UTC, Andrei Alexandrescu
wrote:
On 5/19/16 4:12 AM, Jens Müller wrote:
What test data did you use?
An instance for benchmarking is generated as follows. Given nnz
which is the sum of non-zero indices in input vector a and b.
auto lengthA =
On Monday, 16 May 2016 at 13:46:11 UTC, Andrei Alexandrescu wrote:
Uses D for examples, showcases Design by Introspection, and
rediscovers a fast partition routine. It was quite well
received. https://www.youtube.com/watch?v=AxnotgLql0k
Andrei
Nice presentation.
The code applying the