Linked Questions

183 votes
6 answers

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 ...
István Zachar's user avatar
156 votes
9 answers

General strategies to write big code in Mathematica?

I think after six months of exposure to Mathematica and the Wolfram Language I am fairly OK with writing short codes and snippets. However, what are some general strategies to use in order to write ...
Ali Hashmi's user avatar
  • 8,960
122 votes
3 answers

What is a Mathematica packed array?

A simple sounding question with a few sub questions: What is the difference between unpacked vs packed array? Are packed arrays more space efficent, how much so? Are packed arrays more time ...
nixeagle's user avatar
  • 2,263
99 votes
4 answers

What best practices or performance considerations are there for choosing between Cases, Position, Pick and Select?

Cases, Select,Pick and Position each have different ...
Verbeia's user avatar
  • 34.2k
83 votes
3 answers

Metaprogramming in Mathematica

Being functional, and having no "quotation", i.e. essentially treating data and programs semantically same, Mathematica seems naturally capable of doing metaprogramming. But could anyone construct a ...
user13253's user avatar
  • 8,666
47 votes
5 answers

How can the behavior of InterpolationOrder->0 be controlled?

In ListPlot and Interpolation, the option InterpolationOrder->0 uses two different ...
ArgentoSapiens's user avatar
24 votes
4 answers

How to reduce the InterpolatingFunction building overhead?

I want a linear interpolation from the following example list: ...
P. Fonseca's user avatar
  • 6,665
20 votes
4 answers

Fastest way to check for list membership

I have a set of say 100 numbers {1,3,7,11,19,...3971}. All elements are previously determined. I want to check whether ...
Meqdad's user avatar
  • 433
17 votes
2 answers

Most efficient numerical selectBetween

Often when I'm working with numerical data I want to select those points within a given range. To do this I generally do something like: ...
b3m2a1's user avatar
  • 46.9k
16 votes
8 answers

How to avoid procedural loops in this example?

I want to iterate over a list, and return the index as long as I found the first element satisfying my condition. Written in a for loop: ...
Nick's user avatar
  • 390
15 votes
3 answers

Is there a built-in function to do binary search?

Is there a built-in function to do binary search? Say, given a list (sorted) and a number, find the position which keeps the listed sorted when the number is inserted. I know that ...
MMM's user avatar
  • 643
14 votes
3 answers

TimeSeries interpolation with time gap awareness

Is there an option for ResamplingMethod (or any other practical way) for specifying different behaviours of the interpolation, depending on, for instance, closest dates (on the ...
P. Fonseca's user avatar
  • 6,665
14 votes
4 answers

Fast Selections Testing on Inequality

Is there a functional idiom for fast selections testing on inequality? For example, finding values from list a & b where the key is less than or equal to a value, in this case 4 or 9. An ...
Chris Degnen's user avatar
  • 30.9k
14 votes
2 answers

the more effective method to find 21 digits armstrong number

In recreational number theory, a narcissistic number (also known as a pluperfect digital invariant (PPDI), an Armstrong number(after Michael F. Armstrong) or a plus perfect number) is a number that is ...
Apple's user avatar
  • 3,663
10 votes
4 answers

Taking Part of an InterpolatingFunction

I want a function to extract part of a one-dimensional InterpolatingFunction, similar to how Take works on lists. Based on the ...
Chris K's user avatar
  • 20.3k

15 30 50 per page