next up previous contents
Next: Debugging Up: Packaging Previous: ``d3tensor'' and ``free_d3tensor''

``getallPsis''

void getallPsis(double ***Psi,double **E,
		int lmax, int *nmax,
		double *V,
		double r[], double dr[], int N)
Output:

Input:

Construct a routine of the above prototype which calls ``getPsi'' to generate all of the wave functions tex2html_wrap_inline375 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)
                    .
                    .




Tomas Arias
Fri Mar 3 11:23:54 EST 2000