MathGroup Archive 2006

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

Search the Archive

Reading Results from J/Link

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65212] Reading Results from J/Link
  • From: Isam Haddad <i.haddad at tu-bs.de>
  • Date: Sat, 18 Mar 2006 06:40:34 -0500 (EST)
  • Organization: TU Braunschweig, Germany
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

I'm doing first steps with J/Link and have problems to understand how to 
treat results coming from the Mathematica-kernel to Java.

Lets say I have an *.m-File looking like this

   x[a_,b_]:=( {b*a, b} );

and I call it from Java by executing

   Expr e = new Expr( new int[]{1,2,3} );
   Expr p = new Expr( new Expr(Expr.SYMBOL, "x"),
                      new Expr[]{ e, new Expr(2) } );

   ml.evaluate(p);
   ml.waitForAnswer();

The Mathematica-result should be { {2, 4, 6}, 2 }.

What I don't understand how to translate this result to Java. 
Additionally ml.getType() returns 70. But this code is none of the 
declared ones in the MathLink-interface.

Can anybody help me?

Thanks in advance
Isam


  • Prev by Date: Combined Graphics3D with Separate PlotRange?
  • Next by Date: Size of .mx files
  • Previous by thread: Re: Combined Graphics3D with Separate PlotRange?
  • Next by thread: Re: Reading Results from J/Link