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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2007-10-05 15:20:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071005152041-qmybqh4fj9jejyo2
Tags: 5.0.2-2
* Handle nostrip build option. (Closes: #437877)
* Build libqwt5-doc package in binary-indep target. (Closes: #443110)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH "QwtSpline" 3 "26 Feb 2007" "Version 5.0.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::buildNaturalSpline (const QPolygonF & points)\fC [protected]\fP"
139
 
.PP
140
 
Determines the coefficients for a natural spline. 
141
 
.PP
142
 
\fBReturns:\fP
143
 
.RS 4
144
 
true if successful 
145
 
.RE
146
 
.PP
147
 
 
148
 
.PP
149
 
Definition at line 209 of file qwt_spline.cpp.
150
 
.SS "bool QwtSpline::buildPeriodicSpline (const QPolygonF & points)\fC [protected]\fP"
151
 
.PP
152
 
Determines the coefficients for a periodic spline. 
153
 
.PP
154
 
\fBReturns:\fP
155
 
.RS 4
156
 
true if successful 
157
 
.RE
158
 
.PP
159
 
 
160
 
.PP
161
 
Definition at line 292 of file qwt_spline.cpp.
162
 
.SS "bool QwtSpline::isValid () const"
163
 
.PP
164
 
True if valid. 
165
 
.PP
166
 
Definition at line 181 of file qwt_spline.cpp.
167
 
.PP
168
 
References d_data.
169
 
.SS "QPolygonF QwtSpline::points () const"
170
 
.PP
171
 
Return points passed by setPoints 
172
 
.PP
173
 
Definition at line 164 of file qwt_spline.cpp.
174
 
.SS "void QwtSpline::reset ()"
175
 
.PP
176
 
Free allocated memory and set size to 0. 
177
 
.PP
178
 
Definition at line 172 of file qwt_spline.cpp.
179
 
.PP
180
 
References d_data.
181
 
.SS "bool QwtSpline::setPoints (const QPolygonF & points)"
182
 
.PP
183
 
Determine the function table index corresponding to a value x Calculate the spline coefficients. 
184
 
.PP
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.
186
 
.PP
187
 
\fBParameters:\fP
188
 
.RS 4
189
 
\fIx\fP 
190
 
.br
191
 
\fIy\fP points 
192
 
.br
193
 
\fIsize\fP number of points 
194
 
.br
195
 
\fIperiodic\fP if true, calculate periodic spline 
196
 
.RE
197
 
.PP
198
 
\fBReturns:\fP
199
 
.RS 4
200
 
true if successful 
201
 
.RE
202
 
.PP
203
 
\fBWarning:\fP
204
 
.RS 4
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 
206
 
.RE
207
 
.PP
208
 
 
209
 
.PP
210
 
Definition at line 126 of file qwt_spline.cpp.
211
 
.SS "double QwtSpline::value (double x) const"
212
 
.PP
213
 
Calculate the interpolated function value corresponding to a given argument x. 
214
 
.PP
215
 
Definition at line 190 of file qwt_spline.cpp.
216
 
.PP
217
 
References d_data.
218
 
 
219
 
.SH "Author"
220
 
.PP 
221
 
Generated automatically by Doxygen for Qwt User's Guide from the source code.