]> www.ginac.de Git - ginac.git/blobdiff - ginac/function.pl
Make the behaviour of class function more consistent with respect to
[ginac.git] / ginac / function.pl
index e91278c6b2ab107ba8909903aa8db274acea4340..3e447354d814d87c1a04e71f2f71e99c4e6106e3 100644 (file)
@@ -507,6 +507,7 @@ public:
        ex expand(unsigned options=0) const;
        ex eval(int level=0) const;
        ex evalf(int level=0) const;
+       ex eval_ncmul(const exvector & v) const;
        unsigned calchash() const;
        ex series(const relational & r, int order, unsigned options = 0) const;
        ex thiscontainer(const exvector & v) const;
@@ -1053,6 +1054,16 @@ ${evalf_switch_statement}
        throw(std::logic_error("function::evalf(): invalid nparams"));
 }
 
+/**
+ *  This method is defined to be in line with behaviour of function::return_type()
+ */
+ex function::eval_ncmul(const exvector & v) const
+{
+       // If this function is called then the list of arguments is non-empty
+       // and the first argument is non-commutative, see  function::return_type()
+       return seq.begin()->eval_ncmul(v);
+}
+
 unsigned function::calchash() const
 {
        unsigned v = golden_ratio_hash(golden_ratio_hash((p_int)tinfo()) ^ serial);