~ubuntu-branches/ubuntu/oneiric/qwt/oneiric-proposed

« back to all changes in this revision

Viewing changes to qwt-5.1.1/doc/man/man3/QwtSpline.3

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2008-05-26 10:26:31 UTC
  • mfrom: (1.1.3 upstream) (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080526102631-bp95mfccnrb957nx
Tags: 5.1.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.TH "QwtSpline" 3 "24 May 2008" "Version 5.1.1" "Qwt User's Guide" \" -*- nroff -*-
 
2
.ad l
 
3
.nh
 
4
.SH NAME
 
5
QwtSpline \- 
 
6
.SH SYNOPSIS
 
7
.br
 
8
.PP
 
9
.SH "Detailed Description"
 
10
.PP 
 
11
A class for spline interpolation. 
 
12
 
 
13
The \fBQwtSpline\fP class is used for cubical spline interpolation. Two types of splines, natural and periodic, are supported.
 
14
.PP
 
15
\fBUsage:\fP.RS 4
 
16
 
 
17
.PD 0
 
18
 
 
19
.IP "1." 4
 
20
First call \fBsetPoints()\fP to determine the spline coefficients for a tabulated function y(x). 
 
21
.IP "2." 4
 
22
After the coefficients have been set up, the interpolated function value for an argument x can be determined by calling \fBQwtSpline::value()\fP. 
 
23
.PP
 
24
.RE
 
25
.PP
 
26
\fBExample:\fP.RS 4
 
27
 
 
28
.PP
 
29
.nf
 
30
#include <qwt_spline.h>
 
31
 
 
32
QPolygonF interpolate(const QPolygonF& points, int numValues)
 
33
{
 
34
    QwtSpline spline;
 
35
    if ( !spline.setPoints(points) ) 
 
36
        return points;
 
37
 
 
38
    QPolygonF interpolatedPoints(numValues);
 
39
 
 
40
    const double delta = 
 
41
        (points[numPoints - 1].x() - points[0].x()) / (points.size() - 1);
 
42
    for(i = 0; i < points.size(); i++)  / interpolate
 
43
    {
 
44
        const double x = points[0].x() + i * delta;
 
45
        interpolatedPoints[i].setX(x);
 
46
        interpolatedPoints[i].setY(spline.value(x));
 
47
    }
 
48
    return interpolatedPoints;
 
49
}
 
50
 
 
51
.fi
 
52
.PP
 
53
 
 
54
.RE
 
55
.PP
 
56
 
 
57
.PP
 
58
Definition at line 77 of file qwt_spline.h.
 
59
.SS "Public Types"
 
60
 
 
61
.in +1c
 
62
.ti -1c
 
63
.RI "enum \fBSplineType\fP { \fBNatural\fP, \fBPeriodic\fP }"
 
64
.br
 
65
.in -1c
 
66
.SS "Public Member Functions"
 
67
 
 
68
.in +1c
 
69
.ti -1c
 
70
.RI "\fBQwtSpline\fP ()"
 
71
.br
 
72
.ti -1c
 
73
.RI "\fBQwtSpline\fP (const \fBQwtSpline\fP &)"
 
74
.br
 
75
.ti -1c
 
76
.RI "\fB~QwtSpline\fP ()"
 
77
.br
 
78
.ti -1c
 
79
.RI "\fBQwtSpline\fP & \fBoperator=\fP (const \fBQwtSpline\fP &)"
 
80
.br
 
81
.ti -1c
 
82
.RI "void \fBsetSplineType\fP (\fBSplineType\fP)"
 
83
.br
 
84
.ti -1c
 
85
.RI "\fBSplineType\fP \fBsplineType\fP () const"
 
86
.br
 
87
.ti -1c
 
88
.RI "bool \fBsetPoints\fP (const QPolygonF &points)"
 
89
.br
 
90
.ti -1c
 
91
.RI "QPolygonF \fBpoints\fP () const"
 
92
.br
 
93
.ti -1c
 
94
.RI "void \fBreset\fP ()"
 
95
.br
 
96
.ti -1c
 
97
.RI "bool \fBisValid\fP () const"
 
98
.br
 
99
.ti -1c
 
100
.RI "double \fBvalue\fP (double x) const"
 
101
.br
 
102
.in -1c
 
103
.SS "Protected Member Functions"
 
104
 
 
105
.in +1c
 
106
.ti -1c
 
107
.RI "bool \fBbuildNaturalSpline\fP (const QPolygonF &)"
 
108
.br
 
109
.ti -1c
 
110
.RI "bool \fBbuildPeriodicSpline\fP (const QPolygonF &)"
 
111
.br
 
112
.in -1c
 
113
.SS "Protected Attributes"
 
114
 
 
115
.in +1c
 
116
.ti -1c
 
117
.RI "PrivateData * \fBd_data\fP"
 
118
.br
 
119
.in -1c
 
120
.SH "Constructor & Destructor Documentation"
 
121
.PP 
 
122
.SS "QwtSpline::QwtSpline ()"
 
123
.PP
 
124
Constructor. 
 
125
.PP
 
126
Definition at line 73 of file qwt_spline.cpp.
 
127
.PP
 
128
References d_data.
 
129
.SS "QwtSpline::~QwtSpline ()"
 
130
.PP
 
131
Destructor. 
 
132
.PP
 
133
Definition at line 90 of file qwt_spline.cpp.
 
134
.PP
 
135
References d_data.
 
136
.SH "Member Function Documentation"
 
137
.PP 
 
138
.SS "bool QwtSpline::setPoints (const QPolygonF & points)"
 
139
.PP
 
140
Determine the function table index corresponding to a value x Calculate the spline coefficients. 
 
141
.PP
 
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.
 
143
.PP
 
144
\fBParameters:\fP
 
145
.RS 4
 
146
\fIx\fP 
 
147
.br
 
148
\fIy\fP points 
 
149
.br
 
150
\fIsize\fP number of points 
 
151
.br
 
152
\fIperiodic\fP if true, calculate periodic spline 
 
153
.RE
 
154
.PP
 
155
\fBReturns:\fP
 
156
.RS 4
 
157
true if successful 
 
158
.RE
 
159
.PP
 
160
\fBWarning:\fP
 
161
.RS 4
 
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 
 
163
.RE
 
164
.PP
 
165
 
 
166
.PP
 
167
Definition at line 126 of file qwt_spline.cpp.
 
168
.SS "QPolygonF QwtSpline::points () const"
 
169
.PP
 
170
Return points passed by setPoints 
 
171
.PP
 
172
Definition at line 164 of file qwt_spline.cpp.
 
173
.SS "void QwtSpline::reset ()"
 
174
.PP
 
175
Free allocated memory and set size to 0. 
 
176
.PP
 
177
Definition at line 172 of file qwt_spline.cpp.
 
178
.PP
 
179
References d_data.
 
180
.SS "bool QwtSpline::isValid () const"
 
181
.PP
 
182
True if valid. 
 
183
.PP
 
184
Definition at line 181 of file qwt_spline.cpp.
 
185
.PP
 
186
References d_data.
 
187
.SS "double QwtSpline::value (double x) const"
 
188
.PP
 
189
Calculate the interpolated function value corresponding to a given argument x. 
 
190
.PP
 
191
Definition at line 190 of file qwt_spline.cpp.
 
192
.PP
 
193
References d_data.
 
194
.SS "bool QwtSpline::buildNaturalSpline (const QPolygonF & points)\fC [protected]\fP"
 
195
.PP
 
196
Determines the coefficients for a natural spline. 
 
197
.PP
 
198
\fBReturns:\fP
 
199
.RS 4
 
200
true if successful 
 
201
.RE
 
202
.PP
 
203
 
 
204
.PP
 
205
Definition at line 209 of file qwt_spline.cpp.
 
206
.SS "bool QwtSpline::buildPeriodicSpline (const QPolygonF & points)\fC [protected]\fP"
 
207
.PP
 
208
Determines the coefficients for a periodic spline. 
 
209
.PP
 
210
\fBReturns:\fP
 
211
.RS 4
 
212
true if successful 
 
213
.RE
 
214
.PP
 
215
 
 
216
.PP
 
217
Definition at line 292 of file qwt_spline.cpp.
 
218
 
 
219
.SH "Author"
 
220
.PP 
 
221
Generated automatically by Doxygen for Qwt User's Guide from the source code.