Changeset 42682
- Timestamp:
- Jun 1, 2024, 3:17:30 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20230313/Ohana/src/opihi/lib.data/spline.c
r42332 r42682 113 113 opihi_flt dx, a, b, value; 114 114 115 // 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]; 115 // linear extrapolation past endpoints 116 if (X < x[0]) { 117 hi = 1; 118 lo = 0; 119 goto evaluate; 120 // alternative: saturate correction at high and low ends 121 // return y[0]; 122 } 123 if (X > x[N-1]) { 124 hi = N - 1; 125 lo = N - 2; 126 goto evaluate; 127 // alternative: saturate correction at high and low ends 128 // return y[N-1]; 129 } 118 130 119 131 /* find correct element in array (x must be sorted) */ … … 128 140 } 129 141 } 142 143 evaluate: 130 144 131 145 /* error condition: duplicate abssisca */
Note:
See TracChangeset
for help on using the changeset viewer.
