- Timestamp:
- Nov 23, 2025, 4:33:16 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-ppmerge-20241229/Ohana/src/opihi/lib.data/spline.c
r42332 r42946 1 1 # include "data.h" 2 3 static SplineMode MODE = SPLINE_SATURATE; // SATURATE or EXTRAPOLATE? 4 5 int spline_contruct_mode (SplineMode mode) { 6 7 switch (mode) { 8 case SPLINE_SATURATE: 9 case SPLINE_EXTRAPOLATE: 10 MODE = mode; 11 break; 12 default: 13 return FALSE; 14 } 15 return TRUE; 16 } 2 17 3 18 /* construct the natural spline for x, y in y2 */ … … 36 51 37 52 // saturate correction at high and low ends 38 if (X < x[0]) return y[0]; 39 if (X > x[N-1]) return y[N-1]; 53 if (MODE == SPLINE_SATURATE) { 54 if (X < x[0]) return y[0]; 55 if (X > x[N-1]) return y[N-1]; 56 } 40 57 41 58 /* find correct element in array (x must be sorted) */ … … 114 131 115 132 // saturate correction at high and low ends 116 if (X < x[0]) return y[0]; 117 if (X > x[N-1]) return y[N-1]; 133 if (MODE == SPLINE_SATURATE) { 134 if (X < x[0]) return y[0]; 135 if (X > x[N-1]) return y[N-1]; 136 } 118 137 119 138 /* find correct element in array (x must be sorted) */
Note:
See TracChangeset
for help on using the changeset viewer.
