]> www.ginac.de Git - ginac.git/commitdiff
* zeta(n,x) is now zetaderiv(n,s)
authorJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Mon, 17 Nov 2003 22:16:08 +0000 (22:16 +0000)
committerJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Mon, 17 Nov 2003 22:16:08 +0000 (22:16 +0000)
ginac/Makefile.am
ginac/inifcns.cpp
ginac/inifcns.h
ginac/inifcns_zeta.cpp [deleted file]

index 520ca4b6fbe80cdcec3cf71b9ba328f198249534..6b6604d6a385b2962604e605d596af621e1f2565 100644 (file)
@@ -4,7 +4,7 @@ lib_LTLIBRARIES = libginac.la
 libginac_la_SOURCES = add.cpp archive.cpp basic.cpp clifford.cpp color.cpp \
   constant.cpp ex.cpp expair.cpp expairseq.cpp exprseq.cpp fail.cpp \
   fderivative.cpp function.cpp idx.cpp indexed.cpp inifcns.cpp \
 libginac_la_SOURCES = add.cpp archive.cpp basic.cpp clifford.cpp color.cpp \
   constant.cpp ex.cpp expair.cpp expairseq.cpp exprseq.cpp fail.cpp \
   fderivative.cpp function.cpp idx.cpp indexed.cpp inifcns.cpp \
-  inifcns_trans.cpp inifcns_zeta.cpp inifcns_gamma.cpp inifcns_nstdsums.cpp \
+  inifcns_trans.cpp inifcns_gamma.cpp inifcns_nstdsums.cpp \
   lst.cpp matrix.cpp mul.cpp ncmul.cpp normal.cpp numeric.cpp operators.cpp \
   power.cpp registrar.cpp relational.cpp remember.cpp pseries.cpp print.cpp \
   structure.cpp symbol.cpp symmetry.cpp tensor.cpp utils.cpp wildcard.cpp \
   lst.cpp matrix.cpp mul.cpp ncmul.cpp normal.cpp numeric.cpp operators.cpp \
   power.cpp registrar.cpp relational.cpp remember.cpp pseries.cpp print.cpp \
   structure.cpp symbol.cpp symmetry.cpp tensor.cpp utils.cpp wildcard.cpp \
index e9c93938cfebfe0a4405e79e5a2dad5eced2cacd..443022a556da6c9f48e062e2381b4be05b0e0ae3 100644 (file)
@@ -368,6 +368,37 @@ static ex Li3_eval(const ex & x)
 REGISTER_FUNCTION(Li3, eval_func(Li3_eval).
                        latex_name("\\mbox{Li}_3"));
 
 REGISTER_FUNCTION(Li3, eval_func(Li3_eval).
                        latex_name("\\mbox{Li}_3"));
 
+//////////
+// Derivatives of Riemann's Zeta-function  zetaderiv(0,x)==zeta(x)
+//////////
+
+static ex zetaderiv_eval(const ex & n, const ex & x)
+{
+       if (n.info(info_flags::numeric)) {
+               // zetaderiv(0,x) -> zeta(x)
+               if (n.is_zero())
+                       return zeta(x);
+       }
+       
+       return zetaderiv(n, x).hold();
+}
+
+static ex zetaderiv_deriv(const ex & n, const ex & x, unsigned deriv_param)
+{
+       GINAC_ASSERT(deriv_param<2);
+       
+       if (deriv_param==0) {
+               // d/dn zeta(n,x)
+               throw(std::logic_error("cannot diff zetaderiv(n,x) with respect to n"));
+       }
+       // d/dx psi(n,x)
+       return zetaderiv(n+1,x);
+}
+
+REGISTER_FUNCTION(zetaderiv, eval_func(zetaderiv_eval).
+                                derivative_func(zetaderiv_deriv).
+                                latex_name("\\zeta^\\prime"));
+
 //////////
 // factorial
 //////////
 //////////
 // factorial
 //////////
index 3531c8a07dd776a1dd97dbd7831ebf4167c9d2a2..e68bd175569b0c6f7b7ae1d40ec725972c0222a0 100644 (file)
@@ -88,6 +88,9 @@ DECLARE_FUNCTION_1P(Li2)
 /** Trilogarithm. */
 DECLARE_FUNCTION_1P(Li3)
 
 /** Trilogarithm. */
 DECLARE_FUNCTION_1P(Li3)
 
+/** Derivatives of Riemann's Zeta-function. */
+DECLARE_FUNCTION_2P(zetaderiv)
+
 // overloading at work: we cannot use the macros here
 /** Multiple zeta value including Riemann's zeta-function. */
 class zeta1_SERIAL { public: static unsigned serial; };
 // overloading at work: we cannot use the macros here
 /** Multiple zeta value including Riemann's zeta-function. */
 class zeta1_SERIAL { public: static unsigned serial; };
