MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Using rules with MathLink

  • To: mathgroup at
  • Subject: [mg29261] Re: Using rules with MathLink
  • From: Jens-Peer Kuska <kuska at>
  • Date: Sat, 9 Jun 2001 03:08:49 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <9fq226$qe1$>
  • Sender: owner-wri-mathgroup at


general you can't.

The normal way is to write a Mathematica
function that evaluate the options and call
a raw C-function.

     prec = Precision /. {opts} /. Options[MyFunction];
     If[!IntegerQ[prec], prec=16];

If you like the more complicated way, you can
declare the last argument of you C-function
as manual, and read the rules with MLGetFunction()...
and friends but than you need clever recursive
C-function that look for types, symbols ... 

The frist version is much easier.


Mario Drobics wrote:
> How can I use rule parameters like
> func[params, option->value]
> to set options within my MathLink C++ program
> (e.g. to set the precision of a numeric computation)?
> -mario drobics-

  • Prev by Date: Re: Fourth degree polynomial
  • Next by Date: Re: Replacing 1 to many in a list
  • Previous by thread: Using rules with MathLink
  • Next by thread: Random Function in Mathematica