]> www.ginac.de Git - ginac.git/blobdiff - ginac/ex.h
- ginac/operators.cpp: added some missing debugmsg()'s, which would have
[ginac.git] / ginac / ex.h
index 9f72ab55fd33f245d8e19fc62c005bbeaee7f842..c7e1da8cb538d097faf31e55292d76d177f7db02 100644 (file)
@@ -42,8 +42,6 @@ class lst;
 // are defined in utils.h and not visible from outside.
 extern const ex & _ex0(void);     //  single ex(numeric(0))
 
-// typedef vector<ex> exvector;
-
 #define INLINE_EX_CONSTRUCTORS
 
 /** Lightweight wrapper for GiNaC's symbolic objects.  Basically all it does is
@@ -123,6 +121,7 @@ public:
 ;
 #endif // def INLINE_EX_CONSTRUCTORS
 
+
     // other constructors
 public:
     ex(const basic & other)
@@ -197,6 +196,22 @@ public:
 ;
 #endif // def INLINE_EX_CONSTRUCTORS
 
+    /** Construct ex from string and a list of symbols. The input grammar is
+     *  similar to the GiNaC output format. All symbols to be used in the
+     *  expression must be specified in a lst in the second argument. Undefined
+     *  symbols and other parser errors will throw an exception. */
+    ex(const string &s, const ex &l)
+#ifdef INLINE_EX_CONSTRUCTORS
+        {
+            construct_from_string_and_lst(s, l);
+#ifdef OBSCURE_CINT_HACK
+            update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+        }
+#else
+;
+#endif // def INLINE_EX_CONSTRUCTORS
+
     
     // functions overriding virtual functions from bases classes
     // none
@@ -230,13 +245,14 @@ public:
     ex primpart(const symbol &x) const;
     ex primpart(const symbol &x, const ex &cont) const;
     ex normal(int level = 0) const;
+    ex to_rational(lst &repl_lst) const;
     ex smod(const numeric &xi) const;
     numeric max_coefficient(void) const;
     ex collect(const symbol & s) const;
     ex eval(int level = 0) const;
     ex evalf(int level = 0) const;
     ex diff(const symbol & s, unsigned nth = 1) const;
-    ex series(const symbol & s, const ex & point, int order = 6) const;
+    ex series(const ex & r, int order) const;
     ex subs(const lst & ls, const lst & lr) const;
     ex subs(const ex & e) const;
     exvector get_indices(void) const;
@@ -291,6 +307,7 @@ private:
     void construct_from_long(long i);
     void construct_from_ulong(unsigned long i);
     void construct_from_double(double d);
+    void construct_from_string_and_lst(const string &s, const ex &l);
     void makewriteable();
 
 #ifdef OBSCURE_CINT_HACK
@@ -363,6 +380,9 @@ inline ex denom(const ex & thisex)
 inline ex normal(const ex & thisex, int level=0)
 { return thisex.normal(level); }
 
+inline ex to_rational(const ex & thisex, lst & repl_lst)
+{ return thisex.to_rational(repl_lst); }
+
 inline ex collect(const ex & thisex, const symbol & s)
 { return thisex.collect(s); }
 
@@ -375,8 +395,8 @@ inline ex evalf(const ex & thisex, int level = 0)
 inline ex diff(const ex & thisex, const symbol & s, unsigned nth = 1)
 { return thisex.diff(s, nth); }
 
-inline ex series(const ex & thisex, const symbol & s, const ex & point, int order = 6)
-{ return thisex.series(s, point, order); }
+inline ex series(const ex & thisex, const ex & r, int order)
+{ return thisex.series(r, order); }
 
 inline ex subs(const ex & thisex, const ex & e)
 { return thisex.subs(e); }