MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Replace, ReplaceAll and If time performace comparition


Hi,

> Can anyone top the result?

contradicting to my announcement, I tried anyway and found this to be 
considerably faster on my machine:

cf3 = Compile[{{list, _Integer, 1}},
  Map[If[# > 0, #, 0] &, list],
  CompilationTarget -> "C"
]

hth,

albert



  • Prev by Date: Re: needed.
  • Next by Date: Re: LibraryLink & MinGW
  • Previous by thread: Re: Replace, ReplaceAll and If time performace comparition
  • Next by thread: Re: Replace, ReplaceAll and If time performace comparition