Provided by: libqwt-doc_6.0.0-1ubuntu1_all bug


       QwtSpline -

       A class for spline interpolation.


       #include <qwt_spline.h>

   Public Types
       enum SplineType { Natural, Periodic }

   Public Member Functions
       QwtSpline ()
       QwtSpline (const QwtSpline &)
       ~QwtSpline ()
       QwtSpline & operator= (const QwtSpline &)
       void setSplineType (SplineType)
       SplineType splineType () const
       bool setPoints (const QPolygonF &points)
       QPolygonF points () const
       void reset ()
       bool isValid () const
       double value (double x) const
       const QVector< double > & coefficientsA () const
       const QVector< double > & coefficientsB () const
       const QVector< double > & coefficientsC () const

   Protected Member Functions
       bool buildNaturalSpline (const QPolygonF &)
       bool buildPeriodicSpline (const QPolygonF &)

Detailed Description

       A class for spline interpolation.

       The QwtSpline class is used for cubical spline interpolation. Two types of splines,
       natural and periodic, are supported.


           1.  First call setPoints() to determine the spline coefficients for a tabulated
               function y(x).
           2.  After the coefficients have been set up, the interpolated function value for an
               argument x can be determined by calling QwtSpline::value().

           #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;
               return interpolatedPoints;

Member Enumeration Documentation

   enum QwtSpline::SplineType
       Spline type.
              A natural spline.
              A periodic spline.

Constructor & Destructor Documentation

   QwtSpline::QwtSpline ()
   QwtSpline::QwtSpline (const QwtSpline &other) Copy constructor
           other Spline used for initilization
   QwtSpline::~QwtSpline ()

Member Function Documentation

   bool QwtSpline::buildNaturalSpline (const QPolygonF &points) [protected]
       Determines the coefficients for a natural spline. Returns:
           true if successful
   bool QwtSpline::buildPeriodicSpline (const QPolygonF &points) [protected]
       Determines the coefficients for a periodic spline. Returns:
           true if successful
   const QVector< double > & QwtSpline::coefficientsA () const Returns:
           A coefficients
   const QVector< double > & QwtSpline::coefficientsB () const Returns:
           B coefficients
   const QVector< double > & QwtSpline::coefficientsC () const Returns:
           C coefficients
   bool QwtSpline::isValid () const
       True if valid.
   QwtSpline & QwtSpline::operator= (const QwtSpline &other) Assignment operator
           other Spline used for initilization
   QPolygonF QwtSpline::points () const Return points passed by setPoints
   void QwtSpline::reset ()
       Free allocated memory and set size to 0.
   bool QwtSpline::setPoints (const QPolygonF &points)
       Calculate the spline coefficients. Depending on the value of periodic, this function will
       determine the coefficients for a natural or a periodic spline and store them internally.
           points Points
           true if successful
           The sequence of x (but not y) values has to be strictly monotone increasing, which
           means points[i].x() < points[i+1].x(). If this is not the case, the function will
           return false
   void QwtSpline::setSplineType (SplineTypesplineType) Select the algorithm used for calculating
       the spline
           splineType Spline type
       See also:
   QwtSpline::SplineType QwtSpline::splineType () const Returns:
           the spline type
       See also:
   double QwtSpline::value (doublex) const Calculate the interpolated function value
       corresponding to a given argument x.


       Generated automatically by Doxygen for Qwt User's Guide from the source code.