]> www.ginac.de Git - ginac.git/commitdiff
- renamed
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Mon, 9 Apr 2001 01:08:35 +0000 (01:08 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Mon, 9 Apr 2001 01:08:35 +0000 (01:08 +0000)
    function::getserial() -> function::get_serial()
    symbol::setname() -> symbol::set_name()
    symbol::getname() -> symbol::get_name()
  for consistency (since the interface has changed anyway)
- added pseries::get_var() and pseries::get_point()

ginac/function.pl
ginac/pseries.cpp
ginac/pseries.h
ginac/symbol.h

index b6c15814bb97e091f00044a0399a2ddd6ea69283..d381ea69f3754ab68e5b21e7ba416d05f177c690 100755 (executable)
@@ -362,7 +362,7 @@ protected:
 public:
        static unsigned register_new(function_options const & opt);
        static unsigned find_function(const std::string &name, unsigned nparams);
 public:
        static unsigned register_new(function_options const & opt);
        static unsigned find_function(const std::string &name, unsigned nparams);
-       unsigned getserial(void) const {return serial;}
+       unsigned get_serial(void) const {return serial;}
        std::string get_name(void) const;
        
 // member variables
        std::string get_name(void) const;
        
 // member variables
@@ -378,7 +378,7 @@ inline const function &ex_to_function(const ex &e)
 }
 
 #define is_ex_the_function(OBJ, FUNCNAME) \\
 }
 
 #define is_ex_the_function(OBJ, FUNCNAME) \\
-       (is_ex_exactly_of_type(OBJ, function) && static_cast<GiNaC::function *>(OBJ.bp)->getserial() == function_index_##FUNCNAME)
+       (is_ex_exactly_of_type(OBJ, function) && static_cast<GiNaC::function *>(OBJ.bp)->get_serial() == function_index_##FUNCNAME)
 
 } // namespace GiNaC
 
 
 } // namespace GiNaC
 
index a4f96d97113e4a51d4bc449f1aa915d09fd12774..789d7671b33d633e1bfa5e2831e00e171de64ceb 100644 (file)
@@ -230,7 +230,6 @@ unsigned pseries::nops(void) const
        return seq.size();
 }
 
        return seq.size();
 }
 
-
 /** Return the ith term in the series when represented as a sum. */
 ex pseries::op(int i) const
 {
 /** Return the ith term in the series when represented as a sum. */
 ex pseries::op(int i) const
 {
@@ -239,13 +238,11 @@ ex pseries::op(int i) const
        return seq[i].rest * power(var - point, seq[i].coeff);
 }
 
        return seq[i].rest * power(var - point, seq[i].coeff);
 }
 
-
 ex &pseries::let_op(int i)
 {
        throw (std::logic_error("let_op not defined for pseries"));
 }
 
 ex &pseries::let_op(int i)
 {
        throw (std::logic_error("let_op not defined for pseries"));
 }
 
-
 /** Return degree of highest power of the series.  This is usually the exponent
  *  of the Order term.  If s is not the expansion variable of the series, the
  *  series is examined termwise. */
 /** Return degree of highest power of the series.  This is usually the exponent
  *  of the Order term.  If s is not the expansion variable of the series, the
  *  series is examined termwise. */
@@ -344,7 +341,6 @@ ex pseries::collect(const ex &s) const
        return *this;
 }
 
        return *this;
 }
 
-
 /** Evaluate coefficients. */
 ex pseries::eval(int level) const
 {
 /** Evaluate coefficients. */
 ex pseries::eval(int level) const
 {
@@ -365,7 +361,6 @@ ex pseries::eval(int level) const
        return (new pseries(relational(var,point), new_seq))->setflag(status_flags::dynallocated | status_flags::evaluated);
 }
 
        return (new pseries(relational(var,point), new_seq))->setflag(status_flags::dynallocated | status_flags::evaluated);
 }
 
-
 /** Evaluate coefficients numerically. */
 ex pseries::evalf(int level) const
 {
 /** Evaluate coefficients numerically. */
 ex pseries::evalf(int level) const
 {
@@ -386,7 +381,6 @@ ex pseries::evalf(int level) const
        return (new pseries(relational(var,point), new_seq))->setflag(status_flags::dynallocated | status_flags::evaluated);
 }
 
        return (new pseries(relational(var,point), new_seq))->setflag(status_flags::dynallocated | status_flags::evaluated);
 }
 
