Linked Questions

4
votes
4answers
448 views

How to do memoization together with evaluation of a complicated function

UPDATE 2: much shorter version Given a list of paired indices {i, j}={{1,2}, {3,4}, …}, I need to first evaluate a rather complicated function test[i,j,x] (because ...
3
votes
3answers
574 views

Generate a list of all user defined functions including their argument patterns

I have defined a bunch of functions over several different files, and I would like a list of prototypes of all the functions I have defined in my current session (I want the mathematica equivalent of ...
11
votes
1answer
146 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 ...
4
votes
1answer
512 views

Recursive list contruction

I am attempting to implement the exercises from The Little Schemer in Mathematica, and running to a bit of a challenge with rember (remove member). Given a list and a value, the function just returns ...
4
votes
1answer
396 views

How to construct this matrix fast?

I write a function which is a matrix as below: ...
3
votes
2answers
131 views

Repeatedly apply a bivariate function with one argument running over a list

I'd like to know how, given symbols f and g, and a list {a,b,c,...}, to produce the ...
4
votes
1answer
952 views

Create a table with inline conditions

I am trying to create a table with conditionals inline. For example, I'd like to create a 2 dimensional table like this: ...
-7
votes
4answers
195 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 ...
0
votes
3answers
306 views

Speed up manipulate by exporting each step as an image

Consider a manipulate function such as: ...
2
votes
1answer
732 views

calculating a sequence of functions using iteration

I am trying to compute a sequence of functions using iteration and keep running into problems trying to use built in looping commands because of the recursive nature of the definition. The code below (...
10
votes
1answer
162 views

Is it possible to use the global definition of a symbol as part of its new local definition set in a Block?

Consider the following expression: Block[{Print = CopyToClipboard}, doSomething[]] Now all calls to Print from ...
1
vote
2answers
1k views

Finding max, min, and closest root of two dimensional data

I have some data that is two dimensional (traditional (x, y) format) as so: var = {{x1, y1}, {x2, y2}, {x3, y3}} I would like to search through that large list ...
0
votes
2answers
945 views

Specifying an array that may have an unknown number of entries [duplicate]

Say I'm running some process of unknown duration, and during the process, I need to periodically record the state of some variable. If we knew exactly how long the process took, we could simply ...
10
votes
1answer
194 views

How to speed up the evaluation of a function with a large LeafCount but many repeated sub-functions for use in NIntegrate

General Context Apparently, the memory leak in NIntegrate is unavoidable pre-MMA-10.2. I have some (two-dimensional) numerical integration to do on a complicated ...
10
votes
2answers
286 views

How to implement JoinTo efficiently?

AppendTo is not efficient so I'm not quite sure of the best way to implement its analogue for joining (e.g. in python this would be extend function). So how can this be improved: ...

15 30 50 per page