124 questions linked to/from List of compilable functions
80 views

### Why mathematica is returning error when computing correlation under Compile?

Can someone tell me what am I doing wrong here .. ...
120 views

### What exactly prevents this code from compiling?

I am trying to compile a function that operates on an initial array (doing some sequential operation) to produce a matrix (which consists of N iterations of the initial array). Below is a minimal ...
229 views

### Why Interpolation is slower than BSplineFunction?

This my question is concerned with previous about Tube cross-section. Let's use the same pts as in that question. ...
548 views

### Sudden increase in timing when summing over 250 entries

I see a sudden increase of Timing by a factor of thousands when I sum over 250 elements of a matrix rather than over 249. So for instance, this table contains sums ...
94 views

### Compiled Function is slower than non-compiled version?

I need to maximize a function numerically, thus the speed of this function is very important. Here is the most time consuming part of this function. ...
84 views

### How to do meta-programming inside Compile?

I'd like to do this: solve some linear systems, compiling the task of getting the building up the matrices from parameter values, and then I have a compiled implementation of LinearSolve. The problem ...
68 views

### How to use a list inside Compile—it says it should be a machine-size real number?

Super simple question, but I'm lost here. f = Compile[{{a, _Real}, {b, _Real}, {c, _Real}}, x /. NSolve[a x^2 + b x + c == 0, {x}]] f[1., -4., -5.] gives the ...
103 views

### LeastSquares vs ArgMin

From the documentation, we learn that: LeastSquares[m,b], when b is a vector, is equivalent to ...
465 views

### Writing compiled functions as fast as Python's Numba

I want to write some code to simulate a damped oscillator that is just as fast as code written using Numba's @njit decorator. I've written the mathematica code and ...
444 views

### Solver for COVID-19 epidemic model with the Caputo fractional derivatives

As it is known in biological system with memory it would be suitable to use fractional derivatives to describe evolution of the system. In a current version of Mathematica 12.1 there is no special ...
15k 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 ...
136 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. ...
381 views

### Improving Performance of an XY Monte Carlo

I normally write my Monte Carlo codes in Fortran for speed, but I was doing some quick and dirty work and wrote one in Mathematica for the XY model on a square lattice (see Kosterlitz-Thouless ...