1
.TH "QwtSpline" 3 "26 Feb 2007" "Version 5.0.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::buildNaturalSpline (const QPolygonF & points)\fC [protected]\fP"
140
Determines the coefficients for a natural spline.
149
Definition at line 209 of file qwt_spline.cpp.
150
.SS "bool QwtSpline::buildPeriodicSpline (const QPolygonF & points)\fC [protected]\fP"
152
Determines the coefficients for a periodic spline.
161
Definition at line 292 of file qwt_spline.cpp.
162
.SS "bool QwtSpline::isValid () const"
166
Definition at line 181 of file qwt_spline.cpp.
169
.SS "QPolygonF QwtSpline::points () const"
171
Return points passed by setPoints
173
Definition at line 164 of file qwt_spline.cpp.
174
.SS "void QwtSpline::reset ()"
176
Free allocated memory and set size to 0.
178
Definition at line 172 of file qwt_spline.cpp.
181
.SS "bool QwtSpline::setPoints (const QPolygonF & points)"
183
Determine the function table index corresponding to a value x Calculate the spline coefficients.
185
Depending on the value of \fIperiodic\fP, this function will determine the coefficients for a natural or a periodic spline and store them internally.
193
\fIsize\fP number of points
195
\fIperiodic\fP if true, calculate periodic spline
205
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
210
Definition at line 126 of file qwt_spline.cpp.
211
.SS "double QwtSpline::value (double x) const"
213
Calculate the interpolated function value corresponding to a given argument x.
215
Definition at line 190 of file qwt_spline.cpp.
221
Generated automatically by Doxygen for Qwt User's Guide from the source code.