-
Convergence using binary?
Hi,
Hope this will be clear enough; I am trying to pass 2 parameters (x;y) to a function, for convergence:
- “x” being an initial table, which the convergence function will gradually modify until no change, using…
- “y”, a list, which current value allows defining current conditions within the convergence function.
The first “y” value sets the 1st convergence function applied to table “x”. The resulting converged table, together with the second “y” value, then feed the next convergence… etc, up until the last item in the “y” list. Basically, the parameter “y” allows the condition(s), within the function to converge, to change as “y” is iterated and feeding the next loop.
The following pseudo code is what I am looking for:
Step 1
f:{[x;y]
cond based on 1st item of y;
x: <delete from x where cond>, until x is stable;
}/[initial table]/[first in list]
Step 2 & following: using table output from previous convergence, together with next element in list:
f:{[x;y]
cond based on n’th item of y;
x: <delete from x where cond>, until x is stable
}/[output table from previous step]/[next in list]
… obviously with the bizarre “/[table]/[list]” interpreted as <converge table> over <list>. I think it is possible to achieve this through encapsulation and/or .z.s, but my attempts have failed. Any help would be appreciated.
Thx
JP
Log in to reply.