/* command line test for legendre_a.c * Franz Zotter, 2009, see ../LICENSE.txt */ #include #include "legendre_a.h" int main (int argc, char *argv[]) { int nmax, l, lc, n, m; LegendreWorkSpace *wl=0; double *ptr,*theta; if (argc <3) { printf("legendre_a requires nmax as input argument followed by theta values\n"); return 0; } nmax=atoi(argv[1]); l=argc-2; if ((theta=(double*)calloc(l,sizeof(double)))==0) { printf("legendre_a could not allocate memory for %d theta-values\n",l); return 0; } if ((wl=legendre_a_alloc(nmax,l))==0) { printf("legendre_a could not allocate memory for n=%d\n and l=%d\n",nmax,l); free(theta); return 0; } for (n=0;np; for (lc=0;lc