Questions tagged [function-compile]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4 votes
2 answers
158 views

How to get a MTensor variable by a vector object

librarylink have a dirty signature such as: EXTERN_C DLLEXPORT int fun(WolframLibraryData libData,mint Argc, MArgument* Args, MArgument Res) But when we are in ...
user avatar
  • 24.6k
3 votes
0 answers
130 views

How to restore the compile function from FunctionCompileExportByteArray

We can compile a function into a ByteArray object: ...
user avatar
  • 24.6k
5 votes
2 answers
202 views

Why the Debug .dll is work normall but the Release .dll is crash in librarylink?

The Catenate is very slow in FunctionCompile. So I want to use the librarylink to make a .dll...
user avatar
  • 24.6k
22 votes
2 answers
496 views

How to call the C++ by the new LibraryFunctionDeclaration?

When we arrive at V13.1, we have a great LibraryFunctionDeclaration now, which can call C function in MMA as this article: ...
user avatar
  • 24.6k
1 vote
0 answers
41 views

Using FunctionCompile to emulate DistanceMatrix with my own DistanceFunction

I'd like to create a distance matrix with an expensive distance function. To explore how to do this for a simpler case, consider these three ways of creating a Euclidean distance matrix: Using a ...
user avatar
  • 2,647
6 votes
1 answer
185 views

FunctionCompiling lists of things

I have a compiled function that works on a list of some atomic type e.g. strings, but also want it to work on lists of others (e.g. integers, reals, symbols, etc). Moreover, nothing in the code has to ...
user avatar
  • 3,523
5 votes
3 answers
221 views

Implementing fast linear search for perfect vertical image alignment

After experimenting with image alignment aprroaches presented here and here and some other approaches involving ImageDistance and ...
user avatar
3 votes
1 answer
88 views

How do I use a FunctionCompile(d) function in FindMInimum

Suppose I would like to speed up the function in FindMinimum[function[variables],startingPoint] by compiling function I've constructed a minimal working example to describe what I would like to do. ...
user avatar
  • 2,647
11 votes
1 answer
291 views

Speediest Julia Set "By Hand"

While being aware of the built-in command, I would like to show my students how the Julia set is actually generated. The code I came up with is slow, even though I am quite happy with the picture it ...
user avatar
  • 313
1 vote
0 answers
58 views

FunctionCompile Type Errors

This function works uncompiled: Function[{n, m, k}, ParallelSum[ Length[Permutations[i]], {i, IntegerPartitions[m, {n}, Range[0, k]]} ]] but compiling with <...
user avatar
4 votes
0 answers
74 views

How to efficiently build a large sparse matrix and overloading a compiled function?

I would like to construct a large sparse matrix folding from rank-4 tensor given by the following: $\mathcal{L}_{1L}^{00}(i,j)=\mathcal{L}_{1L}^{00}(m_1,m_2;M_1,M_2)$ The indices of matrix $(i,j)$ are ...
user avatar
  • 445
0 votes
0 answers
102 views

How to calculate this summation numerically?

I want to calculate this summation numerically: $\sum_{n=1}^{10^{10}}\frac{1}{n^3\sin(n)^2}$ First I try NSum[1/(n^3 Sin[n]^2), {n, 1, 10^10}] however it gives a ...
user avatar
  • 463
14 votes
0 answers
354 views

FunctionCompile examples for Computer Vision

I'm looking for some good examples of FunctionCompile applied to image processing code since there doesn't seem to be anything on this in the documentation. So here's a first attempt at a hello world ...
user avatar
  • 30.6k
10 votes
1 answer
264 views

Using DataStructures in FunctionCompile

This is a follow up to this StackExchange question I am trying to do the equivalent of Select on a "FixedArray" data structure. Here is what I have tried so far: ...
user avatar
  • 2,647
11 votes
0 answers
210 views

How to use Bags in FunctionCompile?

I was reading this question and it wanted to know how to FunctionCompile this: ...
user avatar
  • 30.6k