Compiled Functions and Mathgroup Archive

• To: mathgroup at smc.vnet.net
• Subject: [mg8886] Compiled Functions and Mathgroup Archive
• From: Peter Jay Salzman <psalzman at landau.ucdavis.edu>
• Date: Tue, 30 Sep 1997 20:16:55 -0400
• Sender: owner-wri-mathgroup at wolfram.com

```Hi Mathgroup

Three questions:

1
-
I'm writing a numerical Schroedinger equation solver and stumbled on the
'Compiled' function.  The MMA book mentioned that sometimes functions run
faster when you don't compile them.

I know that people must have asked this question before, but when should
I use Compile to generate faster code?  My program obviously involes a
tremendous number of repetitive arithmetic operations, so it seems like I
should compile things like

wavefunction[r_] = (alpha/Pi)^.75  E^(-.5 alpha r^2)

or

norm[wave] = Sqrt[ (4 Pi (dr)^3 Sum[ (Abs[ wave[[i+1]] ]*i)^2,
{i, 0, arsize-1} ]

where arsize is the gridsize and will be on the order of thousands.

2
-
Also, is there an archive of Mathgroup questions so I can look up
questions like this in the future?  It's only useful if it's searchable.

3
-
How can I have MMA print something like:
The gridsize is arsize
but replace arsize with the contents of the variable arsize

4
-
I print a bunch of parameters for the current 'run', and would like to
prompt myself "If this is OK, press enter to continue but if it's not OK,
press any other key to end the program".

How can I do this?

Much thanks!
Peter

--
Never criticize a man till you've walked a mile in his shoes.  That way,
you'll be a mile away from him and have his shoes as well.
-=><=-+-+-=><=-+-+-=><=-+-+-=><=-+-+-=><=-+-+-=><=-+-+-=><=-+-+-=><=-+-+-=><=-
Do you hate spam? Join the Coalition Against Unsolicited Commercial Email
(CAUCE) at http://www.cauce.org. Actions speak louder than words. Join Today!
I BOYCOTT ANY COMPANY THAT USES MASS ADVERTISING ON THE INTERNET

```

• Prev by Date: Comparison of Mathematica on Various Computers
• Next by Date: Re: Turning the elements of a list into the arguments of a function.
• Previous by thread: Comparison of Mathematica on Various Computers
• Next by thread: Re: Division symbol in Graphical Plots