Linked Questions

0
votes
1answer
63 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. ...
0
votes
0answers
54 views
302
votes
12answers
54k 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 ...
75
votes
7answers
7k 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 ...
83
votes
5answers
6k 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 ...
13
votes
6answers
819 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 : ...
41
votes
2answers
2k views

Internal`Bag inside Compile

Since Internal`Bag, Internal`StuffBag and Internal`BagPart can be compiled down, it is a ...
23
votes
3answers
695 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, ...
22
votes
3answers
597 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 ...
11
votes
3answers
755 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: ...
10
votes
4answers
1k views

Axis/Angle from rotation matrix

With r=RotationMatrix[a,{x,y,z}] I can compute a 3D rotation matrix from axis/angle representation. Given a 3D rotation matrix ...
14
votes
2answers
1k views

List of Parallelize[]-able functions

The question is clear and is inspired by this question and the first comment on this question. Although there are many tricks for parallelizing things that are not ...
5
votes
4answers
466 views

Combining the second elements of a set of ordered pairs based on their first element [duplicate]

I have a large set of ordered pairs and I am trying to add the second elements together for any group of pairs that has the same first element. For example my data looks like: ...
10
votes
5answers
448 views

Relational joining of tables

A common thing to want to do with data is to combine it (at least I thought this was a common thing). In SQL there is the idea of table joins "select id,v1,v2 from A,B where A.id=B.id" kind of thing. ...
12
votes
2answers
469 views

How can I compile this function

I want to simplify my function f1 to f2, but f2 can't be compiled. How can I make it ...

15 30 50 per page