Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #3378 > unrolled thread
| Started by | Patrick Scheibe <pscheibe@trm.uni-leipzig.de> |
|---|---|
| First post | 2011-06-29 21:41 +0000 |
| Last post | 2011-06-29 21:41 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: C code generation Patrick Scheibe <pscheibe@trm.uni-leipzig.de> - 2011-06-29 21:41 +0000
| From | Patrick Scheibe <pscheibe@trm.uni-leipzig.de> |
|---|---|
| Date | 2011-06-29 21:41 +0000 |
| Subject | Re: C code generation |
| Message-ID | <iug676$9im$1@smc.vnet.net> |
Hi,
I assume you hope for a pure C implementation of those functions. This won't work.
If you look on what Mathematica generates for you:
<< CCodeGenerator`
fc = Compile[{{p, _Integer}, {array, _Integer, 1}},
Position[array, p]
];
CCodeStringGenerate[fc, "cPosition"]
you see, that there is some line
funStructCompile = libData->compileLibraryFunctions;
FP0 = funStructCompile->getFunctionCallPointer("Position");
and this function pointer is then called with your parameters.
Cheers
Patrick
On Jun 28, 2011, at 1:55 PM, Shane Di Dona wrote:
> Is there a way to make Mathematica generate C code for functions such as Position[] and MemberQ[]? I am writing a program for CUDAlink and would like not to have to reinvent the wheel (in C) on these somewhat basic functions.
>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web