Hey Ben,

I just looked out our wrapper class around fparser and it's got a lot of
extra stuff in it so it's not all that useful as a quick example here.  The
documentation is actually pretty good on their website and right near the
top they have a 4 line example that shows you how to get started:

http://warp.povusers.org/FunctionParser/fparser.html

    FunctionParser fp;
    fp.Parse("sqrt(x*x + y*y)", "x,y");
    double variables[2] = { 1.5, 2.9 };
    double result = fp.Eval(variables);

So basically you just need to call "Parse" then "Eval".  You can do all
sorts of cool things with adding constants, deducing variables etc. after
that but you'll just have to play with it a bit.

If you have any questions or would like to see our "ParsedFunction" wrapper
class let me know.
Cody


On Mon, Feb 6, 2012 at 10:53 AM, Roy Stogner <royst...@ices.utexas.edu>wrote:

>
> On Mon, 6 Feb 2012, Kirk, Benjamin (JSC-EG311) wrote:
>
> > Anyone got a snippet showing how to use the contributed fparser?
> >
> > We'd love to add that capability to some application code here...
>
> I'm going to put it into an example, but probably not until after the
> System::project_vector changes are committed.  That latter should be
> this afternoon or tonight unless anyone pipes up with a problem or
> objection.
> ---
> Roy
>
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Libmesh-devel mailing list
> Libmesh-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libmesh-devel
>
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to