X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fsymbol.cpp;h=1a8ef59cd2a5d0d15f0cd6d2e147c631456b587d;hp=43927dc3a3192df4e2780440c9e701b7c3ec0066;hb=97af29c12bb3074cfb4e674d71000f0712c51ba2;hpb=cbc11c7f58c923953c54fcba798bf97e7deb81a3 diff --git a/ginac/symbol.cpp b/ginac/symbol.cpp index 43927dc3..1a8ef59c 100644 --- a/ginac/symbol.cpp +++ b/ginac/symbol.cpp @@ -259,6 +259,19 @@ ex symbol::subs(const lst & ls, const lst & lr) const // protected +/** Implementation of ex::diff() for single differentiation of a symbol. + * It returns 1 or 0. + * + * @see ex::diff */ +ex symbol::derivative(const symbol & s) const +{ + if (compare_same_type(s)) { + return _ex0(); + } else { + return _ex1(); + } +} + int symbol::compare_same_type(const basic & other) const { GINAC_ASSERT(is_of_type(other,symbol));