Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Re: Asking questions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg58260] Re: Re: Asking questions
  • From: Andrzej Kozlowski <andrzej at akikoz.net>
  • Date: Sat, 25 Jun 2005 01:56:17 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 24 Jun 2005, at 16:28, Bharat Bhole wrote:

>
> 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. 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.
> Regards,
> Bharat.
>

I think you will need to use assignments to do this, in other words,  
I can't see how this cold be done in a purely functional way. But in  
a procedural way, here is an example. Suppose we run:

Do[u[i] = Prime[i], {i, 1, 10^8}]

which should take long enough for the demonstration. First evaluate  
the above and then choose Enter Subsession form Kernel/Evaluation  
menu. The evaluation  ought to be interrupted and you can check the  
values computed so far:


(Dialog) In[3]:=
u[22]

(Dialog) Out[3]=
79

etc.

(Dialog) In[5]:=
Length[DownValues[u]]

(Dialog) Out[5]=
206267

will tell you the number of values mathematica has computed. When you  
want to continue with the evaluation just choose Exit Subsession form  
the same menu.

Andrzej Kozlowski

Chiba, Japan


  • Prev by Date: Re: Re: Asking questions
  • Next by Date: Re: General 3-state stochastic matrix (again)
  • Previous by thread: Re: Asking questions
  • Next by thread: Re: Re: Asking questions