------------------------------------------------------------------------
| 212 | |
| 213 | //------------------------------------------------------------------------ |
| 214 | double bspline::get(double x) const |
| 215 | { |
| 216 | if(m_num > 2) |
| 217 | { |
| 218 | int i; |
| 219 | |
| 220 | // Extrapolation on the left |
| 221 | if(x < m_x[0]) return extrapolation_left(x); |
| 222 | |
| 223 | // Extrapolation on the right |
| 224 | if(x >= m_x[m_num - 1]) return extrapolation_right(x); |
| 225 | |
| 226 | // Interpolation |
| 227 | bsearch(m_num, m_x, x, &i); |
| 228 | return interpolation(x, i); |
| 229 | } |
| 230 | return 0.0; |
| 231 | } |
| 232 | |
| 233 | |
| 234 | //------------------------------------------------------------------------ |
no outgoing calls