All Questions
20 questions
9
votes
2
answers
126
views
How can I return an empty list from FunctionCompile?
The following code is for solving a linear congruence of the form $ax=b \; (\mathrm{mod}\ m)$ using FunctionCompile.
...
0
votes
0
answers
63
views
Using compile with indexed variables
I have the following piece of code which I made faster by using compile. I make the following definitions
...
1
vote
1
answer
90
views
Why is this function not compilable?
Consider some functions
...
3
votes
1
answer
114
views
Can I efficiently use a compiled function as an input to another compiled function?
I have a compiled function(such as $f\left(z,c\right)=z^2+c$) which will get replaced by different equations as the code runs. I'm using this compiled function(#1) inside another compiled function(#2)....
8
votes
1
answer
144
views
What Does Compile`SetIterate Do?
The list of compilable functions (given by Compile`CompilerFunctions[] // Sort) shows one of the more interesting- and core-sounding functions: ...
1
vote
1
answer
107
views
Mysterious RegionDistanceFunction::regp message
Bug introduced in 12.3.1 or earlier and persisting through 13.1.0 [CASE:4853257]
I encountered a strange problem with RegionDistanceFunction. Consider this list of ...
1
vote
2
answers
64
views
Compile function with only some variables [closed]
I made the simple example below for explaining the problem. How can I compile only some variables?
For example, in the example only a and ...
4
votes
2
answers
83
views
Functions within modules within Compile
I've noticed that if I try to define a Function within a Module within Compile, I get errors ...
1
vote
1
answer
66
views
How to collect results from compiled function in ParallelEvaluate?
I am using Mathematica 12.x and have a compiled function, returning many things. I would like to run several instances of this compiled function, one for each core of my CPU, and then collect all of ...
0
votes
1
answer
77
views
Compiling RiccatiSolve LQRegulator gains
Given some specific matricies, numA, numB, numP, q and r to calculate LQR gains, one can use simply LQRegulatorGains or solve the same via ...
2
votes
3
answers
93
views
Strange Behavior of Compile[] inside With[]
Consider, in the examples below, the difference between defining $n$ as a global variable or as an argument to function comp[], which includes a compiled function ...
2
votes
1
answer
69
views
why this simple code is not giving the right answer under Compile
I have two sets of inputs that are to be fed to a simple function. The inputs are essentially a set of triangles and the normal for each triangle. The function will compute the gradient about the ...
2
votes
1
answer
159
views
How to compile properly for performance tuning
I have a question about how to compile functions properly for performance tuning.
Currently, I am trying to solve an eigenvalue problem of a large matrix. Initially I just used the conventional ...
2
votes
1
answer
138
views
Position with Compile is acting slower than without
For a big matrix 5000 x 5000 or list2 i am trying to get positions of all
entries Except[1.0]. I am using ...
0
votes
1
answer
340
views
How do Compile and Module work in a code?
I am trying to understand the following code in this answer regarding Möbius transformation:
...
3
votes
2
answers
385
views
Sum acting weird for large values [duplicate]
I have the following functions:
T = Compile[{n}, Boole[Sum[RandomReal[]^2, {n}] <= 1]];
Monte[d_, n_] := Sum[T[d], {n}]/n*2^d
T is a function that generates a ...
0
votes
0
answers
366
views
Compiling matrix multiplication using a list of matrices
I'm trying to create compiled function which computes a list of Gamma matrices named GammaM and multiply them within the compiled code.
...
2
votes
1
answer
235
views
Apply functions to functions yields slow execution speed
I'm trying to write a function that parametrizes a curve c(t) by its arc length. Technicly I'm finished but if I plot the result for an example curve like ...
3
votes
0
answers
541
views
Speeding Up Image Processing Functions
I am working with stacks of 1024x1024 timelapse microscopy images that I am performing a series of image processing functions on to help segment each image. These functions include ...
183
votes
8
answers
22k
views
List of compilable functions
Is there somewhere a list on the functions that Compile can compile, or the cases in which a particular function can be compiled that I haven't found?
I'd be glad ...