Boost logo

Boost Users :

From: Hicham Mouline (hicham_at_[hidden])
Date: 2008-05-04 14:39:55


>> I have written a small set of templates to represent a 1-variable real
>> mathematical function, with the help of "expression templates",
>> mentioned in blitz++ for arrays, and a simple metafunction to calculate
the
>> symbolic derivative.
>The shortest path could be to use Boost::Proto to leverage your
>expression templates implementation. Once your abstract syntax tree is
>built through compile time evaluation, a proto transformation of the AST
>can take care of building the symbolic derivative.
>Boost::proto is available at the vault IIRC.
Thank you. I will read the docs. It seems Boost::proto will do the
derivation for me,
while I still have to write the AST myself.
This AST, isn't there already some boost implementation of it somewhere?
After all, writing symbolic mathematical functions would seem to me
something many users require.

>> Is there any way to represent floating points while staying totally
>> compile-time?
>Is your derivative compution NEEDED to be performaed at compile-time ?
>AS I envision it, best way should be to have your ET code generate a new
>AST representing the derivative, build a function object out of it and
>makign it callable on runtime value by the user.
Performance is first factor for the code I am writing, so I am trying to run
as much as possible at compile-time, as a matter of principle.
But I guess making a function object out of the AST will be cheap.
I will now move the literals from the compile-time to the run-time world,
and will get all numeric types then.

Regards,


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net