Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #5142
| From | Roman <rschmied@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: passing Indeterminate and Infinity to C via MathLink |
| Date | 2011-09-22 11:33 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j5f6de$q90$1@smc.vnet.net> (permalink) |
| References | <j4vamb$dah$1@smc.vnet.net> <j59os9$pc$1@smc.vnet.net> <j5cb36$cs6$1@smc.vnet.net> |
On Sep 21, 11:34 am, David Bailey <d...@removedbailey.co.uk> wrote: > On 20/09/2011 11:11, Roman wrote: > > > Dear John, > > thanks a lot for your detailed explanations. I believe that your > > suggestion of using "magic" floats for representing Indeterminate and > > Infinity is the most viable possibility; in this way I can send packed > > arrays to C without a hitch. > > The inefficiencies that you mention in the MathLink protocol, even > > using packed arrays, are quite noticeable though. Much experimentation > > and comparison to the use of Compile[] is required to find the fastest > > way of getting things done. > > Best regards, > > Roman > > One alternative to designating a magic float (which then has to be > searched for in the external program, and which could be generated by an > unfortunate calculation) is to replace the NaN values with 0.0, and also > send a small (packed integer) index array locating the NaN's. If there > are no Nan's, the list would be empty. > > David Baileyhttp://www.dbaileyconsultancy.co.uk Brilliant! Thanks David.
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: passing Indeterminate and Infinity to C via MathLink John Fultz <jfultz@wolfram.com> - 2011-09-16 11:07 +0000
Re: passing Indeterminate and Infinity to C via MathLink Roman <rschmied@gmail.com> - 2011-09-20 10:11 +0000
Re: passing Indeterminate and Infinity to C via MathLink David Bailey <dave@removedbailey.co.uk> - 2011-09-21 09:34 +0000
Re: passing Indeterminate and Infinity to C via MathLink Roman <rschmied@gmail.com> - 2011-09-22 11:33 +0000
csiph-web