void getallPsis(double ***Psi,double **E, int lmax, int *nmax, double *V, double r[], double dr[], int N)Output:
- Psi[l][n][k]: values of
(properly normalized) for wave functions with angular momentum
and with n nodes
Input:
- E[l][n]: matrix of energies of states of angular momentum l and with n=0..nmax[l] nodes
- lmax: maximum angular momentum to consider (l=0..lmax)
- nmax[l]: maximum number of nodes sought for angular momentum l
- V[]: potential
- r[], dr[], N: standard grid information
Construct a routine of the above prototype which calls ``getPsi'' to
generate all of the wave functions
for l=0..lmax and,
for each l, n=0..nmax[l]. A suitable code fragment is
.
.
for (l=0; l<=lmax; l++)
for (n=0; n<=nmax[l]; n++)
getPsi(Psi[l][n],E[l][n],l,V,r,dr,N);
.
.
Note that the object Psi[l][n] is, as getPsi expects, actually a
pointer to the first storage location among the elements
Psi[l][n][0..N]. (Note also that your ``getallPsis'' routine will be
rather short.)
If you are working in Fortran, then you should index your arrays in the reverse order, Psi(k,n,l), so that then your code fragment will appear as
.
.
do l=0,lmax
do n=0,nmax(l)
call getPsi(Psi(1,n,l),E(n,l),l,V,r,dr,N)
.
.