Changeset 118 for trunk/SRC/Interpolation/spl_incr.pro
- Timestamp:
- 06/27/06 17:47:06 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Interpolation/spl_incr.pro
- Property svn:keywords set to Id
r114 r118 12 12 ; in a way that interpolated values are also monotonically increasing. 13 13 ; 14 ; @examples y2 = spl_incr(x, y, x2) 15 ; 16 ; @param x1 {in}{required} An n-element (at least 2) input vector that specifies the 17 ; tabulate points in a strict ascending order. 18 ; 19 ; @param y1 {in}{required} f(x) = y. An n-element input vector that specifies the values 14 ; @examples 15 ; IDL> y2 = spl_incr(x, y, x2) 16 ; 17 ; @param x1 {in}{required} 18 ; An n-element (at least 2) input vector that specifies the tabulate points in 19 ; a strict ascending order. 20 ; 21 ; @param y1 {in}{required} 22 ; f(x) = y. An n-element input vector that specifies the values 20 23 ; of the tabulated function F(Xi) corresponding to Xi. As f is 21 24 ; supposed to be monotonically increasing, y values must be 22 25 ; monotonically increasing. y can have equal consecutive values. 23 26 ; 24 ; @param x2 {in}{required} The input values for which the interpolated values are 25 ; desired. Its values must be strictly monotonically increasing. 26 ; 27 ; 28 ; 27 ; @param x2 {in}{required} 28 ; The input values for which the interpolated values are 29 ; desired. Its values must be strictly monotonically increasing. 30 ; 31 ; @param der2 32 ; @param x 29 33 ; 30 34 ; @returns … … 38 42 ; @examples 39 43 ; 40 ; 41 ; x = (dindgen(n))^242 ; 43 ; 44 ; 45 ; 46 ; 47 ; 48 ; 49 ; 50 ; 51 ; 52 ; 53 ; 54 ; 55 ; 56 ; 57 ; 44 ; IDL> n = 100L 45 ; IDL> x = (dindgen(n))^2 46 ; IDL> y = abs(randomn(0, n)) 47 ; IDL> y[n/2:n/2+1] = 0. 48 ; IDL> y[n-n/3] = 0. 49 ; IDL> y[n-n/6:n-n/6+5] = 0. 50 ; IDL> y = total(y, /cumulative, /double) 51 ; IDL> x2 = dindgen((n-1)^2) 52 ; IDL> n2 = n_elements(x2) 53 ; IDL> print, min(y[1:n-1]-y[0:n-2]) LT 0 54 ; IDL> y2 = spl_incr( x, y, x2) 55 ; IDL> splot, x, y, xstyle = 1, ystyle = 1, ysurx=.25, petit = [1, 2, 1], /land 56 ; IDL> oplot, x2, y2, color = 100 57 ; IDL> c = y2[1:n2-1] - y2[0:n2-2] 58 ; IDL> print, min(c) LT 0 59 ; IDL> print, min(c, max = ma), ma 60 ; IDL> splot,c,xstyle=1,ystyle=1, yrange=[-.01,.05], ysurx=.25, petit = [1, 2, 2], /noerase 61 ; IDL> oplot,[0, n_elements(c)], [0, 0], linestyle = 1 58 62 ; 59 63 ; @history 60 64 ; Sebastien Masson (smasson\@lodyc.jussieu.fr): May-Dec 2005 65 ; 66 ; @version $Id$ 67 ; 61 68 ;- 62 69 ;------------------------------------------------------------ … … 82 89 END 83 90 91 ;+ 92 ; @param x1 {in}{required} 93 ; An n-element (at least 2) input vector that specifies the tabulate points in 94 ; a strict ascending order. 95 ; 96 ; @param y1 {in}{required} 97 ; f(x) = y. An n-element input vector that specifies the values 98 ; of the tabulated function F(Xi) corresponding to Xi. As f is 99 ; supposed to be monotonically increasing, y values must be 100 ; monotonically increasing. y can have equal consecutive values. 101 ; 102 ; @param x2 {in}{required} 103 ; The input values for which the interpolated values are 104 ; desired. Its values must be strictly monotonically increasing. 105 ; 106 ; @param der2 107 ; @param x 108 ; 109 ;- 84 110 FUNCTION pure_convex, x1, x2, y1, y2, der2, x 85 111 ; 1-(1-X)^n type … … 103 129 104 130 ;+ 105 ; @keyword YP0 The first derivative of the interpolating function at the 131 ; @param x 132 ; @param y 133 ; @param x2 134 ; @keyword YP0 The first derivative of the interpolating function at the 106 135 ; point X0. If YP0 is omitted, the second derivative at the 107 136 ; boundary is set to zero, resulting in a "natural spline." 108 ; @keyword 137 ; @keyword YPN_1 The first derivative of the interpolating function at the 109 138 ; point Xn-1. If YPN_1 is omitted, the second derivative at the 110 139 ; boundary is set to zero, resulting in a "natural spline."
Note: See TracChangeset
for help on using the changeset viewer.