]> www.ginac.de Git - ginac.git/blobdiff - ginac/function.pl
- renamed
[ginac.git] / ginac / function.pl
index 947830c4b1724c18487fffd537776efca84a1e15..d381ea69f3754ab68e5b21e7ba416d05f177c690 100755 (executable)
@@ -362,7 +362,8 @@ protected:
 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
 
@@ -377,7 +378,7 @@ inline const function &ex_to_function(const ex &e)
 }
 
 #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
 
@@ -957,6 +958,13 @@ unsigned function::find_function(const std::string &name, unsigned nparams)
        throw (std::runtime_error("no function '" + name + "' with " + ToString(nparams) + " parameters defined"));
 }
 
+/** Return the print name of the function. */
+std::string function::get_name(void) const
+{
+       GINAC_ASSERT(serial<registered_functions().size());
+       return registered_functions()[serial].name;
+}
+
 } // namespace GiNaC
 
 END_OF_IMPLEMENTATION