]> www.ginac.de Git - ginac.git/blobdiff - ginsh/ginsh_parser.yy
- Banned exZERO(), exONE(), exMINUSHALF() and all this from the interface.
[ginac.git] / ginsh / ginsh_parser.yy
index f8702d2aea4b7640eb24c5933353ccc4b8b6bc24..0134ab15ced455d8a4786d47fdd6d4a0bac995a9 100644 (file)
@@ -242,7 +242,6 @@ static void push(const ex &e)
  *  Built-in functions
  */
 
  *  Built-in functions
  */
 
-static ex f_beta(const exprseq &e) {return gamma(e[0])*gamma(e[1])/gamma(e[0]+e[1]);}
 static ex f_denom(const exprseq &e) {return e[0].denom();}
 static ex f_eval1(const exprseq &e) {return e[0].eval();}
 static ex f_evalf1(const exprseq &e) {return e[0].evalf();}
 static ex f_denom(const exprseq &e) {return e[0].denom();}
 static ex f_eval1(const exprseq &e) {return e[0].eval();}
 static ex f_evalf1(const exprseq &e) {return e[0].evalf();}
@@ -342,7 +341,7 @@ static ex f_evalf2(const exprseq &e)
 
 static ex f_has(const exprseq &e)
 {
 
 static ex f_has(const exprseq &e)
 {
-       return e[0].has(e[1]) ? exONE() : exZERO();
+       return e[0].has(e[1]) ? ex(1) : ex(0);
 }
 
 static ex f_inverse(const exprseq &e)
 }
 
 static ex f_inverse(const exprseq &e)
@@ -354,7 +353,7 @@ static ex f_inverse(const exprseq &e)
 static ex f_is(const exprseq &e)
 {
        CHECK_ARG(0, relational, is);
 static ex f_is(const exprseq &e)
 {
        CHECK_ARG(0, relational, is);
-       return (bool)ex_to_relational(e[0]) ? exONE() : exZERO();
+       return (bool)ex_to_relational(e[0]) ? ex(1) : ex(0);
 }
 
 static ex f_lcoeff(const exprseq &e)
 }
 
 static ex f_lcoeff(const exprseq &e)
@@ -411,7 +410,7 @@ static ex f_rem(const exprseq &e)
 static ex f_series2(const exprseq &e)
 {
        CHECK_ARG(1, symbol, series);
 static ex f_series2(const exprseq &e)
 {
        CHECK_ARG(1, symbol, series);
-       return e[0].series(ex_to_symbol(e[1]), exZERO());
+       return e[0].series(ex_to_symbol(e[1]), ex(0));
 }
 
 static ex f_series3(const exprseq &e)
 }
 
 static ex f_series3(const exprseq &e)
@@ -483,7 +482,6 @@ struct fcn_init {
 };
 
 static const fcn_init builtin_fcns[] = {
 };
 
 static const fcn_init builtin_fcns[] = {
-       {"beta", fcn_desc(f_beta, 2)},
        {"charpoly", fcn_desc(f_charpoly, 2)},
        {"coeff", fcn_desc(f_coeff, 3)},
        {"collect", fcn_desc(f_collect, 2)},
        {"charpoly", fcn_desc(f_charpoly, 2)},
        {"coeff", fcn_desc(f_coeff, 3)},
        {"collect", fcn_desc(f_collect, 2)},
@@ -554,7 +552,11 @@ static ex f_ginac_function(const exprseq &es, int serial)
 }
 
 // All registered GiNaC functions
 }
 
 // All registered GiNaC functions
+#ifndef NO_GINAC_NAMESPACE
 void GiNaC::ginsh_get_ginac_functions(void)
 void GiNaC::ginsh_get_ginac_functions(void)
+#else // ndef NO_GINAC_NAMESPACE
+void ginsh_get_ginac_functions(void)
+#endif // ndef NO_GINAC_NAMESPACE
 {
        vector<registered_function_info>::const_iterator i = function::registered_functions().begin(), end = function::registered_functions().end();
        unsigned serial = 0;
 {
        vector<registered_function_info>::const_iterator i = function::registered_functions().begin(), end = function::registered_functions().end();
        unsigned serial = 0;
@@ -675,7 +677,7 @@ static ex lst2matrix(const ex &l)
                        if (l.op(i).nops() > j)
                                m.set(i, j, l.op(i).op(j));
                        else
                        if (l.op(i).nops() > j)
                                m.set(i, j, l.op(i).op(j));
                        else
-                               m.set(i, j, exZERO());
+                               m.set(i, j, ex(0));
        return m;
 }
 
        return m;
 }
 
@@ -755,8 +757,10 @@ int main(int argc, char **argv)
        insert_fcn_help("atan", "inverse tangent function");
        insert_fcn_help("atan2", "inverse tangent function with two arguments");
        insert_fcn_help("atanh", "inverse hyperbolic tangent function");
        insert_fcn_help("atan", "inverse tangent function");
        insert_fcn_help("atan2", "inverse tangent function with two arguments");
        insert_fcn_help("atanh", "inverse hyperbolic tangent function");
+       insert_fcn_help("beta", "beta function");
        insert_fcn_help("cos", "cosine function");
        insert_fcn_help("cosh", "hyperbolic cosine function");
        insert_fcn_help("cos", "cosine function");
        insert_fcn_help("cosh", "hyperbolic cosine function");
+       insert_fcn_help("psi", "polygamma function");
        insert_fcn_help("sin", "sine function");
        insert_fcn_help("sinh", "hyperbolic sine function");
        insert_fcn_help("tan", "tangent function");
        insert_fcn_help("sin", "sine function");
        insert_fcn_help("sinh", "hyperbolic sine function");
        insert_fcn_help("tan", "tangent function");