Closed schaepermeier closed 2 years ago
I added vectorization to the MPM2 interface, which produces significant speed-ups when evaluating a large amount of points, e.g., for visualization purposes.
On my machine, this results in a speed-up of about 2e-4 seconds per evaluation:
library(smoof) fn <- makeMPM2Function( n.peaks = 3L, dimensions = 2L, topology = "random", seed = 4L, rotated = TRUE, peak.shape = "ellipse" ) dec_space <- matrix(runif(2 * 1e5), ncol = 2) system.time(fn(t(dec_space))) #> user system elapsed #> 5.037 0.076 5.478 system.time(apply(dec_space, 1, fn)) #> user system elapsed #> 24.399 0.344 25.722
Let me know if you need anything else before we can integrate this change :-)
Thanks Lennart! This is a valuable improvement! Could you please also update the NEWS* files?
Done :-) Anything else?
Thanks! Merging.
I added vectorization to the MPM2 interface, which produces significant speed-ups when evaluating a large amount of points, e.g., for visualization purposes.
On my machine, this results in a speed-up of about 2e-4 seconds per evaluation:
Let me know if you need anything else before we can integrate this change :-)