Eneboo - Documentación para desarrolladores
Clases | Tipos públicos | Métodos públicos | Métodos protegidos | Atributos protegidos
Referencia de la Clase QwtSpline

A class for spline interpolation. Más...

#include <qwt_spline.h>

Lista de todos los miembros.

Clases

class  PrivateData

Tipos públicos

enum  SplineType { Natural, Periodic }

Métodos públicos

 QwtSpline ()
 Constructor.
 QwtSpline (const QwtSpline &)
 ~QwtSpline ()
 Destructor.
QwtSplineoperator= (const QwtSpline &)
void setSplineType (SplineType)
SplineType splineType () const
bool setPoints (const QwtArray< QwtDoublePoint > &points)
 Determine the function table index corresponding to a value x.
QwtArray< QwtDoublePointpoints () const
void reset ()
 Free allocated memory and set size to 0.
bool isValid () const
 True if valid.
double value (double x) const

Métodos protegidos

bool buildNaturalSpline (const QwtArray< QwtDoublePoint > &)
 Determines the coefficients for a natural spline.
bool buildPeriodicSpline (const QwtArray< QwtDoublePoint > &)
 Determines the coefficients for a periodic spline.

Atributos protegidos

PrivateDatad_data

Descripción detallada

A class for spline interpolation.

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

Usage:
  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().
Example:
#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;
}

Documentación de las enumeraciones miembro de la clase

Valores de enumeraciones:
Natural 
Periodic 

Documentación del constructor y destructor

QwtSpline::QwtSpline ( )

Constructor.

QwtSpline::QwtSpline ( const QwtSpline other)
QwtSpline::~QwtSpline ( )

Destructor.


Documentación de las funciones miembro

bool QwtSpline::buildNaturalSpline ( const QwtArray< QwtDoublePoint > &  points) [protected]

Determines the coefficients for a natural spline.

Devuelve:
true if successful
bool QwtSpline::buildPeriodicSpline ( const QwtArray< QwtDoublePoint > &  points) [protected]

Determines the coefficients for a periodic spline.

Devuelve:
true if successful
bool QwtSpline::isValid ( void  ) const

True if valid.

QwtSpline & QwtSpline::operator= ( const QwtSpline other)
QwtArray< QwtDoublePoint > QwtSpline::points ( ) const

Return points passed by setPoints

void QwtSpline::reset ( void  )

Free allocated memory and set size to 0.

bool QwtSpline::setPoints ( const QwtArray< QwtDoublePoint > &  points)

Determine the function table index corresponding to a value x.

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.

Parámetros:
x
ypoints
sizenumber of points
periodicif true, calculate periodic spline
Devuelve:
true if successful
Atención:
The sequence of x (but not y) values has to be strictly monotone increasing, which means x[0] < x[1] < .... < x[n-1]. If this is not the case, the function will return false
void QwtSpline::setSplineType ( SplineType  splineType)
QwtSpline::SplineType QwtSpline::splineType ( ) const
double QwtSpline::value ( double  x) const

Calculate the interpolated function value corresponding to a given argument x.


Documentación de los datos miembro


La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'