]> www.ginac.de Git - ginac.git/blobdiff - ginac/basic.cpp
Added integral class.
[ginac.git] / ginac / basic.cpp
index 98ba54d244cf19d12b143c4ae19d0f8d3d27fd0e..c37ed3e3ded529a816ab82189da3f6fd42deeafa 100644 (file)
@@ -482,6 +482,20 @@ ex basic::evalm() const
                return map(map_evalm);
 }
 
+/** Function object to be applied by basic::eval_integ(). */
+struct eval_integ_map_function : public map_function {
+       ex operator()(const ex & e) { return eval_integ(e); }
+} map_eval_integ;
+
+/** Evaluate integrals, if result is known. */
+ex basic::eval_integ() const
+{
+       if (nops() == 0)
+               return *this;
+       else
+               return map(map_eval_integ);
+}
+
 /** Perform automatic symbolic evaluations on indexed expression that
  *  contains this object as the base expression. */
 ex basic::eval_indexed(const basic & i) const