diff options
author | Franz Zotter <fzotter@users.sourceforge.net> | 2009-01-14 10:58:32 +0000 |
---|---|---|
committer | Franz Zotter <fzotter@users.sourceforge.net> | 2009-01-14 10:58:32 +0000 |
commit | 92b9deaf8d7c2a96c3977e1204341d6b6feb1fc1 (patch) | |
tree | 6e17422343f2a63bba88422d02e5d06fdf8d7baf /src/mtx_sh/cmdline/sharmonics_cmd.c | |
parent | 96987170c95a18b779cd2bfc316d88d754db4b8e (diff) |
renamed [mtx_sh] to [mtx_spherical_harmonics].
svn path=/trunk/externals/iem/iemmatrix/; revision=10549
Diffstat (limited to 'src/mtx_sh/cmdline/sharmonics_cmd.c')
-rw-r--r-- | src/mtx_sh/cmdline/sharmonics_cmd.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/src/mtx_sh/cmdline/sharmonics_cmd.c b/src/mtx_sh/cmdline/sharmonics_cmd.c deleted file mode 100644 index 5b2f22a..0000000 --- a/src/mtx_sh/cmdline/sharmonics_cmd.c +++ /dev/null @@ -1,57 +0,0 @@ - -/* command line test for chebyshev12.c - * Franz Zotter, 2009, see ../LICENSE.txt */ - -#include <stdio.h> - -#include "sharmonics.h" - -int main (int argc, char *argv[]) { - int nmax, l, lc, n, m; - SHWorkSpace *ws=0; - double *ptr,*phi,*theta; - - if (argc <4) { - printf("sharmonics requires nmax as input argument followed by phi theta value pairs\n"); - return 0; - } - - nmax=atoi(argv[1]); - l=(argc-2)/2; - if ((phi=(double*)calloc(l,sizeof(double)))==0) { - printf("sharmonics could not allocate memory for %d phi-values\n",l); - return 0; - } - if ((theta=(double*)calloc(l,sizeof(double)))==0) { - printf("sharmonics could not allocate memory for %d theta-values\n",l); - free(phi); - return 0; - } - if ((ws=sharmonics_alloc(nmax,l))==0) { - printf("sharmonics could not allocate memory for n=%d\n and l=%d\n",nmax,l); - free(theta); - free(phi); - return 0; - } - for (n=0;n<l;n++) { - phi[n]=atof(argv[2*n+2]); - theta[n]=atof(argv[2*n+3]); - } - sharmonics(phi,theta,ws); - - ptr=ws->y; - for (lc=0;lc<l;lc++) { - printf("pt %d:\n",lc); - for (n=0;n<=nmax;n++) { - for (m=-n;m<=n;m++) { - printf("Y[%2d][%2d](%7.4f,%7.4f)=%7.4f\n",n,m,phi[lc],theta[lc],*ptr++); - } - } - } - sharmonics_free(ws); - free(phi); - free(theta); - return 1; -} - - |