130k views

### Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
19k views

### How to compile effectively?

What are the best practices of compiling functions? I understand that this is a vague question, but let me list some aspects that might trigger useful answers. Some of these have already been answered ...
14k views

### Struct equivalent in Mathematica?

I really miss having something like a struct in Mathematica. I know of (and regularly use) a couple of programming techniques which feel like a ...
4k views

### Functions vs. patterns

Every time I define a new function, I wonder which construct I should use: true functions obtained by using Function, or rule-based syntax. For example, these are ...
4k views

### How do I evaluate only one step of an expression?

I am looking for a simple, robust way to evaluate an expression only one step, and return the result in a held form. The definition of a single step is ambiguous, and this itself is probably worthy ...
746 views

### What kinds of uses of SymbolicC (introduced in Mathematica 8) do you foresee? Are there any neat examples already?

Mathematica 8 introduced SymbolicC, a set of Mathematica functions that capture C language constructions in the familiar Mathematica tree-like fashion. Additionally, there are functions to write ...
1k views

### How to inject an evaluated expression into a held expression? [duplicate]

I know that there are methods to structurally manipulate held expressions (discussed e.g. here), but I failed to apply those for this particular problem: ...
796 views

### How can I compile this function

I want to simplify my function f1 to f2, but f2 can't be compiled. How can I make it ...
264 views

### How to join held Lists?

Let's say I have a = Hold@{2+2} b = Hold@{4+4} How can I get Hold@{2+2,4+4} ie join the two held lists ? More ...
423 views

### How to define a function inside a Compile?

I want to compile a variety of commands, including a function. I need to map this function, inside the compilation, and I can't include the function without facing errors such as "CompiledFunction::...
498 views

### Metaprogramming: creating compiled functions from inter-dependent code blocks

I want to create a compiled function from inter-dependent code blocks. Here is a minimal example showing the salient features based on strings: ...
587 views

### Compile function which calls other functions to C

I have a function which calls other functions and I would like to compile it to C code. For example: ...
441 views

### Using Apply inside Compile

In this great answer a compiled version of the Nelder-Mead algorithm is presented. Since it works on arbitrary dimensions (i.e. arbitrary number of arguments), it has to use apply on the objective ...