Integration.h
Go to the documentation of this file.
/***************************************************************************
File : Integration.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2007 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Numerical integration of data sets
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#ifndef INTEGRATION_H
#define INTEGRATION_H
#include "Filter.h"
class Integration : public Filter
{
Q_OBJECT
public:
enum Integrand{DataSet, AnalyticalFunction};
Integration(ApplicationWindow *parent, Graph *g = 0);
Integration(ApplicationWindow *parent, QwtPlotCurve *c);
Integration(ApplicationWindow *parent, QwtPlotCurve *c, double start, double end);
Integration(ApplicationWindow *parent, Graph *g, const QString& curveTitle);
Integration(ApplicationWindow *parent, Graph *g, const QString& curveTitle, double start, double end);
Integration(ApplicationWindow *parent, Table *t, const QString& xCol, const QString& yCol, int start = 0, int end = -1, bool sort = false);
Integration(const QString& formula, const QString& var, ApplicationWindow *parent, Graph *g, double start, double end);
void setWorkspaceSize(int size){d_workspace_size = size;};
double area(){return d_area;};
QString variable(){return d_variable;};
QString formula(){return d_formula;};
private:
void init();
QString logInfo();
void output();
double trapez();
double gslIntegration();
double d_area;
double d_error;
int d_workspace_size;
Integrand d_integrand;
QString d_formula;
QString d_variable;
};
#endif
Integration::setWorkspaceSize
void setWorkspaceSize(int size)
Definition: Integration.h:49
Graph
A 2D-plotting widget.
Definition: Graph.h:123
Integration::variable
QString variable()
Definition: Integration.h:52
Integration::init
void init()
Definition: Integration.cpp:104
Integration::gslIntegration
double gslIntegration()
Definition: Integration.cpp:156
Integration::logInfo
QString logInfo()
Output string added to the log pannel of the application.
Definition: Integration.cpp:173
Filter
Abstract base class for data analysis operations.
Definition: Filter.h:43
Filter.h
Integration::Integration
Integration(ApplicationWindow *parent, Graph *g=0)
Definition: Integration.cpp:62
Integration
Definition: Integration.h:34
Integration::d_workspace_size
int d_workspace_size
the value of the workspace size in GSL integration
Definition: Integration.h:69
Integration::area
double area()
Definition: Integration.h:51
Integration::formula
QString formula()
Definition: Integration.h:53
Integration::AnalyticalFunction
Definition: Integration.h:39
Integration::Integrand
Integrand
Definition: Integration.h:39
Integration::d_area
double d_area
the value of the integral
Definition: Integration.h:65
Integration::d_error
double d_error
the value of the estimated error in GSL integration
Definition: Integration.h:67
ApplicationWindow
QtiPlot's main window.
Definition: ApplicationWindow.h:133
Integration::DataSet
Definition: Integration.h:39
Integration::output
void output()
Performs the data analysis and takes care of the output.
Definition: Integration.cpp:222
Integration::trapez
double trapez()
Definition: Integration.cpp:111
Integration::d_variable
QString d_variable
Variable name for the function to be integrated.
Definition: Integration.h:76
Integration::d_integrand
Integrand d_integrand
the type of the integrand
Definition: Integration.h:72
Table
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:57
Integration::d_formula
QString d_formula
Analytical function to be integrated.
Definition: Integration.h:74