]> www.ginac.de Git - ginac.git/blobdiff - ginac/function.cpp
- ASSERT macro renamed to GINAC_ASSERT
[ginac.git] / ginac / function.cpp
index 33bfd5f30a31bd3dc6c2582025b58826f924f6c2..3ae0287e61c19058e39d9f0ac8736a600e121619 100644 (file)
@@ -1,15 +1,37 @@
 /** @file function.cpp
  *
- *  Implementation of class function.
- *
+ *  Implementation of class function. */
+
+/*
  *  This file was generated automatically by function.pl.
  *  Please do not modify it directly, edit the perl script instead!
- *  function.pl options: $maxargs=10 */
+ *  function.pl options: $maxargs=10
+ *
+ *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 #include <string>
 #include <stdexcept>
 
-#include "ginac.h"
+#include "function.h"
+#include "ex.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -20,7 +42,7 @@
 function::function() : serial(0)
 {
     debugmsg("function default constructor",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 
 function::~function()
@@ -67,7 +89,7 @@ void function::destroy(bool call_parent)
 function::function(unsigned ser) : serial(ser)
 {
     debugmsg("function constructor from unsigned",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 
 // the following lines have been generated for max. 10 parameters
@@ -75,61 +97,61 @@ function::function(unsigned ser, ex const & param1)
     : exprseq(param1), serial(ser)
 {
     debugmsg("function constructor from unsigned,1*ex",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 function::function(unsigned ser, ex const & param1, ex const & param2)
     : exprseq(param1, param2), serial(ser)
 {
     debugmsg("function constructor from unsigned,2*ex",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 function::function(unsigned ser, ex const & param1, ex const & param2, ex const & param3)
     : exprseq(param1, param2, param3), serial(ser)
 {
     debugmsg("function constructor from unsigned,3*ex",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 function::function(unsigned ser, ex const & param1, ex const & param2, ex const & param3, ex const & param4)
     : exprseq(param1, param2, param3, param4), serial(ser)
 {
     debugmsg("function constructor from unsigned,4*ex",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 function::function(unsigned ser, ex const & param1, ex const & param2, ex const & param3, ex const & param4, ex const & param5)
     : exprseq(param1, param2, param3, param4, param5), serial(ser)
 {
     debugmsg("function constructor from unsigned,5*ex",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 function::function(unsigned ser, ex const & param1, ex const & param2, ex const & param3, ex const & param4, ex const & param5, ex const & param6)
     : exprseq(param1, param2, param3, param4, param5, param6), serial(ser)
 {
     debugmsg("function constructor from unsigned,6*ex",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 function::function(unsigned ser, ex const & param1, ex const & param2, ex const & param3, ex const & param4, ex const & param5, ex const & param6, ex const & param7)
     : exprseq(param1, param2, param3, param4, param5, param6, param7), serial(ser)
 {
     debugmsg("function constructor from unsigned,7*ex",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 function::function(unsigned ser, ex const & param1, ex const & param2, ex const & param3, ex const & param4, ex const & param5, ex const & param6, ex const & param7, ex const & param8)
     : exprseq(param1, param2, param3, param4, param5, param6, param7, param8), serial(ser)
 {
     debugmsg("function constructor from unsigned,8*ex",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 function::function(unsigned ser, ex const & param1, ex const & param2, ex const & param3, ex const & param4, ex const & param5, ex const & param6, ex const & param7, ex const & param8, ex const & param9)
     : exprseq(param1, param2, param3, param4, param5, param6, param7, param8, param9), serial(ser)
 {
     debugmsg("function constructor from unsigned,9*ex",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 function::function(unsigned ser, ex const & param1, ex const & param2, ex const & param3, ex const & param4, ex const & param5, ex const & param6, ex const & param7, ex const & param8, ex const & param9, ex const & param10)
     : exprseq(param1, param2, param3, param4, param5, param6, param7, param8, param9, param10), serial(ser)
 {
     debugmsg("function constructor from unsigned,10*ex",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 
 // end of generated lines
@@ -137,21 +159,21 @@ function::function(unsigned ser, ex const & param1, ex const & param2, ex const
 function::function(unsigned ser, exprseq const & es) : exprseq(es), serial(ser)
 {
     debugmsg("function constructor from unsigned,exprseq",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 
 function::function(unsigned ser, exvector const & v, bool discardable) 
     : exprseq(v,discardable), serial(ser)
 {
     debugmsg("function constructor from string,exvector,bool",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 
 function::function(unsigned ser, exvector * vp) 
     : exprseq(vp), serial(ser)
 {
     debugmsg("function constructor from unsigned,exvector *",LOGLEVEL_CONSTRUCT);
-    tinfo_key = TINFO_FUNCTION;
+    tinfo_key = TINFO_function;
 }
 
 //////////
@@ -170,7 +192,7 @@ void function::printraw(ostream & os) const
 {
     debugmsg("function printraw",LOGLEVEL_PRINT);
 
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     os << "function(name=" << registered_functions()[serial].name;
     for (exvector::const_iterator it=seq.begin(); it!=seq.end(); ++it) {
@@ -184,7 +206,7 @@ void function::print(ostream & os, unsigned upper_precedence) const
 {
     debugmsg("function print",LOGLEVEL_PRINT);
 
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     os << registered_functions()[serial].name;
     printseq(os,'(',',',')',exprseq::precedence,function::precedence);
@@ -194,7 +216,7 @@ void function::printtree(ostream & os, unsigned indent) const
 {
     debugmsg("function printtree",LOGLEVEL_PRINT);
 
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     os << string(indent,' ') << "function "
        << registered_functions()[serial].name
@@ -211,7 +233,7 @@ void function::printcsrc(ostream & os, unsigned type, unsigned upper_precedence)
 {
     debugmsg("function print csrc",LOGLEVEL_PRINT);
 
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
        // Print function name in lowercase
     string lname;
@@ -239,7 +261,7 @@ ex function::expand(unsigned options) const
 
 ex function::eval(int level) const
 {
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     exvector eseq=evalchildren(level);    
 
@@ -286,7 +308,7 @@ ex function::eval(int level) const
 
 ex function::evalf(int level) const
 {
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     exvector eseq=evalfchildren(level);
     
@@ -345,7 +367,7 @@ ex function::thisexprseq(exvector * vp) const
  *  @see ex::series */
 ex function::series(symbol const & s, ex const & point, int order) const
 {
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     if (registered_functions()[serial].s==0) {
         return basic::series(s, point, order);
@@ -392,7 +414,7 @@ ex function::series(symbol const & s, ex const & point, int order) const
 
 int function::compare_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other, function));
+    GINAC_ASSERT(is_of_type(other, function));
     function const & o=static_cast<function &>(const_cast<basic &>(other));
 
     if (serial!=o.serial) {
@@ -403,7 +425,7 @@ int function::compare_same_type(basic const & other) const
 
 bool function::is_equal_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other, function));
+    GINAC_ASSERT(is_of_type(other, function));
     function const & o=static_cast<function &>(const_cast<basic &>(other));
 
     if (serial!=o.serial) return false;
@@ -440,7 +462,7 @@ unsigned function::return_type_tinfo(void) const
 
 ex function::pdiff(unsigned diff_param) const // partial differentiation
 {
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
     
     if (registered_functions()[serial].d==0) {
         throw(std::logic_error(string("function::pdiff(") + registered_functions()[serial].name + "): no diff function defined"));
@@ -588,3 +610,5 @@ unsigned function::register_new(char const * nm, eval_funcp_10 e,
 const function some_function;
 type_info const & typeid_function=typeid(some_function);
 
+} // namespace GiNaC
+