[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gridding options

In article <onhf82y1wb.fsf@cow.physics.wisc.edu>,
craigmnet@cow.physics.wisc.edu wrote:

>"J.D. Smith" <jdsmith@astro.cornell.edu> writes:
>> tt=total(a[(((dy=((di=lindgen(((n=nx<ny)),nx+ny-1)))/n))*(nx gt ny?1:nx)+ $
>>               (nx gt ny?1:-1)*((dx=di mod n))*(nx-1))>0<(nx*ny-1)]* $
>>            (dy ge dx AND (dy-dx) lt nx>ny),1)

>Todd, did you compare the run time?

I did, (only after I read your post responding to someones post responding
to that...my news server seems to only get about 30% of the articles
posted here, and so I often don't see things until someone else quotes it
and I see it then) and the new one is faster, except that it dies at
arrays larger than 128x128, and starts giving incorrect values. It seems
like just a "short" integer problem, but heck if I can figure out where it
might be in there!!

The times are as follows (I'm not sure they mean anything for incorrect
results, but here they are anyway):

Array size      New (1 line)       Craig (2 line)
512x512         0.493              0.615
1024x1024       2.531              3.039
2048x2048       10.523             12.89