Of course, I didn't mean primitives, but arbitrary verbs.

I ran into an unoptimized expression v/\ when
adding multiple points on an elliptic curve.

And due to unoptimization, I began to rewrite the code in Fold.
And I discovered an intuitively incomprehensible order of arguments in the V by 
Fold computing.

By the way, what are associative verbs?

Sergey.

25.02.2021 18:38, Henry Rich:
This is already done for associative atomic primitives.  For other associative 
verbs you have to use u/\.&.|. .

Henry Rich

On 2/25/2021 10:10 AM, 'Sergey Kamenev' via Programming wrote:
+/\ 1 2 3 4 5

By computing partial sum every time is recomputed partial fold.

It's time and CPU expensive.
1
1+2
1+2+3 - Sum 1+2 don't need to recalculated
1+2+3+4 - Sum 1+2+3 don't need to recalculated
1+2+3+4+5 - Sum 1+2+3+4 don't need to recalculated

This optimization can be done for absolutely all verbs
by adding an intermediate variable inside /\ implementation.

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


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

Reply via email to