Group Abstract Group Abstract

Message Boards Message Boards

0
|
10.7K Views
|
4 Replies
|
1 Total Like
View groups...
Share
Share this post:

LibraryFunctionLoad with variable number of arguments

Posted 11 years ago
POSTED BY: Mirek M
4 Replies
Posted 8 years ago
POSTED BY: Mirek M

If you want a variable number of arguments of the same (numerical) type, use an array instead. I would not call it a "workaround". I'd call it the proper way to do it.

If their types are not the same, or if you have a non-numeric type (e.g. string), you can use MathLink to pass arguments to your library function.

POSTED BY: Szabolcs Horvát
Posted 11 years ago
POSTED BY: Mirek M

Hi,

Not sure whether it answers your question, but if you need tensor-like arguments, then here is how Mathematica does it:

F = Compile[{{n, _Integer,1}},n^2, CompilationTarget -> "C" ];
ExportString[F,"C"]

I.M.

POSTED BY: Ivan Morozov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard