- edited description
Speed up lea.max_of and lea.min_of functions
The current implementation of lea.max_of
and lea.min_of
could be slightly optimized, without using fast=True
(hence without loosing referential consistency).
Currently in lea 3.0.1, the call
lea.max_of(a,b,c)
builds something similar to
Flea.build(max,(a,b,c))
To calculate the resulting probability distribution, this has to call max(va,vb,vc) for each combination of values (va,vb,vc).
Now, if we build instead
Flea2(max,Flea2(max,a,b),c)
then the calculation could be faster because max(va,vb) shall be calculated only once for each (va,vb) pair. Note that Flea2 has the same semantic as Flea, i.e. functional random variable, but is optimized for functions having two arguments.
Of course, the same optimization could be done also on lea.min_of
.
Comments (10)
-
reporter -
reporter Optimize implementation of lea.max_of and lea.min_of functions (refs
#46)→ <<cset 1478f7b8cc8a>>
-
reporter Use iter(...) to browse arguments in lea.max_of and lea.min_of functions (refs
#46)→ <<cset 896e86bb0227>>
-
reporter Add tests for lea.max_of and lea.min_of functions (refs
#46)→ <<cset 2124bb394c8b>>
-
reporter - changed status to open
-
reporter - changed status to resolved
-
reporter - changed status to closed
-
reporter Optimize implementation of lea.max_of and lea.min_of functions (refs
#46)→ <<cset ff0a1909a0d0>>
-
reporter Use iter(...) to browse arguments in lea.max_of and lea.min_of functions (refs
#46)→ <<cset 368b275158de>>
-
reporter Add tests for lea.max_of and lea.min_of functions (refs
#46)→ <<cset 40be7499e162>>
- Log in to comment