]> www.ginac.de Git - ginac.git/blobdiff - ginac/function.pl
Allow user defined functions to be parsed.
[ginac.git] / ginac / function.pl
index a866b7e35f557a8deb06da4b39cf47dd9fc3274b..495432bbff3cd4e8d8fc8b56550a22f474f1a149 100644 (file)
@@ -536,7 +536,6 @@ public:
        static unsigned register_new(function_options const & opt);
        static unsigned current_serial;
        static unsigned find_function(const std::string &name, unsigned nparams);
-       static std::vector<function_options> get_registered_functions() { return registered_functions(); };
        unsigned get_serial() const {return serial;}
        std::string get_name() const;
 
@@ -1122,7 +1121,7 @@ ex function::conjugate() const
        const function_options & opt = registered_functions()[serial];
 
        if (opt.conjugate_f==0) {
-               return exprseq::conjugate();
+               return conjugate_function(*this).hold();
        }
 
        if (opt.conjugate_use_exvector_args) {
@@ -1389,7 +1388,9 @@ unsigned function::find_function(const std::string &name, unsigned nparams)
 /** Return the print name of the function. */
 std::string function::get_name() const
 {
-       GINAC_ASSERT(serial<registered_functions().size());
+       if ( serial >= registered_functions().size() ) {
+               throw std::runtime_error("unknown function");
+       }
        return registered_functions()[serial].name;
 }