comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » need help turning this loop into an array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
need help turning this loop into an array [message #71762] Thu, 22 July 2010 11:51
REAL LIDAR GROUP is currently offline  REAL LIDAR GROUP
Messages: 1
Registered: July 2010
Junior Member
I have an old piece of code i am trying to optimize. It has been
taken it down to this current state of affairs

I would like to turn the last for loop into some kind of array
operation.

Unfortunately my brain cant seem to come up with the solution




pro splin2,x1a,x2a,ya,y2a,m,n,x1,x2,y
;+
; splin2
;
; Given X1A, X2A, YA, M, N as described in SPLIE2.PRO and Y2A as
produced by
; that routine, and given a desired interpolating point X1, X2, this
routine
; returns an interpolated function value Y by bicubic spline
interpolation.
;
; SOURCE:
; Numerical Recipes, 1986. (page 101)
;
; CALLING SEQUENCE:
; splin2,x1a,x2a,ya,y2a,m,n,x1,x2,y
;
; INPUTS:
; x1a - independent variable vector (first dimension)
; x2a - independent variable vector (second dimension)
; ya - dependent variable array
; y2a - second derivative array (as produced by SPLIE2.PRO)
; m - length of first dimension
; n - length of second dimension
; x1 - first coordinate of interpolating point
; x2 - second coordinate of interpolating point
;
; OUTPUTS:
; y - bicubic spline interpolated function value
;
; HISTORY:
; converted to IDL, D. Neill, October, 1991
;-
;ytmp = fltarr(n)
;y2tmp = fltarr(n)
yytmp = fltarr(n)



for j=0,m-1 do begin

splint,x2a,ya[j,*],y2a[j,*],n,x2,yyt
yytmp(j)=yyt

endfor

; Construct the one-dimensional column spline and evaluate it.
;
;print,y2tmp, "ytmp before"
splinf,x1a,yytmp,m,1.e30,1.e30,y2tmp
;print, "y2tmp is = : " , y2tmp
splint,x1a,yytmp,y2tmp,m,x1,y
;print, " y is = : ", y
;
return
end ; splin2.pro
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Stop and return to caller
Next Topic: eliminating "banner"

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:57:18 PDT 2025

Total time taken to generate the page: 0.00523 seconds