Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 1
    $\begingroup$ Thank you for your tough answer, I will need a nonpredictable amount of time to understand it.... $\endgroup$ Commented Sep 7, 2018 at 12:20
  • $\begingroup$ @UlrichNeumann I will try to add some explanations when I get a spare moment. $\endgroup$ Commented Sep 7, 2018 at 12:55
  • $\begingroup$ Thanks again for your effort!. $\endgroup$ Commented Sep 7, 2018 at 13:02
  • $\begingroup$ What do you think about this variant Compile[{{list , _Real, 1}}, Function[t, Sin[list[[1]] t] + list[[2]] Cos[t]] &]? What is the difference to your solution? Thanks! $\endgroup$ Commented Sep 8, 2018 at 20:35
  • $\begingroup$ @UlrichNeumann The difference is that my code gets compiled dynamically, already after list variable value gets injected into Compile. Your suggestion won't work as intended, because Compile can't return a compiled pure function, and so the Function will remain uncompiled. $\endgroup$ Commented Sep 9, 2018 at 19:16