Linked Questions

4
votes
1answer
111 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 ...
12
votes
7answers
675 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: ...
4
votes
3answers
438 views

Slow computation of recursive sequences

I want to investigate the asymptotic behavior of the following recursive system: ...
2
votes
1answer
116 views

a recursive function using memoization

I have looked at a lot of these cases, e.g. Can one identify the design patterns of Mathematica? and the included ones. My trimmed example, here establishing the 'initial conditions' (where the ...
3
votes
1answer
137 views

Access to the temporary solution in NDSolve with StepMonitor

I want to step-monitor at each time step of a spatio-temporal NDSolve (using the finite element method) the maximum bending of the function sampled over the curent mesh. For this I first need access ...
0
votes
0answers
35 views

Is there a difference between these two ways to define a function? [duplicate]

(I took this example from another question) f[0] = 0; f[n_] := f[n] = DigitCount[n, 10, 1] + f[n - 1]; f[1016] I notice that this example defines f(n) in a ...
8
votes
6answers
477 views

Remove element from list and store it in variable?

In many programming languages there are functions that remove an element from a set while giving back that element. E.g. I'd like to have a function FetchFromStack ...
-7
votes
4answers
220 views

how to make program read from top-to-bottom? [closed]

"As a general principle, make the program read from top to bottom rather than jumping around. Experts agree that top-to-bottom order contributes most to readability." I think it's difficult to do it ...
11
votes
1answer
159 views

Trace of -{1} expression

I'm trying to understand Trace. Usually it doesn't repeat but it adds {-1,-1} for his simple expression after having a correct ...
1
vote
1answer
488 views

Recursive Function Numerical Integration

I just tried to modify a code snippet for Neumann series to the Fredholm integral equation $ f(x)= \sqrt{x} - \int^1_0 dy\; f(y) \sqrt{x y} $ which I read in another post: How to solve an integral ...
12
votes
2answers
464 views

Time constrained optimization?

I'm trying to solve a maximization problem that apparently is too complicated (it's a convex function) and NMaximize just runs endlessly. I'd like to have an approximate result, though. How can I ...
2
votes
1answer
130 views

How to efficiently manage lists of arbitrary length?

I am running calculations that will generate a list of lists of integers. Throughout the calculations, the number of lists will increase, and already-existing lists will be added to. What is the ...
9
votes
4answers
339 views

How to avoid repetitive calculation when doing numerical integral?

Suppose I have a function f[x] which is very complicated, together with a function g[f[x]]+h[x] to integrate. That is: ...
6
votes
0answers
199 views

Improve recursive function (memoization)

These days I am trying to rewrite the following recursive function, in order to gain some speed. It is crucial because I end up using 4-5 similar functions, and I need to decrease execution time. ...
48
votes
2answers
2k views

Granular versus terse coding

While reading Leonid's grand answers to General strategies to write big code in Mathematica? I came across something that goes against my own practices. I do not disagree with the principle but the ...

15 30 50 per page
1
2 3 4 5
7