[Fwd: Mathlink formulas return different results]
- To: mathgroup at smc.vnet.net
- Subject: [mg34064] [Fwd: Mathlink formulas return different results]
- From: "Lawrence A. Walker Jr." <lwalker701 at earthlink.net>
- Date: Wed, 1 May 2002 08:00:35 -0400 (EDT)
- Organization: Morgan State University, COMSARE
- Sender: owner-wri-mathgroup at wolfram.com
Hi Mathgroup, I've fixed the problem I've been having with my Mathlink function returning different results everytime I execute the function in Mathematica. The problem was I had an extra MLPutRealList in one of the functions that was being called by the main function. Thanks for all your help. Lawrence ---- Original message ---- I have created a transistor modeling application that uses Mathlink to set up a link between by custom made functions and Mathematica. The problem I've been running into is that every time I execute a particular function (the C function linked to Mathematica via Mathlink) in the Mathematica session, I get three different results using the same input! I ran into a similar problem before. I fixed the problem by removing from the template file (*.tm) any definitions of functions that I was calling from the main function. For instance, let's say I have a C function called foo. This function calls another function goo. And I define both foo and goo in the template as Foo[] and Goo[]. This setup led to the aforementioned problem. When I removed goo/Goo definitions from the template (*.tm) the problem went away. I've read Todd Gayley's tutorial on Mathlink. This seems like this may be a common problem. Is there something special I should be doing to eliminate this problem? Does it have some to do with 'flushing packets'? Thanks, Lawrence -- Lawrence A. Walker Jr. http://www.kingshonor.com