1 /** @file fderivative.h
3 * Interface to abstract derivatives of functions. */
6 * GiNaC Copyright (C) 1999-2007 Johannes Gutenberg University Mainz, Germany
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 #ifndef __GINAC_FDERIVATIVE_H__
24 #define __GINAC_FDERIVATIVE_H__
33 typedef std::multiset<unsigned> paramset;
35 /** This class represents the (abstract) derivative of a symbolic function.
36 * It is used to represent the derivatives of functions that do not have
37 * a derivative or series expansion procedure defined. */
38 class fderivative : public function
40 GINAC_DECLARE_REGISTERED_CLASS(fderivative, function)
44 /** Construct derivative with respect to one parameter.
46 * @param ser Serial number of function
47 * @param param Number of parameter with respect to which to take the derivative
48 * @param args Arguments of derivative function */
49 fderivative(unsigned ser, unsigned param, const exvector & args);
51 /** Construct derivative with respect to multiple parameters.
53 * @param ser Serial number of function
54 * @param params Set of numbers of parameters with respect to which to take the derivative
55 * @param args Arguments of derivative function */
56 fderivative(unsigned ser, const paramset & params, const exvector & args);
58 // internal constructors
59 fderivative(unsigned ser, const paramset & params, std::auto_ptr<exvector> vp);
61 // functions overriding virtual functions from base classes
63 void print(const print_context & c, unsigned level = 0) const;
64 ex eval(int level = 0) const;
65 ex evalf(int level = 0) const;
66 ex series(const relational & r, int order, unsigned options = 0) const;
67 ex thiscontainer(const exvector & v) const;
68 ex thiscontainer(std::auto_ptr<exvector> vp) const;
70 ex derivative(const symbol & s) const;
71 bool is_equal_same_type(const basic & other) const;
72 bool match_same_type(const basic & other) const;
74 // non-virtual functions in this class
76 void do_print(const print_context & c, unsigned level) const;
77 void do_print_tree(const print_tree & c, unsigned level) const;
81 paramset parameter_set; /**< Set of parameter numbers with respect to which to take the derivative */
86 #endif // ndef __GINAC_DERIVATIVE_H__