Linked Questions

0
votes
0answers
80 views
4
votes
1answer
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 ...
3
votes
1answer
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. ...
24
votes
3answers
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 ...
3
votes
1answer
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. ...
3
votes
1answer
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 ...
3
votes
1answer
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 ...
2
votes
1answer
103 views

LeastSquares vs ArgMin

From the documentation, we learn that: LeastSquares[m,b], when b is a vector, is equivalent to ...
10
votes
1answer
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 ...
17
votes
1answer
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 ...
115
votes
7answers
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 ...
0
votes
1answer
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. ...
16
votes
2answers
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 ...
4
votes
2answers
111 views

Modified FrontEnd to parse & highlight function definitions for compilability?

I suspect this would require advanced MMA skills, but it would be very useful if one could modify the front end so that any MMA defined function calls in a Compile[] could be flagged if they are not ...
6
votes
0answers
152 views

Possible Compile bug

Bug introduced in 11.3 or earlier The program: ...

15 30 50 per page
1
2 3 4 5
9