-
 ex pseries::subs(const lst & ls, const lst & lr) const
 {
        // If expansion variable is being substituted, convert the series to a
 ex pseries::subs(const lst & ls, const lst & lr) const
 {
        // If expansion variable is being substituted, convert the series to a
@@ -407,7 +401,6 @@ ex pseries::subs(const lst & ls, const lst & lr) const
        return (new pseries(relational(var,point.subs(ls, lr)), newseq))->setflag(status_flags::dynallocated);
 }
 
        return (new pseries(relational(var,point.subs(ls, lr)), newseq))->setflag(status_flags::dynallocated);
 }
 
-
 /** Implementation of ex::expand() for a power series.  It expands all the
  *  terms individually and returns the resulting series as a new pseries. */
 ex pseries::expand(unsigned options) const
 /** Implementation of ex::expand() for a power series.  It expands all the
  *  terms individually and returns the resulting series as a new pseries. */
 ex pseries::expand(unsigned options) const
@@ -422,7 +415,6 @@ ex pseries::expand(unsigned options) const
                ->setflag(status_flags::dynallocated | status_flags::expanded);
 }
 
                ->setflag(status_flags::dynallocated | status_flags::expanded);
 }
 
-
 /** Implementation of ex::diff() for a power series.  It treats the series as a
  *  polynomial.
  *  @see ex::diff */
 /** Implementation of ex::diff() for a power series.  It treats the series as a
  *  polynomial.
  *  @see ex::diff */
@@ -449,10 +441,6 @@ ex pseries::derivative(const symbol & s) const
        }
 }
 
        }
 }
 
-
-/** Convert a pseries object to an ordinary polynomial.
- *
- *  @param no_order flag: discard higher order terms */
 ex pseries::convert_to_poly(bool no_order) const
 {
        ex e;
 ex pseries::convert_to_poly(bool no_order) const
 {
        ex e;
@@ -469,9 +457,6 @@ ex pseries::convert_to_poly(bool no_order) const
        return e;
 }
 
        return e;
 }
 
-
-/** Returns true if there is no order term, i.e. the series terminates and
- *  false otherwise. */
 bool pseries::is_terminating(void) const
 {
        return seq.size() == 0 || !is_order_function((seq.end()-1)->rest);
 bool pseries::is_terminating(void) const
 {
        return seq.size() == 0 || !is_order_function((seq.end()-1)->rest);
index 77b55fe862b1416b762348b2b52a5db4f59cc727..94646cb6ba0d5729d52b4fc562b863d8ba8cebf4 100644 (file)
@@ -61,10 +61,28 @@ protected:
 
        // non-virtual functions in this class
 public:
 
        // non-virtual functions in this class
 public:
+       /** Get the expansion variable. */
+       ex get_var(void) const {return var;}
+
+       /** Get the expansion point. */
+       ex get_point(void) const {return point;}
+
+       /** Convert the pseries object to an ordinary polynomial.
+        *
+        *  @param no_order flag: discard higher order terms */
        ex convert_to_poly(bool no_order = false) const;
        ex convert_to_poly(bool no_order = false) const;
-       bool is_compatible_to(const pseries &other) const {return var.compare(other.var) == 0 && point.compare(other.point) == 0;}
+
+       /** Check whether series is compatible to another series (expansion
+        *  variable and point are the same. */
+       bool is_compatible_to(const pseries &other) const {return var.is_equal(other.var) && point.is_equal(other.point);}
+
+       /** Check whether series has the value zero. */
        bool is_zero(void) const {return seq.size() == 0;}
        bool is_zero(void) const {return seq.size() == 0;}
+
+       /** Returns true if there is no order term, i.e. the series terminates and
+        *  false otherwise. */
        bool is_terminating(void) const;
        bool is_terminating(void) const;
+
        ex add_series(const pseries &other) const;
        ex mul_const(const numeric &other) const;
        ex mul_series(const pseries &other) const;
        ex add_series(const pseries &other) const;
        ex mul_const(const numeric &other) const;
        ex mul_series(const pseries &other) const;
index cda3e736fb647fa9e1367e445afbd0c6573ad9e4..1f494cf2c5ceb4f8ea2fe1d3630df82564c75ec0 100644 (file)
@@ -95,8 +95,8 @@ protected:
 public:
        void assign(const ex & value);
        void unassign(void);
 public:
        void assign(const ex & value);
        void unassign(void);
-       void setname(const std::string & n) { name = n; }
-       std::string getname(void) const { return name; }
+       void set_name(const std::string & n) { name = n; }
+       std::string get_name(void) const { return name; }
 private:
        std::string & autoname_prefix(void);
 
 private:
        std::string & autoname_prefix(void);