X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Finifcns_nstdsums.cpp;h=24a17a60a872a0ae72c7774f02b7589a26b1f53d;hp=d8c21f897564766b827628cd6c52f79f1112ff51;hb=1b8bcb068171ce9d5c8202ae3c76647b65c9a06d;hpb=cca88b51436e4b654d16a4d60cd0d1c66fcf5dd6 diff --git a/ginac/inifcns_nstdsums.cpp b/ginac/inifcns_nstdsums.cpp index d8c21f89..24a17a60 100644 --- a/ginac/inifcns_nstdsums.cpp +++ b/ginac/inifcns_nstdsums.cpp @@ -25,7 +25,7 @@ * 0, 1 and -1 --- or in compactified --- a string with zeros in front of 1 or -1 is written as a single * number --- notation. * - * - All functions can be nummerically evaluated with arguments in the whole complex plane. The parameters + * - All functions can be numerically evaluated with arguments in the whole complex plane. The parameters * for Li, zeta and S must be positive integers. If you want to have an alternating Euler sum, you have * to give the signs of the parameters as a second argument s to zeta(m,s) containing 1 and -1. * @@ -47,7 +47,7 @@ */ /* - * GiNaC Copyright (C) 1999-2014 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2015 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 @@ -1249,7 +1249,7 @@ ex mLi_numeric(const lst& m, const lst& x) static ex G2_evalf(const ex& x_, const ex& y) { - if (!y.info(info_flags::positive)) { + if ((!y.info(info_flags::numeric)) || (!y.info(info_flags::positive))) { return G(x_, y).hold(); } lst x = is_a(x_) ? ex_to(x_) : lst(x_); @@ -1292,7 +1292,7 @@ static ex G2_eval(const ex& x_, const ex& y) { //TODO eval to MZV or H or S or Lin - if (!y.info(info_flags::positive)) { + if ((!y.info(info_flags::numeric)) || (!y.info(info_flags::positive))) { return G(x_, y).hold(); } lst x = is_a(x_) ? ex_to(x_) : lst(x_); @@ -1341,10 +1341,10 @@ static ex G2_eval(const ex& x_, const ex& y) } +// option do_not_evalf_params() removed. unsigned G2_SERIAL::serial = function::register_new(function_options("G", 2). evalf_func(G2_evalf). eval_func(G2_eval). - do_not_evalf_params(). overloaded(2)); //TODO // derivative_func(G2_deriv). @@ -1353,7 +1353,7 @@ unsigned G2_SERIAL::serial = function::register_new(function_options("G", 2). static ex G3_evalf(const ex& x_, const ex& s_, const ex& y) { - if (!y.info(info_flags::positive)) { + if ((!y.info(info_flags::numeric)) || (!y.info(info_flags::positive))) { return G(x_, s_, y).hold(); } lst x = is_a(x_) ? ex_to(x_) : lst(x_); @@ -1417,7 +1417,7 @@ static ex G3_eval(const ex& x_, const ex& s_, const ex& y) { //TODO eval to MZV or H or S or Lin - if (!y.info(info_flags::positive)) { + if ((!y.info(info_flags::numeric)) || (!y.info(info_flags::positive))) { return G(x_, s_, y).hold(); } lst x = is_a(x_) ? ex_to(x_) : lst(x_); @@ -1487,10 +1487,12 @@ static ex G3_eval(const ex& x_, const ex& s_, const ex& y) } +// option do_not_evalf_params() removed. +// This is safe: in the code above it only matters if s_ > 0 or s_ < 0, +// s_ is allowed to be of floating type. unsigned G3_SERIAL::serial = function::register_new(function_options("G", 3). evalf_func(G3_evalf). eval_func(G3_eval). - do_not_evalf_params(). overloaded(2)); //TODO // derivative_func(G3_deriv).