123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- .TH "QwtSpline" 3 "Mon Dec 28 2020" "Version 6.1.6" "Qwt User's Guide" \" -*- nroff -*-
- .ad l
- .nh
- .SH NAME
- QwtSpline \- A class for spline interpolation\&.
- .SH SYNOPSIS
- .br
- .PP
- .PP
- \fC#include <qwt_spline\&.h>\fP
- .SS "Public Types"
- .in +1c
- .ti -1c
- .RI "enum \fBSplineType\fP { \fBNatural\fP, \fBPeriodic\fP }"
- .br
- .RI "Spline type\&. "
- .in -1c
- .SS "Public Member Functions"
- .in +1c
- .ti -1c
- .RI "\fBQwtSpline\fP ()"
- .br
- .RI "Constructor\&. "
- .ti -1c
- .RI "\fBQwtSpline\fP (const \fBQwtSpline\fP &)"
- .br
- .ti -1c
- .RI "\fB~QwtSpline\fP ()"
- .br
- .RI "Destructor\&. "
- .ti -1c
- .RI "\fBQwtSpline\fP & \fBoperator=\fP (const \fBQwtSpline\fP &)"
- .br
- .ti -1c
- .RI "void \fBsetSplineType\fP (\fBSplineType\fP)"
- .br
- .ti -1c
- .RI "\fBSplineType\fP \fBsplineType\fP () const"
- .br
- .ti -1c
- .RI "bool \fBsetPoints\fP (const QPolygonF &\fBpoints\fP)"
- .br
- .RI "Calculate the spline coefficients\&. "
- .ti -1c
- .RI "QPolygonF \fBpoints\fP () const"
- .br
- .ti -1c
- .RI "void \fBreset\fP ()"
- .br
- .RI "Free allocated memory and set size to 0\&. "
- .ti -1c
- .RI "bool \fBisValid\fP () const"
- .br
- .RI "True if valid\&. "
- .ti -1c
- .RI "double \fBvalue\fP (double x) const"
- .br
- .ti -1c
- .RI "const QVector< double > & \fBcoefficientsA\fP () const"
- .br
- .ti -1c
- .RI "const QVector< double > & \fBcoefficientsB\fP () const"
- .br
- .ti -1c
- .RI "const QVector< double > & \fBcoefficientsC\fP () const"
- .br
- .in -1c
- .SS "Protected Member Functions"
- .in +1c
- .ti -1c
- .RI "bool \fBbuildNaturalSpline\fP (const QPolygonF &)"
- .br
- .RI "Determines the coefficients for a natural spline\&. "
- .ti -1c
- .RI "bool \fBbuildPeriodicSpline\fP (const QPolygonF &)"
- .br
- .RI "Determines the coefficients for a periodic spline\&. "
- .in -1c
- .SH "Detailed Description"
- .PP
- A class for spline interpolation\&.
- The \fBQwtSpline\fP class is used for cubical spline interpolation\&. Two types of splines, natural and periodic, are supported\&.
- .PP
- \fBUsage:\fP
- .RS 4
- .PD 0
- .IP "1." 4
- First call \fBsetPoints()\fP to determine the spline coefficients for a tabulated function y(x)\&.
- .IP "2." 4
- After the coefficients have been set up, the interpolated function value for an argument x can be determined by calling \fBQwtSpline::value()\fP\&.
- .PP
- .RE
- .PP
- \fBExample:\fP
- .RS 4
- .PP
- .nf
- #include <qwt_spline\&.h>
- QPolygonF interpolate(const QPolygonF& points, int numValues)
- {
- QwtSpline spline;
- if ( !spline\&.setPoints(points) )
- return points;
- QPolygonF interpolatedPoints(numValues);
- const double delta =
- (points[numPoints - 1]\&.x() - points[0]\&.x()) / (points\&.size() - 1);
- for(i = 0; i < points\&.size(); i++) / interpolate
- {
- const double x = points[0]\&.x() + i * delta;
- interpolatedPoints[i]\&.setX(x);
- interpolatedPoints[i]\&.setY(spline\&.value(x));
- }
- return interpolatedPoints;
- }
- .fi
- .PP
-
- .RE
- .PP
- .SH "Member Enumeration Documentation"
- .PP
- .SS "enum \fBQwtSpline::SplineType\fP"
- .PP
- Spline type\&.
- .PP
- \fBEnumerator\fP
- .in +1c
- .TP
- \fB\fINatural \fP\fP
- A natural spline\&.
- .TP
- \fB\fIPeriodic \fP\fP
- A periodic spline\&.
- .SH "Constructor & Destructor Documentation"
- .PP
- .SS "QwtSpline::QwtSpline (const \fBQwtSpline\fP & other)"
- Copy constructor
- .PP
- \fBParameters\fP
- .RS 4
- \fIother\fP Spline used for initialization
- .RE
- .PP
- .SH "Member Function Documentation"
- .PP
- .SS "bool QwtSpline::buildNaturalSpline (const QPolygonF & points)\fC [protected]\fP"
- .PP
- Determines the coefficients for a natural spline\&.
- .PP
- \fBReturns\fP
- .RS 4
- true if successful
- .RE
- .PP
- .SS "bool QwtSpline::buildPeriodicSpline (const QPolygonF & points)\fC [protected]\fP"
- .PP
- Determines the coefficients for a periodic spline\&.
- .PP
- \fBReturns\fP
- .RS 4
- true if successful
- .RE
- .PP
- .SS "const QVector< double > & QwtSpline::coefficientsA () const"
- .PP
- \fBReturns\fP
- .RS 4
- A coefficients
- .RE
- .PP
- .SS "const QVector< double > & QwtSpline::coefficientsB () const"
- .PP
- \fBReturns\fP
- .RS 4
- B coefficients
- .RE
- .PP
- .SS "const QVector< double > & QwtSpline::coefficientsC () const"
- .PP
- \fBReturns\fP
- .RS 4
- C coefficients
- .RE
- .PP
- .SS "\fBQwtSpline\fP & QwtSpline::operator= (const \fBQwtSpline\fP & other)"
- Assignment operator
- .PP
- \fBParameters\fP
- .RS 4
- \fIother\fP Spline used for initialization
- .RE
- .PP
- \fBReturns\fP
- .RS 4
- *this
- .RE
- .PP
- .SS "QPolygonF QwtSpline::points () const"
- .PP
- \fBReturns\fP
- .RS 4
- Points, that have been by \fBsetPoints()\fP
- .RE
- .PP
- .SS "bool QwtSpline::setPoints (const QPolygonF & points)"
- .PP
- Calculate the spline coefficients\&. Depending on the value of \fIperiodic\fP, this function will determine the coefficients for a natural or a periodic spline and store them internally\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIpoints\fP Points
- .RE
- .PP
- \fBReturns\fP
- .RS 4
- true if successful
- .RE
- .PP
- \fBWarning\fP
- .RS 4
- The sequence of x (but not y) values has to be strictly monotone increasing, which means \fCpoints[i]\&.x() < points[i+1]\&.x()\fP\&. If this is not the case, the function will return false
- .RE
- .PP
- .SS "void QwtSpline::setSplineType (\fBSplineType\fP splineType)"
- Select the algorithm used for calculating the spline
- .PP
- \fBParameters\fP
- .RS 4
- \fIsplineType\fP Spline type
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsplineType()\fP
- .RE
- .PP
- .SS "\fBQwtSpline::SplineType\fP QwtSpline::splineType () const"
- .PP
- \fBReturns\fP
- .RS 4
- the spline type
- .RE
- .PP
- \fBSee also\fP
- .RS 4
- \fBsetSplineType()\fP
- .RE
- .PP
- .SS "double QwtSpline::value (double x) const"
- Calculate the interpolated function value corresponding to a given argument x\&.
- .PP
- \fBParameters\fP
- .RS 4
- \fIx\fP Coordinate
- .RE
- .PP
- \fBReturns\fP
- .RS 4
- Interpolated coordinate
- .RE
- .PP
- .SH "Author"
- .PP
- Generated automatically by Doxygen for Qwt User's Guide from the source code\&.
|