This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libevaluator library and GSL


I've written a library
(http://savannah.nongnu.org/projects/libevaluator/) that makes possible
to parse strings representing mathematical functions over single or
multiple variables and later to evaluate these functions for different
variable values (also to create representation of function derivative
over specified variable etc.).  I've submitted this library for
evaluation regarding inclusion in GNU project and was told by my
evaluator that they would rather like to see my library as part of GSL
than to publish it as separate library.  My library is written in C, but
offers also Fortran 77 and Gule interfaces (as well as Fortran 90
interface).  Note also that my library has simple interface that I could
easily change to behave in spirit of GSL.  Something that could make it
possible to write code like this:

  gsl_integration_workspace * w = gsl_integration_workspace_alloc (1000);
  gsl_function F;
  double result, error;
  gsl_evaluator *evaluator; /* type provided by my library */

  evaluator = gsl_evaluator_create("x^7-3*x^2+x");
  F.function = &gsl_evaluator_evaluate_x; /* function provided by my library */
  F.params = evaluator;
  gsl_integration_qags (&F, 0, 1, 0, 1e-7, 1000, w, &result, &error);

  /* now interested in integrating function derivative (just for fun)? */
  F.params = evaluator_derivative_x (evaluator);
  gsl_integration_qags (&F, 0, 1, 0, 1e-7, 1000, w, &result, &error);

So, main idea is to have user to provide string representing
mathematical function instead of to write C function representing
mathematical function.  Any interest for alike functionality in GSL?

Regards,
Alex


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]