198 views

### Compile a MeijerG function [duplicate]

I am not very experienced with Compile, I tried to use it for a Meijer-G function ...
78 views

### How to compile gather [duplicate]

First question，How to Compile this？ gather[data_]:=Gather[data, Mod[#1, 3] == Mod[#2, 3] &] I dont know why this is wrong. ...
62 views

### Compiled version of interpolation function slower non-compiled version [duplicate]

Consider this code: ...
76k 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 ...
8k 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 ...
9k 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 ...
896 views

### Efficient conditional Mean[] on a large data set

Consider a list, AK6, that has 382 sublists of length varying from 2500 to 3000. Each "subsublist" is as such : ...
2k views

### How can I add drop shadows and specular highlights to 2D graphics?

I thought I'd share some code in the form of a self-answered question, but other answers are of course welcome. Drop shadows are a familiar visual effect, giving the impression of a graphical element ...
2k views

### InternalBag inside Compile

Since InternalBag, InternalStuffBag and InternalBagPart can be compiled down, it is a ...
792 views

### Is using undocumented functionality a Bad Idea™?

Mathematica has a lot of very useful undocumented features. For example a hash table, a built-in list of compilable functions, additional options to CurrentValue, ...
847 views

### Which Distributions can be Compiled using RandomVariate

Recently, Oleksandr kindly showed a list of Mathematica commands that can be compiled. RandomVariate was part of that list. However, whether this can be compiled depends upon the distribution that is ...
900 views

### Function does not compile with Greater in it

I have to speed up a matrix-calculation and would like to use Compile for it, though it fails and produces an unknown error message: ...
1k views

### How to define a distribution that 90% of the time gives me 0?

This maybe a simple question, but I am just stuck with it. I want to do some simulation, say with 0.9 probability, I get a 1, and 0.1 probability get a 0. How would I do that? Where should I start? ...