Add fderivative::derivatives() method.
authorRichard Kreckel <kreckel@ginac.de>
Thu, 14 Apr 2016 19:29:37 +0000 (21:29 +0200)
committerRichard Kreckel <kreckel@ginac.de>
Thu, 14 Apr 2016 19:32:01 +0000 (21:32 +0200)
NEWS
ginac/fderivative.cpp
ginac/fderivative.h

diff --git a/NEWS b/NEWS
index aa6d33c..fba9480 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ This file records noteworthy changes.
   modeled after the .eval() methods.
 * Make relational::rhs() and lhs() nonvirtual.
 * Add support for power::info(info_flags::real).
+* Add fderivative::derivatives() method.
 * Remove broken info_flags::algebraic.
 * Remove unmaintained support for Cint.
 * Remove unfinished andcode for hash table-based expairseq.
index 9e3c981..2ce60fb 100644 (file)
@@ -215,4 +215,20 @@ bool fderivative::match_same_type(const basic & other) const
        return parameter_set == o.parameter_set && inherited::match_same_type(other);
 }
 
+/** Expose this object's derivative structure.
+ *
+ *  Parameter numbers occurring more than once stand for repeated
+ *  differentiation with respect to that parameter. If a symbolic function
+ *  f(x,y) is differentiated with respect to x, this method will return {0}.
+ *  If f(x,y) is differentiated twice with respect to y, it will return {1,1}.
+ *  (This corresponds to the way this object is printed.)
+ *
+ *  @return  multiset of function's parameter numbers that are abstractly
+ *  differentiated. */
+const paramset& fderivative::derivatives() const
+{
+       return parameter_set;
+}
+
+
 } // namespace GiNaC
index 70f65ec..fe7abe8 100644 (file)
@@ -72,6 +72,8 @@ protected:
        bool match_same_type(const basic & other) const override;
 
        // non-virtual functions in this class
+public:
+       const paramset& derivatives() const;
 protected:
        void do_print(const print_context & c, unsigned level) const;
        void do_print_csrc(const print_csrc & c, unsigned level) const;