HPCE / hpce-2017-cw5

1 stars 6 forks source link

random_projection division bug? #9

Closed Wiijah closed 6 years ago

Wiijah commented 6 years ago

In random_projection, the reference solution contains the line double p=16/n;

where n is an int. This will round to 0 when n > 16, at least on my machine. Hence, the output for this puzzle becomes all 0. Is this correct behaviour?

m8pple commented 6 years ago

I'm really not doing well this year on the details.

I tweaked this at the last minute in order to change the sparsity, but managed to remove the .0 off the previous constant. Of course, by that point I'd taken out some of the logging that checked it is doing something sensible, as otherwise it gives too many hints about how to attack it.

I'm double-checking now, but I'm pretty sure it should be:

double p=16.0/n;

This should give a sparse projection, but not an all zero one - as you point out, this results in a completely trivial problem.