(this thread is continued from October)
I finally realised how cool Raul's solution was (I was travelling).
coef ([EMAIL PROTECTED] {. [: |. [: </. ] */ *) i.10
OR
10 {. |.</. (i.10) */ coef * i.10
A question on this-- I don't get */ and * in combination? I'm thinking that
only */ is need for me. Am I missing something?
Tacit verb trains seem worth the effort. I'm not quite up to speed on when
the hook or fork substitution should take place yet... getting there. I'm
finding the box < operator to be very useful for pulling apart verb trains.
Are there any other good debugging aides apart from the debug tool itself
(which is quite reasonable but doesn't seem to be designed to pull apart a
single line)?
Now a few questions about execution.
Is it an issue that we have (n * (n-1)) too many calculations?
Does this balloon out memory usage for large arrays?
Is J smart enough to reduce the amount of memory required. We've got
everything on one line. Perhaps there's cleaver usage of CPU registers
going on? I keep thinking procedurally that there must be a large data
structure for this.
Is there a layman's way of understanding how J optimises? Array based
languages / loopless code / vectorisation are supposed to be fast right?
I took the above imagined constraints into account, and realised that in my
case there was convergence going on,
and that the problem could be broken in two... so these things don't really
effect the algorithm that much. If the above (potentially imagined) impacts
were important, they will become minimal anyway with only a few lines of J
code. I must say that J helped get to this point. Would love to know how
far J can be 'pushed' though. Curious.
Sorry for the long post.
Thanks,
-Steven
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm