5k views

### Functional style using lazy lists?

Let's say I want to answer the question "what are the first 400 palindromic prime numbers?" The first approach that comes to my mind from the set of languages that I know is to use some sort ...
2k views

### Resource management in Mathematica

I am using a library that has functions like createSomeObject[] and deleteSomeObject[obj]. It is an interface to a C language ...
15k views

### Performance tuning in Mathematica?

What performance tuning tricks do you use to make a Mathematica application faster? MATLAB has an amazing profiler, but from what I can tell, Mathematica has no similar functionality.
5k views

### How can I implement dynamic programming for a function with more than one argument?

Dynamic programming is a technique for avoiding the repeated computation of the same values in a recursive program. Each value computed is immediately stored. If the value is needed again, it is not ...
144 views

### Openning JSON file, (NDJSON, new line delimited) — big file

I am trying since many hours to open a JSON file ("new line delimited") that has this as structure ...
855 views

### Why are my recursive functions running so slowly? And how do I fix them?

I am working with making numerical solvers for a modeling class I am in, and I want to use the internal recursion handling that is built into mathematcia, but there seems to be a problem. NDSolve ...
697 views

### Generate only unique combinations when input contains duplicates

I have a list with repeated elements, such as list = {a, a, b, c, c, c} and I'd like a list of the unique ways to choose 3 elements from it: ...
15k 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 ...
935 views

### What are some useful (or hidden) properties of MeshRegion?

There is quite a bit of powerful functionality built in to MeshRegion, but it seems to be lacking in some areas. For example: extracting a list of edges that live ...
444 views

### Slow computation of recursive sequences

I want to investigate the asymptotic behavior of the following recursive system: ...
8k views

### How can I implement object oriented programming in Mathematica?

Roman Maeder's object oriented programming package is nice, but I'm hoping someone can suggest a sleek and novel implementation that is easy to use.
2k views

### How to clear parts of a memoized function?

I have a function of two variables, e.g.: f[a_, b_] := f[a, b] = something f[a - 1, b - 1] etc With the above code I used the concept of memoization to speed up ...
488 views

### Make mathematica treat $e_i^2$ as numeric

With NumericQ[symbol] = True, I can declare that a symbol is numeric. I want the expressions matching: $$e_{\text{i\_}?\text{IntegerQ}}^2$$ to be treated as ...
I have two $M \times K$ arrays $L, T$ where I would like to set all the elements in $L$ to zero whenever the corresponding element of $T$ is greater than 15. The ...