I'm stumped again. No matter what I've tried, it hasn't worked. Here's
the APL code (I've substituted J equivalents for the rho, iota, times,
and negative symbols):
V <- 5 3
Z <- (($V),*/V) $ I <- 0
Z[I;] <- (*/V) $ 1 , (_1 + V[I]) $ 0
And here's my J code, splitting the APL lines into smaller J lines to
doublecheck values for making sense and to show the J interpreter
results for each line:
]i=. 0
0
]v=. 5 3
5 3
]z=. (($v),*/v) $ i
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
]b=. (_1 + i{v) $ 0
0 0 0 0
]a=. (*/v) $ 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
]c=. a,b
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0
]z=. c i } z
|length error
| ]z=.c i}z
|[-3]
Not knowing if APL takes certain "shortcuts" (truncations, expansions,
etc.) that may not be in any of my documentation, and if I'm
interpreting things correctly, it appears that the problem lies with an
attempt to replace a row of array z with a list containing more values
than the array's rows contain. Not having APL, I can't check to see
what APL would equivalently do with each of my broken-down lines above:
whether it truncates list "a" from 19 to 15 values, or whether it
expands or lengthens the rows in array "z" to fit the new value, or
what. (Unfortunately, I can't tell you what any intermediate result
values *ought* to be. I know only the final values of a function
containing these lines among a number of others.)
Concerning the above, I'm assuming, of course (perhaps incorrectly!),
that my "z=. c i } z" is a correct J translation of the APL "Z[I;]<-..."
statement.
Help from any J-er familiar with APL would be much appreciated--thanks
in advance!
Harvey
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm