Re: Re: Asking questions
- To: mathgroup at smc.vnet.net
- Subject: [mg58279] Re: Re: Asking questions
- From: stephen layland <layland at wolfram.com>
- Date: Sat, 25 Jun 2005 01:56:41 -0400 (EDT)
- Mail-followup-to: Bharat Bhole <bbhole@gmail.com>, mathgroup@smc.vnet.net
- References: <200506230642.CAA14625@smc.vnet.net> <200506240728.DAA00319@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
and thus spake Bharat Bhole [2005.06.24 @ 02:30]:
>
> Suppose I am running a code
> MapThread[func,{Table[d,{d,1,10}]] which takes very long to evaluate for the
> entire list. Mathematica gives me the output ONLY after 'func[d]' has been
> evaluated for all d from 1 to 10.
That's because the kernel is only doing what you tell it to do. The
matheamtica kernel is single threaded. You will only 'get a result'
when the entire function has been evaluated.
> Is it possible to make Mathematica give
> the output as it is evaluating after each d. For example, is it possible to
> make it give output after it has evaluated func[1], then func[2] and so on.
> Thank you for your help.
You can get the kernel to Print[] the results as it maps like:
((Print[#]; #)&@f[#]) & /@ Range[10]
but this still won't allow you to use the results in the kernel until
the entire Map call has ended.
(unless, of course, you use another mathematica kernel).
--
/*------------------------------*\
| stephen layland |
| Documentation Programmer |
| http://members.wri.com/layland |
\*------------------------------*/
- References:
- Re: Asking questions
- From: Bharat Bhole <bbhole@gmail.com>
- Re: Asking questions