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 
00048 class MyParser : public Parser
00049 {
00050 public:
00051     MyParser();
00052 
00053     static QStringList functionsList();
00054     static QString explainFunction(int index);
00055 
00056     static double bessel_J0(double x)
00057         {
00058         return gsl_sf_bessel_J0 (x);
00059         }
00060 
00061     static double bessel_J1(double x)
00062         {
00063         return gsl_sf_bessel_J1 (x);
00064         }
00065 
00066     static double bessel_Jn(double x, double n)
00067         {
00068         return gsl_sf_bessel_Jn ((int)n, x);
00069         }
00070 
00071     static double bessel_Y0(double x)
00072         {
00073         return gsl_sf_bessel_Y0 (x);
00074         }
00075 
00076     static double bessel_Y1(double x)
00077         {
00078         return gsl_sf_bessel_Y1 (x);
00079         }
00080     static double bessel_Yn(double x, double n)
00081         {
00082         return gsl_sf_bessel_Yn ((int)n, x);
00083         }
00084     static double beta(double a, double b)
00085         {
00086         return gsl_sf_beta (a, b);
00087         }
00088     static double erf(double x)
00089         {
00090         return gsl_sf_erf (x);
00091         }
00092     static double erfc(double x)
00093         {
00094         return gsl_sf_erfc (x);
00095         }
00096     static double erfz(double x)
00097         {
00098         return gsl_sf_erf_Z (x);
00099         }
00100     static double erfq(double x)
00101         {
00102         return gsl_sf_erf_Q (x);
00103         }
00104     static double gamma(double x)
00105         {
00106         return gsl_sf_gamma (x);
00107         }
00108     static double gammaln(double x)
00109         {
00110         return gsl_sf_lngamma (x);
00111         }
00112     static double hazard(double x)
00113         {
00114         return gsl_sf_hazard (x);
00115         }
00116 };
00117 
00118 #endif

Generated on Fri Nov 7 03:36:51 2008 for QtiPlot by  doxygen 1.5.6