Quantcast
Channel: How to speedup comparison in the following example? - Mathematica Stack Exchange
Browsing all 3 articles
Browse latest View live

Answer by user293787 for How to speedup comparison in the following example?

If one avoids repetition and explicit iteration, then one get fast code without compiling:TestIfNew[coef_,EnergyList_] := With[{X=coef*EnergyList}, With[{Y=uzmin[X]},...

View Article



Answer by xzczd for How to speedup comparison in the following example?

You forgot to inline the zmin.TestIf = Hold@ Compile[{coef, {EnergyList, _Real, 1}}, Table[{coef*EnergyList[[i]], uzmin[coef*EnergyList[[i]]], uzmax[coef*EnergyList[[i]]],...

View Article

How to speedup comparison in the following example?

I have the following problem: I would like to generate random values of some variable $z$ obeying some distribution, but simultaneously within the interval zmin<z<zmax. Below, there is the...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images