Boost logo

Boost Users :

From: Joel FALCOU (joel.falcou_at_[hidden])
Date: 2008-05-04 10:44:38


Hicham Mouline a écrit :

> 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.

> 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.

-- 
Joel FALCOU
Research Engineer @ Institut d'Electronique Fondamentale
Université PARIS SUD XI
France

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