> The transformation (t) creates a space-consuming intermediate matrix
> (2-/\])^:([: i. #) 1 4 9
> 1 4 9
> _3 _5 0
> 2 0 0
> where only the first row is input and only the first column is output. I want
> to compute in-place to save space:
> 1, 4 9 --> 1 _3, _5 --> 1 _3 2
> My second question: How is that done?
>
>
>
Not an answer, but you might work with a leaner matrix (# columns = pol.
grade) to save space (and time):
etc17=: 4 : 0
a =. {."1 (}:-}.)^:(i...@#) y
z =. {:a
{."1 (-z,~}.)^:(i.x) }: a
)
15 etc17 0 1 4
0 1 4 9 16 25 36 49 64 81 100 121 144 169 196
... and, has someone an explanation for the odd behavior in time/space
consuming:
ts '45e3 etc17 0 1 4'
0.08157 4636480
ts '46341 etc17 0 1 4'
0.083209 4730496
ts '46342 etc17 0 1 4'
12.471191 14250240
????
TIA
--
Met vriendelijke groet,
=@@i
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm