6 #ifndef BALL_QSAR_FITMODEL
7 #define BALL_QSAR_FITMODEL
9 #ifndef BALL_CONFIG_CONFIG_H
10 # include <BALL/CONFIG/config.h>
15 #ifndef BALL_QSAR_NONLINEARMODEL_H
19 #include <gsl/gsl_multifit_nlin.h>
20 #include <gsl/gsl_deriv.h>
21 #include <gsl/gsl_math.h>
23 #ifndef BALL_MATHS_PARSEDFUNCTION_H
39 FitModel(
const QSARData& q);
41 FitModel(
const QSARData& q, vector<String>& eq, vector<double>& guess);
43 FitModel(
const QSARData& q, vector<String>& eq, vector<vector<String> >& deq, vector<double>& guess);
55 void setEquations(vector<String>& eq, vector<vector<String> >& deq);
58 void setEquations(vector<String>& eq);
63 Eigen::VectorXd predict(
const vector<double>& substance,
bool transform=1);
65 void setInitialGuess(vector<double>& d);
74 vector<String> allEquations_;
77 vector<vector<String> > allDiffEquations_;
82 vector<double> initial_guess_;
89 const Eigen::MatrixXd* fitX;
90 Eigen::MatrixXd* fitY;
92 vector<String>* diffEquations;
93 ParsedFunction<double>* f;
96 double getFunctionValue(
double X,
void* params);
98 int setF(
const gsl_vector* x,
void* params, gsl_vector* f);
100 int setDf(
const gsl_vector * x,
void* params, gsl_matrix * df);
102 int setFdf (
const gsl_vector * x,
void *params, gsl_vector * f, gsl_matrix * df);
104 gsl_multifit_function_fdf make_fdf (
int (* f) (
const gsl_vector *,
void *, gsl_vector *),
105 int (* df) (
const gsl_vector *,
void *, gsl_matrix *),
106 int (* fdf) (
const gsl_vector *,
void *, gsl_vector *, gsl_matrix *),
108 size_t p,
void * params );
113 #endif //BALL_HAS_GSL
115 #endif // BALL_QSAR_FITMODEL
BALL_EXTERN_VARIABLE const double c