Linked Questions

2 votes
1 answer
400 views

Compile a MeijerG function [duplicate]

I am not very experienced with Compile, I tried to use it for a Meijer-G function ...
ThunderBiggi's user avatar
  • 1,195
0 votes
1 answer
151 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. ...
Apple's user avatar
  • 3,663
1 vote
0 answers
160 views

How to compile the function with FindRoot? [duplicate]

How to compile this function or any function that uses lists and Part[] ? f[x_?NumberQ] := FindRoot[x == Sin[t] - t, {t, 1}][[1, -1]];
Vladimir's user avatar
  • 1,503
0 votes
0 answers
117 views

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

Consider this code: ...
xslittlegrass's user avatar
602 votes
19 answers
156k 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 ...
183 votes
6 answers
24k 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
123 votes
7 answers
18k 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 ...
Cassini's user avatar
  • 5,586
20 votes
17 answers
11k views

Generating a list of numbers that are not multiples of 4

I want to write simple code that will list all numbers from $1$ to $n$ that are not multiples of $4$. And in this case I consider that ...
Narine's user avatar
  • 433
29 votes
8 answers
2k views

Speed up Do loops in MMA 13.0

How to speed up Do loop in MMA 13. We consider the following Benchmark test (4 kernels, i7, win10): In MMA 13: ...
ABCDEMMM's user avatar
  • 1,816
61 votes
3 answers
4k 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 ...
Simon Woods's user avatar
85 votes
2 answers
5k views

Internal`Bag inside Compile

Since Internal`Bag, Internal`StuffBag and Internal`BagPart can be compiled down, it is a ...
halirutan's user avatar
  • 113k
15 votes
6 answers
1k 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 : ...
500's user avatar
  • 5,579
35 votes
4 answers
2k 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 ...
asim's user avatar
  • 1,875
35 votes
3 answers
1k 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, ...
Ajasja's user avatar
  • 13.7k
20 votes
6 answers
8k views

Axis/Angle from rotation matrix

With r = RotationMatrix[a, {x, y, z}] I can compute a 3D rotation matrix from its axis/angle representation. Given a 3D rotation matrix ...
Danvil's user avatar
  • 1,505

15 30 50 per page
1
2 3 4 5
10