#include "qwt_spline.h"#include "qwt_math.h"#include "qwt_array.h"Go to the source code of this file.
Classes | |
| class | QwtSpline::PrivateData |
Functions | |
| static int | lookup (double x, const QMemArray< QwtDoublePoint > &values) |
| static int lookup | ( | double | x, |
| const QMemArray< QwtDoublePoint > & | values | ||
| ) | [static] |
Definition at line 38 of file qwt_spline.cpp.
References int().
Referenced by QwtSpline::value().
{
#if 0
//qLowerBiund/qHigherBound ???
#endif
int i1;
const int size = (int)values.size();
if (x <= values[0].x())
i1 = 0;
else if (x >= values[size - 2].x())
i1 = size - 2;
else
{
i1 = 0;
int i2 = size - 2;
int i3 = 0;
while ( i2 - i1 > 1 )
{
i3 = i1 + ((i2 - i1) >> 1);
if (values[i3].x() > x)
i2 = i3;
else
i1 = i3;
}
}
return i1;
}
1.7.2