Christian Bauer wrote:
Hi!
On Tue, Nov 18, 2003 at 06:20:30PM +0100, Kai Ludwig wrote:
dF/du = du/du * du/dx + u * d/du du/dx
thus, formally
dF/du = du/dx + u * d/dx
Here's something hacked together that achieves the desired effect for GiNaC 1.2 (treating the dx like a function):
const unsigned TINFO_differential = 0x42420001U;
DECLARE_FUNCTION_1P(dx)
// this is ad-hockery... static ex dx_deriv(const ex & a, unsigned diff_param) { return dx(1); }
REGISTER_FUNCTION(dx, derivative_func(dx_deriv). set_return_type(return_types::noncommutative, TINFO_differential))
int main() { symbol u("u", return_types::noncommutative, TINFO_differential); ex F = u * dx(u);
cout << F << endl; // "u*dx(u)" cout << F.diff(u) << endl; // "u*dx(1)+dx(u)" }
But I don't know if that's general enough for what you have in mind.
Bye, Christian
Danke ;-) I plan to use GiNaC in a few months within our project... Maybe then I can send you results/questions_hope_not Kai