@@ -95,7 +98,7 @@ template<typename T1>
 inline function zeta(const T1 & p1) {
        return function(zeta1_SERIAL::serial, ex(p1));
 }
 inline function zeta(const T1 & p1) {
        return function(zeta1_SERIAL::serial, ex(p1));
 }
-/** Derivatives of Riemann's Zeta-function. */
+/** Alternating Euler sum or colored MZV. */
 class zeta2_SERIAL { public: static unsigned serial; };
 template<typename T1, typename T2>
 inline function zeta(const T1 & p1, const T2 & p2) {
 class zeta2_SERIAL { public: static unsigned serial; };
 template<typename T1, typename T2>
 inline function zeta(const T1 & p1, const T2 & p2) {
@@ -107,6 +110,15 @@ template<> inline bool is_the_function<class zeta_SERIAL>(const ex & x)
        return is_the_function<zeta1_SERIAL>(x) || is_the_function<zeta2_SERIAL>(x);
 }
 
        return is_the_function<zeta1_SERIAL>(x) || is_the_function<zeta2_SERIAL>(x);
 }
 
+/** Polylogarithm and multiple polylogarithm. */
+DECLARE_FUNCTION_2P(Li)
+
+/** Nielsen's generalized polylogarithm. */
+DECLARE_FUNCTION_3P(S)
+
+/** Harmonic polylogarithm. */
+DECLARE_FUNCTION_2P(H)
+
 /** Gamma-function. */
 DECLARE_FUNCTION_1P(lgamma)
 DECLARE_FUNCTION_1P(tgamma)
 /** Gamma-function. */
 DECLARE_FUNCTION_1P(lgamma)
 DECLARE_FUNCTION_1P(tgamma)
@@ -142,18 +154,6 @@ DECLARE_FUNCTION_2P(binomial)
 /** Order term function (for truncated power series). */
 DECLARE_FUNCTION_1P(Order)
 
 /** Order term function (for truncated power series). */
 DECLARE_FUNCTION_1P(Order)
 
-/** Polylogarithm and multiple polylogarithm. */
-DECLARE_FUNCTION_2P(Li)
-
-/** Nielsen's generalized polylogarithm. */
-DECLARE_FUNCTION_3P(S)
-
-/** Harmonic polylogarithm. */
-DECLARE_FUNCTION_2P(H)
-
-/** Multiple zeta value. */
-DECLARE_FUNCTION_1P(mZeta)
 ex lsolve(const ex &eqns, const ex &symbols, unsigned options = solve_algo::automatic);
 
 /** Check whether a function is the Order (O(n)) function. */
 ex lsolve(const ex &eqns, const ex &symbols, unsigned options = solve_algo::automatic);
 
 /** Check whether a function is the Order (O(n)) function. */
diff --git a/ginac/inifcns_zeta.cpp b/ginac/inifcns_zeta.cpp
deleted file mode 100644 (file)
index 2dba976..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/** @file inifcns_zeta.cpp
- *
- *  Implementation of the Zeta-function and some related stuff. */
-
-/*
- *  GiNaC Copyright (C) 1999-2003 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
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <vector>
-#include <stdexcept>
-
-#include "inifcns.h"
-#include "constant.h"
-#include "numeric.h"
-#include "power.h"
-#include "symbol.h"
-#include "operators.h"
-#include "utils.h"
-
-namespace GiNaC {
-
-//////////
-// Derivatives of Riemann's Zeta-function  zeta(0,x)==zeta(x)
-//////////
-
-static ex zeta2_eval(const ex & n, const ex & x)
-{
-       if (n.info(info_flags::numeric)) {
-               // zeta(0,x) -> zeta(x)
-               if (n.is_zero())
-                       return zeta(x);
-       }
-       
-       return zeta(n, x).hold();
-}
-
-static ex zeta2_deriv(const ex & n, const ex & x, unsigned deriv_param)
-{
-       GINAC_ASSERT(deriv_param<2);
-       
-       if (deriv_param==0) {
-               // d/dn zeta(n,x)
-               throw(std::logic_error("cannot diff zeta(n,x) with respect to n"));
-       }
-       // d/dx psi(n,x)
-       return zeta(n+1,x);
-}
-
-unsigned zeta2_SERIAL::serial =
-       function::register_new(function_options("zeta").
-                              eval_func(zeta2_eval).
-                              derivative_func(zeta2_deriv).
-                              latex_name("\\zeta").
-                              overloaded(2));
-
-} // namespace GiNaC