Hallo,

I implemented a solution in J for Euler problem 161.

It is very slow.
:-(

I use a big array to memoize the result and the amend operation
is very slow.

Here a snippet from my code

time =: 6!:2
W =: 9
H =: 12
C =: 2 ^ 2 * W
Mem =: ( C, W , H ) $ _1x

The amend take more than 4 seconds.

    time 'Mem =: 4 ( < 1, 2, 3 ) } Mem'
4.136996

Is there a way to improve the amend time?

MfG

Luca Masini.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to