# Tagged Questions

Questions about the generation and use of compiled functions using Compile.

77 views

...
734 views

### Efficient implementation of a linear complexity measure of binary sequences

For a implementation of testing the quality of random number generators I implemented the NIST test suite in Mathematica based on the nice workbook by Ilja Gerhardt. However I took up the challenge ...
564 views

### How to use Compile for accelerating matrix multiplications?

I am trying to find the inverse of the matrix $A$ m = n = 500; SeedRandom[123456]; A = RandomReal[10, {m, n}]; iteratively using the following matrix ...
376 views

### Why does compiling a function with ConstantArray give an error when used in parallel?

Here is a sample compiled function: ...
87 views

### Why doesn't Compile work on Permutations function with second args?

Here is a narrowed-down example, the first case works, but the second one refuses to use the compiled version: ...
310 views

### Listing over multiple inputs (tensor rank > 1) in a compiled function

I'm trying to optimize the solution given by Michael E2 to my previous problem (Efficiently determining if 3D points are within a surface composed of polygons) which I figured would be relatively ...
368 views

### Compiling the VoigtDistribution PDF

According to List of compilable functions, Erf and Erfc are compilable functions. However, I want to make a compiled version ...
385 views

### Is the sharing of variables in Module/Block within Compile documented behavior?

Today I noticed something, I think for the first time. When used inside Compile variable values within Module (and ...
335 views

### Is it possible to use Compile on a function with optional arguments?

My Mathematica is a little rusty, so apologies in advance. I think my problem is quite simple, but I can't seem to find the answer on my own! Simple example : ...
315 views

### Listable compiled function using Map

I'm trying to minimize the computation time of problem which is too long to post. I use compilein order to gain some speed. To increase speed I would like to use ...
459 views

### Quick multiple selections from a list

What is the fastest way to make multiple selections from a list? Compiled methods included. For example, here are two methods for selecting a subset, compared:- ...
213 views

### What is the maximum real value for Compile?

Can one be found programmatically? The function I'm compiling, indicesOfMin, gives the indices of the minimum value(s) of a real-valued list, the parameter, in a ...
386 views

### I can't get Compile to work

I've got some problems with my code, and I try to make it faster. Some of you suggested me to split my problem, and I'm here... I post the same function with and without Compile. This is a support ...
303 views

### How can you profile compiled code?

Is it possible to profile compiled code? I am using Workbench 2.0 and the Profile[] command but I do not get a profile of my compiled function. I apologize if the answer is readily available but I ...
1k views

### Using a compiled function inside NIntegrate gives “CompiledFunction::cfsa” message

The following function is defined for Real input: FFc = Compile[{{x, _Real}, {EF, _Real}},If[x > EF, 0., If[x == EF, 0.5, 1.]]] FFc is now used in the ...
198 views

### CompiledFunction crashes kernel

Bug fixed in 10.0.0 This crashes my kernel ...
493 views

### Compiling LinearSolve[] or creating a compilable procedural version of it

Earlier today I had a discussion with a representative at Premier Support about the 2 questions I've asked here over the past couple of days: Seeking strategies to deploy a function securely ...
717 views

### 3 hour calculation? ParallelMap & ParallelTable

I'm having some problems with slow Mathematica code... I'm basically doing a computation that's is expected to take 3 hours (!) in my Core i7 with 4 processors... I'm basically computing an index (of ...
336 views

### error when defining a compiled function with ReplacePart

I always have difficulty in writing a non-trivial compiled function. I'm using Mathematica 9. Please see the following code ...
523 views

### How to compile the code for generate Pythagorean_triple?

I am finding Pythagorean_triple, it worked slowly. I tried to compile, but it gives some warnings. I also use "Case" or "Do" ,both of them failed.I'm sure my CCompiler has been set correctly. How can ...
308 views

### Compiling Map over expression that yields a ragged array

I'm trying to speed up a function that looks in the neighborhood of each 3D point in a large dataset and finds all the points within 1 unit in each direction, x, y, z. I've started by using ...
722 views

268 views

### Using Compile to speed up Function with PermutationProduct

I have the following fairly simple routine dot involving PermutationProduct that I wish to speed up using ...
710 views

### Using Goto and Label in compiled function?

Below I post some rudimentary code to show that there is something wrong using Goto and Label commands in compiled functions (or I believe there is something wrong). It seems that the command Label is ...
340 views

### Compiled version of (Norm/@coordinates)

Here I define (NormCoordinates). ...
510 views

### Compiled function error - nontensor object created

I'm trying to optimize code that uses Position MANY times. The following toy code works: ...
487 views

### Having problems compiling Mathematica Cuda code

Ok I am trying to follow the examples of Cuda Code in the docummentation Run the CUDAQ[] and get back a True and run some of ...
282 views

### Can RecurrenceTable make use of CompiledFunction?

I'm trying to implement a discrete-time 2D Verlet algorithm for a point-mass subject to a softened gravitational interaction as a test for a more computationally intensive simulation using ...
298 views

### Avoiding MainEvaluate in a CompiledFunction to fetch global variables

I'm trying to write a simulation using Mathematica 8.0. Since I will most likely be doing the same operation over and over again, I'm trying to Compile whatever I ...
294 views

### Unexpected behavior of Compile, Return and ;

Could somebody explain why test = Compile[{{x}}, Return[x]; ]; test[0.] returns ...
345 views

### Using Boost with CreateLibrary

I was looking at the answer of Leonid of Faster alternatives for DayOfWeek and wanted to see how hard it would be to do something similar in C++ using an external library like Boost. I tried to ...
734 views

### Parallel compiled functions running on parallel sub-kernels

Question Why is it, that compiled, Listable, parallel functions which work perfectly fine on the main kernel, do not run in parallel on sub-kernels? Details ...
982 views

### What compilers are “suitable” for CompilationTarget->“C”?

The documentation for CompilationTarget says, "if you do not have a suitable C compiler then you will not be able to set CompilationTarget to C". Well at this time, I don't have a compiler installed ...
207 views

### DistributeDefinitions not working for compiled functions

This is fixed in Mathematica 9.0.0. I'm having trouble with parallel evaluation of compiled functions. Here is a simple example illustrating the problem: ...
1k views

### How to install and configure Intel C++ Compiler for Mathematica correctly?

I wish to try the trial version of the latest Intel C++ Compiler for Windows with Mathematica. I have downloaded the current version of IntelĀ® C++ Composer XE 2011 for Windows and installed only the ...
163 views

### MemberQ weird inside Compile

Compile[{{x, _Real, 1}}, MemberQ[x, 2]][{2}] outputs False. In fact, it seems to get compiled as ...