MyParser.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : MyParser.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2006 by Ion Vasilief
00006     Email (use @ for *)  : ion_vasilief*yahoo.fr
00007     Description          : Parser class based on muParser
00008 
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *  This program is free software; you can redistribute it and/or modify   *
00014  *  it under the terms of the GNU General Public License as published by   *
00015  *  the Free Software Foundation; either version 2 of the License, or      *
00016  *  (at your option) any later version.                                    *
00017  *                                                                         *
00018  *  This program is distributed in the hope that it will be useful,        *
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00021  *  GNU General Public License for more details.                           *
00022  *                                                                         *
00023  *   You should have received a copy of the GNU General Public License     *
00024  *   along with this program; if not, write to the Free Software           *
00025  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00026  *   Boston, MA  02110-1301  USA                                           *
00027  *                                                                         *
00028  ***************************************************************************/
00029 #ifndef MYPARSER_H
00030 #define MYPARSER_H
00031 
00032 #include <muParser.h>
00033 #include <gsl/gsl_math.h>
00034 #include <gsl/gsl_sf.h>
00035 
00036 #include <qstringlist.h>
00037 
00038 using namespace mu;
00039 
00049 class MyParser : public Parser
00050 {
00051 public:
00052     MyParser();
00053 
00054     static QStringList functionsList();
00055     static QString explainFunction(int index);
00056 
00057     static double bessel_J0(double x)
00058         {
00059         return gsl_sf_bessel_J0 (x);
00060         }
00061 
00062     static double bessel_J1(double x)
00063         {
00064         return gsl_sf_bessel_J1 (x);
00065         }
00066 
00067     static double bessel_Jn(double x, double n)
00068         {
00069         return gsl_sf_bessel_Jn ((int)n, x);
00070         }
00071 
00072     static double bessel_Y0(double x)
00073         {
00074         return gsl_sf_bessel_Y0 (x);
00075         }
00076 
00077     static double bessel_Y1(double x)
00078         {
00079         return gsl_sf_bessel_Y1 (x);
00080         }
00081     static double bessel_Yn(double x, double n)
00082         {
00083         return gsl_sf_bessel_Yn ((int)n, x);
00084         }
00085     static double beta(double a, double b)
00086         {
00087         return gsl_sf_beta (a, b);
00088         }
00089     static double erf(double x)
00090         {
00091         return gsl_sf_erf (x);
00092         }
00093     static double erfc(double x)
00094         {
00095         return gsl_sf_erfc (x);
00096         }
00097     static double erfz(double x)
00098         {
00099         return gsl_sf_erf_Z (x);
00100         }
00101     static double erfq(double x)
00102         {
00103         return gsl_sf_erf_Q (x);
00104         }
00105     static double gamma(double x)
00106         {
00107         return gsl_sf_gamma (x);
00108         }
00109     static double gammaln(double x)
00110         {
00111         return gsl_sf_lngamma (x);
00112         }
00113     static double hazard(double x)
00114         {
00115         return gsl_sf_hazard (x);
00116         }
00117 };
00118 
00119 #endif

Generated on Thu Feb 7 13:59:27 2008 for QtiPlot by  doxygen 1.5.4