]> www.ginac.de Git - ginac.git/blobdiff - ginac/inifcns.cpp
- removed inert Diff() function; only Derivative() remains
[ginac.git] / ginac / inifcns.cpp
index 55da24d052de66e3559a5469a87f57b8b0883d56..fcf2d05dc088052d60e7d12f9e577b7a103cd4f9 100644 (file)
@@ -166,9 +166,28 @@ static ex Order_series(const ex & x, const symbol & s, const ex & point, int ord
        return pseries(s, point, new_seq);
 }
 
+// Differentiation is handled in function::derivative because of its special requirements
+
 REGISTER_FUNCTION(Order, eval_func(Order_eval).
                          series_func(Order_series));
 
+//////////
+// Inert partial differentiation operator
+//////////
+
+static ex Derivative_eval(const ex & f, const ex & l)
+{
+       if (!is_ex_exactly_of_type(f, function)) {
+        throw(std::invalid_argument("Derivative(): 1st argument must be a function"));
+       }
+    if (!is_ex_exactly_of_type(l, lst)) {
+        throw(std::invalid_argument("Derivative(): 2nd argument must be a list"));
+    }
+       return Derivative(f, l).hold();
+}
+
+REGISTER_FUNCTION(Derivative, eval_func(Derivative_eval));
+
 //////////
 // Solve linear system
 //////////
@@ -280,7 +299,7 @@ ex ncpower(const ex &basis, unsigned exponent)
 
 /** Force inclusion of functions from initcns_gamma and inifcns_zeta
  *  for static lib (so ginsh will see them). */
-unsigned force_include_gamma = function_index_gamma;
+unsigned force_include_gamma = function_index_Gamma;
 unsigned force_include_zeta1 = function_index_zeta1;
 
 #ifndef NO_NAMESPACE_GINAC