Performance improvement needed - Help.
- To: mathgroup at smc.vnet.net
- Subject: [mg63552] Performance improvement needed - Help.
- From: "Tonybony" <aneves at gmail.com>
- Date: Thu, 5 Jan 2006 03:12:19 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hello, I am trying to improve the performance of a bottle neck operation. I've used functional programming and read about Packed Arrays. My current operation is: Efunc[k_, x_, y_, z_] := Radialf[k, VNmax, x, y,z].Map[(MMatrix[[# - Nmin + 1]].SphericalHarmonicY[#, Range[-#, #],Theta[x, y, z], Phi[x, y]]) &, VNmax, {1}]; EMatrix= Apply[Efunc[k, #1, #2, 0.0] &, Grid, {2}]; Where I defined, GridX = Range[Xini, Xfin, Xinc]; Grid = Outer[List, GridX, GridX]; VNmax = Range[Nmin, Nmax]; GridG = Table[{n, m}, {n, Nmin, Nmax}, {m, -n, n}]; Radial[k_, n_, x_, y_, z_] := BesselJ[n,k Sqrt[x^2+y^2+z^2]]; MMatrix= Apply[(Exp[-#2 fio] MAmpl[[#1 - Nmin + 1, Abs[#2] + 1]] MI1[[#1 - Nmin + 1, Abs[#2] + 1]] Cosfio) &, GridG, {2}]; I have tried the command, GridG = Developer`ToPackedArray[Table[{n, m}, {n, Nmin, Nmax}, {m, -n, n}]]; To see if I could build a packed array so that I could better performance, but didn't succeed. Maybe I am creating a wrong array, but I don't know of any alternative. For each element of GridG I have a pair of point (x,y) that I pass along a set of function for calculations. Is their an efficient way of doing this? Thanks, Antonio
- Follow-Ups:
- Re: Performance improvement needed - Help.
- From: Pratik Desai <pdesai1@umbc.edu>
- Re: Performance improvement needed - Help.