Revision: 10549 http://pure-data.svn.sourceforge.net/pure-data/?rev=10549&view=rev Author: fzotter Date: 2009-01-14 10:58:32 +0000 (Wed, 14 Jan 2009)
Log Message: ----------- renamed [mtx_sh] to [mtx_spherical_harmonics].
Modified Paths: -------------- trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/chebyshev12.c trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/config.log trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/legendre_a.c trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/sharmonics.c trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/sharmonics_normalization.c
Added Paths: ----------- trunk/externals/iem/iemmatrix/doc/mtx_spherical_harmonics-help.pd trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/ trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics.c
Removed Paths: ------------- trunk/externals/iem/iemmatrix/doc/mtx_sh-help.pd trunk/externals/iem/iemmatrix/src/mtx_sh/ trunk/externals/iem/iemmatrix/src/mtx_sh.c
Deleted: trunk/externals/iem/iemmatrix/doc/mtx_sh-help.pd =================================================================== --- trunk/externals/iem/iemmatrix/doc/mtx_sh-help.pd 2009-01-14 02:46:47 UTC (rev 10548) +++ trunk/externals/iem/iemmatrix/doc/mtx_sh-help.pd 2009-01-14 10:58:32 UTC (rev 10549) @@ -1,27 +0,0 @@ -#N canvas 61 39 921 503 10; -#X msg 96 97 matrix 2 1 0 0; -#X obj 184 163 mtx_rand; -#X msg 187 141 2 10; -#X obj 96 197 mtx_print; -#X obj 96 157 mtx_sh 1; -#X text 95 54 [mtx_sh] spherical harmonics evaluated at a set of points -given in phi and theta coordinates.; -#X text 306 117 [mtx_sh] requires a numerical creation argument nmax -specifyiing the maximum order 0<=n<=nmax.; -#X text 305 160 for an L points 2xL input matrix , [mtx_sh] evaluates -the (nmax+2)^2 spherical harmonics at L points and delivers an Lx(nmax+2)^2 -output matrix.; -#X text 527 347 Franz Zotter , 2009; -#X text 150 226 for -n<=m<=n:; -#X text 188 258 Y_n^m(phi , theta) = N_n^m * sin(m*phi) * P_n^m(cos(theta)) -; -#X text 188 242 Y_n^m(phi , theta) = N_n^m * cos(m*phi) * P_n^m(cos(theta)) -; -#X text 641 241 for m>=0; -#X text 640 257 for m< 0; -#X text 147 291 The order of the harmonics in the output columns is -specified by the linear index k=n^2+n+m+1.; -#X connect 0 0 4 0; -#X connect 1 0 4 0; -#X connect 2 0 1 0; -#X connect 4 0 3 0;
Copied: trunk/externals/iem/iemmatrix/doc/mtx_spherical_harmonics-help.pd (from rev 10548, trunk/externals/iem/iemmatrix/doc/mtx_sh-help.pd) =================================================================== --- trunk/externals/iem/iemmatrix/doc/mtx_spherical_harmonics-help.pd (rev 0) +++ trunk/externals/iem/iemmatrix/doc/mtx_spherical_harmonics-help.pd 2009-01-14 10:58:32 UTC (rev 10549) @@ -0,0 +1,29 @@ +#N canvas 61 39 921 503 10; +#X msg 96 97 matrix 2 1 0 0; +#X obj 206 132 mtx_rand; +#X msg 209 110 2 10; +#X obj 96 197 mtx_print; +#X text 537 377 Franz Zotter , 2009; +#X text 150 226 for -n<=m<=n:; +#X text 188 258 Y_n^m(phi , theta) = N_n^m * sin(m*phi) * P_n^m(cos(theta)) +; +#X text 188 242 Y_n^m(phi , theta) = N_n^m * cos(m*phi) * P_n^m(cos(theta)) +; +#X text 641 241 for m>=0; +#X text 640 257 for m< 0; +#X text 147 291 The order of the harmonics in the output columns is +specified by the linear index k=n^2+n+m+1.; +#X text 95 54 [mtx_spherical_harmonics] spherical harmonics evaluated +at a set of points given in phi and theta coordinates.; +#X text 146 328 [mtx_spherical_harmonics] uses fully normalized Y_n^m +with Condon-Shortley phase; +#X text 305 160 for an L points 2xL input matrix , [mtx_spherical_harmonics] +evaluates the (nmax+2)^2 spherical harmonics at L points and delivers +an Lx(nmax+2)^2 output matrix.; +#X text 309 118 [mtx_spherical_harmonics] requires a numerical creation +argument <nmax> specifyiing the maximum order 0<=n<=nmax.; +#X obj 96 157 mtx_spherical_harmonics 2; +#X connect 0 0 15 0; +#X connect 1 0 15 0; +#X connect 2 0 1 0; +#X connect 15 0 3 0;
Property changes on: trunk/externals/iem/iemmatrix/doc/mtx_spherical_harmonics-help.pd ___________________________________________________________________ Added: svn:mergeinfo +
Deleted: trunk/externals/iem/iemmatrix/src/mtx_sh.c =================================================================== --- trunk/externals/iem/iemmatrix/src/mtx_sh.c 2009-01-14 02:46:47 UTC (rev 10548) +++ trunk/externals/iem/iemmatrix/src/mtx_sh.c 2009-01-14 10:58:32 UTC (rev 10549) @@ -1,146 +0,0 @@ -/* - * iemmatrix - * - * objects for manipulating simple matrices - * mostly refering to matlab/octave matrix functions - * this functions depends on the GNU scientific library - * - * Copyright (c) 2009, Franz Zotter - * IEM, Graz, Austria - * - * For information on usage and redistribution, and for a DISCLAIMER OF ALL - * WARRANTIES, see the file, "LICENSE.txt," in this distribution. - * - */ - -#include "iemmatrix.h" -#include <stdlib.h> -#include "mtx_sh/sharmonics.c" -#include "mtx_sh/legendre_a.c" -#include "mtx_sh/chebyshev12.c" -#include "mtx_sh/sharmonics_normalization.c" - -static t_class *mtx_sh_class; - -typedef struct _MTXSh_ MTXSh; -struct _MTXSh_ -{ - t_object x_obj; - t_outlet *list_sh_out; - t_atom *list_sh; - double *phi; - double *theta; - SHWorkSpace *ws; - size_t nmax; - size_t l; -}; - -static void allocMTXdata (MTXSh *x) -{ - x->phi=(double*)calloc(x->l,sizeof(double)); - x->theta=(double*)calloc(x->l,sizeof(double)); - x->ws=sharmonics_alloc(x->nmax,x->l); - x->list_sh=(t_atom*)calloc(x->l*(x->nmax+1)*(x->nmax+1)+2,sizeof(t_atom)); -} - -static void deleteMTXShdata (MTXSh *x) -{ - if (x->phi!=0) - free(x->phi); - if (x->theta!=0) - free(x->theta); - if (x->list_sh!=0) - free(x->list_sh); - sharmonics_free(x->ws); - x->ws=0; - x->list_sh=0; - x->theta=0; - x->phi=0; -} - -static void *newMTXSh (t_symbol *s, int argc, t_atom *argv) -{ - int nmax; - MTXSh *x = (MTXSh *) pd_new (mtx_sh_class); - x->list_sh_out = outlet_new (&x->x_obj, gensym("matrix")); - x->list_sh = 0; - x->phi = 0; - x->theta = 0; - x->ws = 0; - x->l=0; - nmax=(int) atom_getfloat(argv); - post("mtx_sh order %d",nmax); - if (nmax<0) - nmax=0; - x->nmax=nmax; - - return ((void *) x); -} - -static void mTXShBang (MTXSh *x) -{ - if (x->list_sh!=0) { - outlet_anything(x->list_sh_out, gensym("matrix"), x->l*(x->nmax+1)*(x->nmax+1)+2, x->list_sh); - } -} - -static void mTXShMatrix (MTXSh *x, t_symbol *s, - int argc, t_atom *argv) -{ - int rows = atom_getint (argv++); - int columns = atom_getint (argv++); - int size = rows * columns; - int in_size = argc-2; - int n; - - - /* size check */ - if (!size) - post("mtx_sh: invalid dimensions"); - else if (in_size<size) - post("mtx_sh: sparse matrix not yet supported: use "mtx_check""); - else if ((rows!=2)||(columns<1)) - post("mtx_sh: 2 X L matrix expected with phi and theta vector, but got more rows/no entries"); - else { - if (x->l!=columns) { - deleteMTXShdata(x); - x->l=columns; - allocMTXdata(x); - } - - for (n=0;n<x->l;n++) { - x->phi[n]=(double) atom_getfloat(argv+n); - x->theta[n]=(double) atom_getfloat(argv+columns); - } - - if (x->ws!=0) { - sharmonics(x->phi, x->theta, x->ws); - in_size=x->l*(x->nmax+1)*(x->nmax+1); - SETFLOAT(x->list_sh,(float)x->l); - SETFLOAT(x->list_sh+1,(float)(x->nmax+1)*(x->nmax+1)); - for (n=0;n<in_size; n++) - SETFLOAT(x->list_sh+n+2,(float)x->ws->y[n]); - mTXShBang(x); - } - else - post("mtx_sh: memory error, no operation"); - } - - -} - -void mtx_sh_setup (void) -{ - mtx_sh_class = class_new - (gensym("mtx_sh"), - (t_newmethod) newMTXSh, - (t_method) deleteMTXShdata, - sizeof (MTXSh), - CLASS_DEFAULT, A_GIMME, 0); - class_addbang (mtx_sh_class, (t_method) mTXShBang); - class_addmethod (mtx_sh_class, (t_method) mTXShMatrix, gensym("matrix"), A_GIMME,0); -} - -void iemtx_sh_setup(void){ - mtx_sh_setup(); -}
Property changes on: trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics ___________________________________________________________________ Added: svn:mergeinfo +
Modified: trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/chebyshev12.c =================================================================== --- trunk/externals/iem/iemmatrix/src/mtx_sh/chebyshev12.c 2009-01-14 02:46:47 UTC (rev 10548) +++ trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/chebyshev12.c 2009-01-14 10:58:32 UTC (rev 10549) @@ -13,7 +13,7 @@ "LICENSE.txt" */
-#include "mtx_sh/chebyshev12.h" +#include "mtx_spherical_harmonics/chebyshev12.h"
Cheby12WorkSpace *chebyshev12_alloc(const size_t nmax, const size_t l) { Cheby12WorkSpace *wc;
Modified: trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/config.log =================================================================== --- trunk/externals/iem/iemmatrix/src/mtx_sh/config.log 2009-01-14 02:46:47 UTC (rev 10548) +++ trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/config.log 2009-01-14 10:58:32 UTC (rev 10549) @@ -231,8 +231,7 @@ on gamelan
config.status:620: creating Makefile -config.status:620: creating test/Makefile -config.status:811: executing depfiles commands +config.status:606: error: cannot find input file: test/Makefile.in
## ---------------- ## ## Cache variables. ## @@ -397,130 +396,4 @@ #define HAVE_MALLOC 1 #define HAVE_POW 1
-configure: exit 0 - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by sh config.status 0.1, which was -generated by GNU Autoconf 2.61. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status Makefile depfiles - -on gamelan - -config.status:620: creating Makefile -config.status:811: executing depfiles commands - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by sh config.status 0.1, which was -generated by GNU Autoconf 2.61. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status Makefile depfiles - -on gamelan - -config.status:620: creating Makefile -config.status:811: executing depfiles commands - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by sh config.status 0.1, which was -generated by GNU Autoconf 2.61. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status test/Makefile depfiles - -on gamelan - -config.status:620: creating test/Makefile -config.status:811: executing depfiles commands - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by sh config.status 0.1, which was -generated by GNU Autoconf 2.61. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status test/Makefile depfiles - -on gamelan - -config.status:620: creating test/Makefile -config.status:811: executing depfiles commands - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by sh config.status 0.1, which was -generated by GNU Autoconf 2.61. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status test/Makefile depfiles - -on gamelan - -config.status:620: creating test/Makefile -config.status:811: executing depfiles commands - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by sh config.status 0.1, which was -generated by GNU Autoconf 2.61. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status Makefile depfiles - -on gamelan - -config.status:620: creating Makefile -config.status:811: executing depfiles commands - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by sh config.status 0.1, which was -generated by GNU Autoconf 2.61. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status test/Makefile depfiles - -on gamelan - -config.status:620: creating test/Makefile -config.status:811: executing depfiles commands +configure: exit 1
Modified: trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/legendre_a.c =================================================================== --- trunk/externals/iem/iemmatrix/src/mtx_sh/legendre_a.c 2009-01-14 02:46:47 UTC (rev 10548) +++ trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/legendre_a.c 2009-01-14 10:58:32 UTC (rev 10549) @@ -14,7 +14,7 @@
*/
-#include "mtx_sh/legendre_a.h" +#include "mtx_spherical_harmonics/legendre_a.h"
static void legendre_first_recurrence (double *sintheta, LegendreWorkSpace *wl) { int n,l,l0;
Modified: trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/sharmonics.c =================================================================== --- trunk/externals/iem/iemmatrix/src/mtx_sh/sharmonics.c 2009-01-14 02:46:47 UTC (rev 10548) +++ trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/sharmonics.c 2009-01-14 10:58:32 UTC (rev 10549) @@ -12,7 +12,7 @@ * "LICENSE.txt" */
-#include "mtx_sh/sharmonics.h" +#include "mtx_spherical_harmonics/sharmonics.h"
// HELPER ROUTINES
Modified: trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/sharmonics_normalization.c =================================================================== --- trunk/externals/iem/iemmatrix/src/mtx_sh/sharmonics_normalization.c 2009-01-14 02:46:47 UTC (rev 10548) +++ trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics/sharmonics_normalization.c 2009-01-14 10:58:32 UTC (rev 10549) @@ -12,7 +12,7 @@ * "LICENSE.txt" */
-#include "mtx_sh/sharmonics_normalization.h" +#include "mtx_spherical_harmonics/sharmonics_normalization.h"
SHNorml *sharmonics_normalization_new (const size_t nmax) { SHNorml *wn;
Copied: trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics.c (from rev 10548, trunk/externals/iem/iemmatrix/src/mtx_sh.c) =================================================================== --- trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics.c (rev 0) +++ trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics.c 2009-01-14 10:58:32 UTC (rev 10549) @@ -0,0 +1,146 @@ +/* + * iemmatrix + * + * objects for manipulating simple matrices + * mostly refering to matlab/octave matrix functions + * this functions depends on the GNU scientific library + * + * Copyright (c) 2009, Franz Zotter + * IEM, Graz, Austria + * + * For information on usage and redistribution, and for a DISCLAIMER OF ALL + * WARRANTIES, see the file, "LICENSE.txt," in this distribution. + * + */ + +#include "iemmatrix.h" +#include <stdlib.h> +#include "mtx_spherical_harmonics/sharmonics.c" +#include "mtx_spherical_harmonics/legendre_a.c" +#include "mtx_spherical_harmonics/chebyshev12.c" +#include "mtx_spherical_harmonics/sharmonics_normalization.c" + +static t_class *mtx_spherical_harmonics_class; + +typedef struct _MTXSh_ MTXSh; +struct _MTXSh_ +{ + t_object x_obj; + t_outlet *list_sh_out; + t_atom *list_sh; + double *phi; + double *theta; + SHWorkSpace *ws; + size_t nmax; + size_t l; +}; + +static void allocMTXdata (MTXSh *x) +{ + x->phi=(double*)calloc(x->l,sizeof(double)); + x->theta=(double*)calloc(x->l,sizeof(double)); + x->ws=sharmonics_alloc(x->nmax,x->l); + x->list_sh=(t_atom*)calloc(x->l*(x->nmax+1)*(x->nmax+1)+2,sizeof(t_atom)); +} + +static void deleteMTXShdata (MTXSh *x) +{ + if (x->phi!=0) + free(x->phi); + if (x->theta!=0) + free(x->theta); + if (x->list_sh!=0) + free(x->list_sh); + sharmonics_free(x->ws); + x->ws=0; + x->list_sh=0; + x->theta=0; + x->phi=0; +} + +static void *newMTXSh (t_symbol *s, int argc, t_atom *argv) +{ + int nmax; + MTXSh *x = (MTXSh *) pd_new (mtx_spherical_harmonics_class); + x->list_sh_out = outlet_new (&x->x_obj, gensym("matrix")); + x->list_sh = 0; + x->phi = 0; + x->theta = 0; + x->ws = 0; + x->l=0; + nmax=(int) atom_getfloat(argv); + post("mtx_spherical_harmonics order %d",nmax); + if (nmax<0) + nmax=0; + x->nmax=nmax; + + return ((void *) x); +} + +static void mTXShBang (MTXSh *x) +{ + if (x->list_sh!=0) { + outlet_anything(x->list_sh_out, gensym("matrix"), x->l*(x->nmax+1)*(x->nmax+1)+2, x->list_sh); + } +} + +static void mTXShMatrix (MTXSh *x, t_symbol *s, + int argc, t_atom *argv) +{ + int rows = atom_getint (argv++); + int columns = atom_getint (argv++); + int size = rows * columns; + int in_size = argc-2; + int n; + + + /* size check */ + if (!size) + post("mtx_spherical_harmonics: invalid dimensions"); + else if (in_size<size) + post("mtx_spherical_harmonics: sparse matrix not yet supported: use "mtx_check""); + else if ((rows!=2)||(columns<1)) + post("mtx_spherical_harmonics: 2 X L matrix expected with phi and theta vector, but got more rows/no entries"); + else { + if (x->l!=columns) { + deleteMTXShdata(x); + x->l=columns; + allocMTXdata(x); + } + + for (n=0;n<x->l;n++) { + x->phi[n]=(double) atom_getfloat(argv+n); + x->theta[n]=(double) atom_getfloat(argv+columns); + } + + if (x->ws!=0) { + sharmonics(x->phi, x->theta, x->ws); + in_size=x->l*(x->nmax+1)*(x->nmax+1); + SETFLOAT(x->list_sh,(float)x->l); + SETFLOAT(x->list_sh+1,(float)(x->nmax+1)*(x->nmax+1)); + for (n=0;n<in_size; n++) + SETFLOAT(x->list_sh+n+2,(float)x->ws->y[n]); + mTXShBang(x); + } + else + post("mtx_spherical_harmonics: memory error, no operation"); + } + + +} + +void mtx_spherical_harmonics_setup (void) +{ + mtx_spherical_harmonics_class = class_new + (gensym("mtx_spherical_harmonics"), + (t_newmethod) newMTXSh, + (t_method) deleteMTXShdata, + sizeof (MTXSh), + CLASS_DEFAULT, A_GIMME, 0); + class_addbang (mtx_spherical_harmonics_class, (t_method) mTXShBang); + class_addmethod (mtx_spherical_harmonics_class, (t_method) mTXShMatrix, gensym("matrix"), A_GIMME,0); +} + +void iemtx_spherical_harmonics_setup(void){ + mtx_spherical_harmonics_setup(); +}
Property changes on: trunk/externals/iem/iemmatrix/src/mtx_spherical_harmonics.c ___________________________________________________________________ Added: svn:mergeinfo +
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.