⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qwtspline.3

📁 软件无线电的平台
💻 3
字号:
.TH "QwtSpline" 3 "4 Nov 2003" "Qwt User's Guide" \" -*- nroff -*-.ad l.nh.SH NAMEQwtSpline \- .SH SYNOPSIS.br.PP.SH "Detailed Description".PP A class for spline interpolation. The QwtSpline class is used for cubical spline interpolation. Two types of splines, natural and periodic, are supported..PP\fBUsage:\fP.RS 4.IP "1." 4First call \fBQwtSpline::recalc()\fP to determine the spline coefficients for a tabulated function y(x). .IP "2." 4After the coefficients have been set up, the interpolated function value for an argument x can be determined by calling \fBQwtSpline::value()\fP. .PPIn order to save storage space, QwtSpline can be advised not to buffer the contents of x and y. This means that the arrays have to remain valid and unchanged for the interpolation to work properly. This can be achieved by calling \fBQwtSpline::copyValues()\fP..RE.PP\fBExample:\fP.RS 4.PP.nf#include<qwt_spline.h>#include<iostream.h>QwtSpline s;double x[30], y[30], xInter[300], yInter[300];int i;for(i=0;i<30;i++)               // fill up x[] and y[]cin >> x[i] >> y[i];if (s.recalc(x,y,30,0) == 0)    // build natural spline{   for(i=0;i<300;i++)          // interpolate   {     xInter[i] = x[0] + double(i) * (x[29] - x[0]) / 299.0;     yInter[i] = s.value( xInter[i] );   }   do_something(xInter, yInter, 300);}else  cerr << 'Uhhh...\n';.PP.RE.PP.PP.SS "Public Member Functions".in +1c.ti -1c.RI "\fBQwtSpline\fP ()".br.ti -1c.RI "\fB~QwtSpline\fP ()".br.ti -1c.RI "double \fBvalue\fP (double x) const ".br.ti -1c.RI "int \fBrecalc\fP (double *x, double *y, int n, int periodic=0)".br.ti -1c.RI "int \fBrecalc\fP (const  QwtArray< double > &x, const  QwtArray< double > &y, int periodic=0)".br.ti -1c.RI "void \fBcopyValues\fP (int tf=1)".br.in -1c.SH "Constructor & Destructor Documentation".PP .SS "QwtSpline::QwtSpline ()".PPCTOR. .SS "QwtSpline::~\fBQwtSpline\fP ()".PPDTOR. .SH "Member Function Documentation".PP .SS "void QwtSpline::copyValues (int tf = 1)".PPAdvise \fBrecalc()\fP to buffer the tabulated function or switch off internal buffering. By default, QwtSpline maintains an internal copy of the tabulated function given as *x and *y arguments of \fBQwtSpline::recalc()\fP..PPIf \fBQwtSpline::copyValues()\fP is called with zero argument, subsequent calls to \fBQwtSpline::recalc()\fP will not buffer these values anymore and just store the pointers instead. The \fBQwtSpline::value()\fP function will then silently assume that these pointers remained valid and that the contents of the arrays have not been changed since the last \fBQwtSpline::recalc()\fP..PPIf called with no or nonzero argument, any following \fBQwtSpline::recalc()\fP calls will use the internal buffer..PP\fBParameters:\fP.RS 4\fItf\fP if nonzero, the function table will be buffered .RE.PP\fBWarning:\fP.RS 4\fBcopyValues()\fP resets all the contents of QwtSpline. A subsequent \fBrecalc()\fP will be necessary. .RE.PP.SS "int QwtSpline::recalc (const QwtArray< double > & x, const QwtArray< double > & y, int periodic = 0)".PPre-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. It also buffers the values of x and y, which are needed for the interpolation (See \fBQwtSpline::value()\fP). .PP\fBParameters:\fP.RS 4\fIx\fP QwtArray<double> of points .br\fIy\fP QwtArray<double> of points .br\fIperiodic\fP if non-zero, calculate periodic spline .RE.PP\fBReturns:\fP.RS 4.IP "\fB0\fP" 1csuccessful .IP "\fBQwt::ErrMono<dd>Sequence of x values is not strictly monotone increasing \fP" 1c.IP "\fBQwt::ErrNoMem<dd>Couldn't allocate memory \fP" 1c.PP.RE.PP\fBWarning:\fP.RS 4The 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 an error. .RE.PP.SS "int QwtSpline::recalc (double * x, double * y, int n, int periodic = 0)".PPre-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. By default, it also buffers the values of x and y, which are needed for the interpolation (See \fBQwtSpline::value()\fP). In order to save memory, this last behaviour may be changed with the \fBQwtSpline::copyValues()\fP function..PP\fBParameters:\fP.RS 4\fIx\fP .br\fIy\fP points .br\fIn\fP number of points .br\fIperiodic\fP if non-zero, calculate periodic spline .RE.PP\fBReturns:\fP.RS 4.IP "\fB0\fP" 1csuccessful .IP "\fBQwt::ErrMono<dd>Sequence of x values is not strictly monotone increasing \fP" 1c.IP "\fBQwt::ErrNoMem<dd>Couldn't allocate memory \fP" 1c.PP.RE.PP\fBWarning:\fP.RS 4The 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 an error. .RE.PP.SS "double QwtSpline::value (double x) const".PPCalculate the interpolated function value corresponding to a given argument x. .SH "Author".PP Generated automatically by Doxygen for Qwt User's Guide from the source code.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -