1
.TH "QwtSpline" 3 "24 May 2008" "Version 5.1.1" "Qwt User's Guide" \" -*- nroff -*-
9
.SH "Detailed Description"
11
A class for spline interpolation.
13
The \fBQwtSpline\fP class is used for cubical spline interpolation. Two types of splines, natural and periodic, are supported.
20
First call \fBsetPoints()\fP to determine the spline coefficients for a tabulated function y(x).
22
After the coefficients have been set up, the interpolated function value for an argument x can be determined by calling \fBQwtSpline::value()\fP.
30
#include <qwt_spline.h>
32
QPolygonF interpolate(const QPolygonF& points, int numValues)
35
if ( !spline.setPoints(points) )
38
QPolygonF interpolatedPoints(numValues);
41
(points[numPoints - 1].x() - points[0].x()) / (points.size() - 1);
42
for(i = 0; i < points.size(); i++) / interpolate
44
const double x = points[0].x() + i * delta;
45
interpolatedPoints[i].setX(x);
46
interpolatedPoints[i].setY(spline.value(x));
48
return interpolatedPoints;
58
Definition at line 77 of file qwt_spline.h.
63
.RI "enum \fBSplineType\fP { \fBNatural\fP, \fBPeriodic\fP }"
66
.SS "Public Member Functions"
70
.RI "\fBQwtSpline\fP ()"
73
.RI "\fBQwtSpline\fP (const \fBQwtSpline\fP &)"
76
.RI "\fB~QwtSpline\fP ()"
79
.RI "\fBQwtSpline\fP & \fBoperator=\fP (const \fBQwtSpline\fP &)"
82
.RI "void \fBsetSplineType\fP (\fBSplineType\fP)"
85
.RI "\fBSplineType\fP \fBsplineType\fP () const"
88
.RI "bool \fBsetPoints\fP (const QPolygonF &points)"
91
.RI "QPolygonF \fBpoints\fP () const"
94
.RI "void \fBreset\fP ()"
97
.RI "bool \fBisValid\fP () const"
100
.RI "double \fBvalue\fP (double x) const"
103
.SS "Protected Member Functions"
107
.RI "bool \fBbuildNaturalSpline\fP (const QPolygonF &)"
110
.RI "bool \fBbuildPeriodicSpline\fP (const QPolygonF &)"
113
.SS "Protected Attributes"
117
.RI "PrivateData * \fBd_data\fP"
120
.SH "Constructor & Destructor Documentation"
122
.SS "QwtSpline::QwtSpline ()"
126
Definition at line 73 of file qwt_spline.cpp.
129
.SS "QwtSpline::~QwtSpline ()"
133
Definition at line 90 of file qwt_spline.cpp.
136
.SH "Member Function Documentation"
138
.SS "bool QwtSpline::setPoints (const QPolygonF & points)"
140
Determine the function table index corresponding to a value x Calculate the spline coefficients.
142
Depending on the value of \fIperiodic\fP, this function will determine the coefficients for a natural or a periodic spline and store them internally.
150
\fIsize\fP number of points
152
\fIperiodic\fP if true, calculate periodic spline
162
The sequence of x (but not y) values has to be strictly monotone increasing, which means \fCx[0] < x[1] < .... < x[n-1]\fP. If this is not the case, the function will return false
167
Definition at line 126 of file qwt_spline.cpp.
168
.SS "QPolygonF QwtSpline::points () const"
170
Return points passed by setPoints
172
Definition at line 164 of file qwt_spline.cpp.
173
.SS "void QwtSpline::reset ()"
175
Free allocated memory and set size to 0.
177
Definition at line 172 of file qwt_spline.cpp.
180
.SS "bool QwtSpline::isValid () const"
184
Definition at line 181 of file qwt_spline.cpp.
187
.SS "double QwtSpline::value (double x) const"
189
Calculate the interpolated function value corresponding to a given argument x.
191
Definition at line 190 of file qwt_spline.cpp.
194
.SS "bool QwtSpline::buildNaturalSpline (const QPolygonF & points)\fC [protected]\fP"
196
Determines the coefficients for a natural spline.
205
Definition at line 209 of file qwt_spline.cpp.
206
.SS "bool QwtSpline::buildPeriodicSpline (const QPolygonF & points)\fC [protected]\fP"
208
Determines the coefficients for a periodic spline.
217
Definition at line 292 of file qwt_spline.cpp.
221
Generated automatically by Doxygen for Qwt User's Guide from the source code.