Linked Questions

597 votes
19 answers
154k 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 ...
211 votes
24 answers
17k views

What are some useful, undocumented Mathematica functions?

There have already been some questions about some undocumented functionality in Mathematica. Such as (please add to these lists!) How can one find undocumented options or option values in Mathematica?...
178 votes
8 answers
22k views

List of compilable functions

Is there somewhere a list on the functions that Compile can compile, or the cases in which a particular function can be compiled that I haven't found? I'd be glad ...
Rojo's user avatar
  • 42.5k
182 votes
6 answers
23k 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 ...
István Zachar's user avatar
9 votes
8 answers
3k views

Better code to find Narcissistic number

My code finding Narcissistic numbers is not that slow, but it's not in functional style and lacks flexibility: if $n \neq 7$, I have to rewrite my code. Could you give some good advice? ...
expression's user avatar
  • 5,562
9 votes
5 answers
2k views

How to compile the code for generate Pythagorean_triple?

I am finding Pythagorean_triple, it worked slowly. I tried to compile, but it gives some warnings. I also use "Case" or "Do" ,both of them failed.I'm sure my CCompiler has been set correctly. How can ...
chyanog's user avatar
  • 15.1k
44 votes
1 answer
2k views

What's the deal with next generation Wolfram compiler?

Sources: Old Compiler (Rob Knapp Nov2011) Computer Science in Mathematica (Abdul Dakkak Dec2014) Compilation Technology (Tom Wickham-Jones, Abdul Dakkak & Steve Wilson Dec2015) The Wolfram ...
user13892's user avatar
  • 9,113
24 votes
2 answers
1k views

Efficiently collecting results inside a compiled function

When we don't know the number of results that will be generated, the usual way to collect results is Reap/Sow. Another ...
Szabolcs's user avatar
  • 233k
6 votes
4 answers
1k views

Delete elements from a list really fast

I have this bit of code that works, but it's very slow when there are 600k elements in the list: ...
Levi's user avatar
  • 425
4 votes
3 answers
12k views

How to convert output of a For loop into a list

I have written a For loop in my Mathematica notebook. This For loop, when activated, will generate a sequence something like: ...
Mel's user avatar
  • 465
15 votes
2 answers
447 views

How to build a list of elements satisfying a certain property without building a list of all elements first?

Is there a way to directly build a list of elements that satisfy a certain property? More precisely, I am looking for a function IncludeIf (this is a placeholder ...
M. Winter's user avatar
  • 273
21 votes
2 answers
571 views

Third argument of Compile

In his last comment on this answer, halirutan shows an example in which the third argument of Compile does not have any effect. The example is as follows. ...
Jacob Akkerboom's user avatar
9 votes
4 answers
444 views

How to evaluate a function on a list until stable?

I need to evaluate a function func on a range of integers (NOT recursively, just sequentially) until the result is stable enough. I can write a not very clever step-...
Ziofil's user avatar
  • 2,469
3 votes
3 answers
450 views

Picking items from a list

There's probably a Mathematica primitive to do this, but I don't know what it is...suppose I wanted to construct a list of all integers from $1$ to $n$ that were not divisible by $12$, and that were ...
rogerl's user avatar
  • 4,209
13 votes
1 answer
193 views

Can't make more than 249 Internal`Bags in a Table

I need a lot of Internal`Bags so I made them with Table. It works fine for 249 or fewer Bags...
Chris K's user avatar
  • 19.5k

15 30 50 per page