]> www.ginac.de Git - ginac.git/blobdiff - ginac/function.pl
Allow user defined functions to be parsed.
[ginac.git] / ginac / function.pl
index 4db801bb652abc610154857e9b4d5ff6eaca16d8..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) {
@@ -1312,8 +1311,8 @@ ex function::power(const ex & power_param) const // power of function
        
        // No derivative defined? Then return abstract derivative object
        if (opt.power_f == NULL)
-               return (new power::power(*this, power_param))->setflag(status_flags::dynallocated |
-                                                      status_flags::evaluated);
+               return (new GiNaC::power(*this, power_param))->setflag(status_flags::dynallocated |
+                                                                      status_flags::evaluated);
 
        current_serial = serial;
        if (opt.power_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;
 }