lib_LTLIBRARIES = libginac.la
libginac_la_SOURCES = add.cpp basic.cpp constant.cpp diff.cpp ex.cpp \
expairseq.cpp exprseq.cpp fail.cpp function.cpp inifcns.cpp \
- inifcns_trans.cpp inifcns_gamma.cpp matrix.cpp mul.cpp normal.cpp \
- numeric.cpp operators.cpp power.cpp print.cpp printraw.cpp printtree.cpp \
- printcsrc.cpp relational.cpp symbol.cpp utils.cpp series.cpp ncmul.cpp \
- clifford.cpp structure.cpp color.cpp indexed.cpp idx.cpp isospin.cpp \
- exprseq_suppl.cpp lst.cpp lst_suppl.cpp simp_lor.cpp coloridx.cpp \
- lorentzidx.cpp debugmsg.h utils.h
+ inifcns_trans.cpp inifcns_zeta.cpp inifcns_gamma.cpp matrix.cpp mul.cpp \
+ normal.cpp numeric.cpp operators.cpp power.cpp print.cpp printraw.cpp \
+ printtree.cpp printcsrc.cpp relational.cpp symbol.cpp utils.cpp series.cpp \
+ ncmul.cpp clifford.cpp structure.cpp color.cpp indexed.cpp idx.cpp \
+ isospin.cpp exprseq_suppl.cpp lst.cpp lst_suppl.cpp simp_lor.cpp \
+ coloridx.cpp lorentzidx.cpp debugmsg.h utils.h
libginac_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-release $(LT_RELEASE)
ginacincludedir = $(includedir)/ginac
lib_LTLIBRARIES = libginac.la
libginac_la_SOURCES = add.cpp basic.cpp constant.cpp diff.cpp ex.cpp \
expairseq.cpp exprseq.cpp fail.cpp function.cpp inifcns.cpp \
- inifcns_trans.cpp inifcns_gamma.cpp matrix.cpp mul.cpp normal.cpp \
- numeric.cpp operators.cpp power.cpp print.cpp printraw.cpp printtree.cpp \
- printcsrc.cpp relational.cpp symbol.cpp utils.cpp series.cpp ncmul.cpp \
- clifford.cpp structure.cpp color.cpp indexed.cpp idx.cpp isospin.cpp \
- exprseq_suppl.cpp lst.cpp lst_suppl.cpp simp_lor.cpp coloridx.cpp \
- lorentzidx.cpp debugmsg.h utils.h
+ inifcns_trans.cpp inifcns_zeta.cpp inifcns_gamma.cpp matrix.cpp mul.cpp \
+ normal.cpp numeric.cpp operators.cpp power.cpp print.cpp printraw.cpp \
+ printtree.cpp printcsrc.cpp relational.cpp symbol.cpp utils.cpp series.cpp \
+ ncmul.cpp clifford.cpp structure.cpp color.cpp indexed.cpp idx.cpp \
+ isospin.cpp exprseq_suppl.cpp lst.cpp lst_suppl.cpp simp_lor.cpp \
+ coloridx.cpp lorentzidx.cpp debugmsg.h utils.h
libginac_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
-release $(LT_RELEASE)
ginacincludedir = $(includedir)/ginac
libginac_la_LIBADD =
libginac_la_OBJECTS = add.lo basic.lo constant.lo diff.lo ex.lo \
expairseq.lo exprseq.lo fail.lo function.lo inifcns.lo inifcns_trans.lo \
-inifcns_gamma.lo matrix.lo mul.lo normal.lo numeric.lo operators.lo \
-power.lo print.lo printraw.lo printtree.lo printcsrc.lo relational.lo \
-symbol.lo utils.lo series.lo ncmul.lo clifford.lo structure.lo color.lo \
-indexed.lo idx.lo isospin.lo exprseq_suppl.lo lst.lo lst_suppl.lo \
-simp_lor.lo coloridx.lo lorentzidx.lo
+inifcns_zeta.lo inifcns_gamma.lo matrix.lo mul.lo normal.lo numeric.lo \
+operators.lo power.lo print.lo printraw.lo printtree.lo printcsrc.lo \
+relational.lo symbol.lo utils.lo series.lo ncmul.lo clifford.lo \
+structure.lo color.lo indexed.lo idx.lo isospin.lo exprseq_suppl.lo \
+lst.lo lst_suppl.lo simp_lor.lo coloridx.lo lorentzidx.lo
CXXFLAGS = @CXXFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS)
.deps/coloridx.P .deps/constant.P .deps/diff.P .deps/ex.P \
.deps/expairseq.P .deps/exprseq.P .deps/exprseq_suppl.P .deps/fail.P \
.deps/function.P .deps/idx.P .deps/indexed.P .deps/inifcns.P \
-.deps/inifcns_gamma.P .deps/inifcns_trans.P .deps/isospin.P \
-.deps/lorentzidx.P .deps/lst.P .deps/lst_suppl.P .deps/matrix.P \
-.deps/mul.P .deps/ncmul.P .deps/normal.P .deps/numeric.P \
+.deps/inifcns_gamma.P .deps/inifcns_trans.P .deps/inifcns_zeta.P \
+.deps/isospin.P .deps/lorentzidx.P .deps/lst.P .deps/lst_suppl.P \
+.deps/matrix.P .deps/mul.P .deps/ncmul.P .deps/normal.P .deps/numeric.P \
.deps/operators.P .deps/power.P .deps/print.P .deps/printcsrc.P \
.deps/printraw.P .deps/printtree.P .deps/relational.P .deps/series.P \
.deps/simp_lor.P .deps/structure.P .deps/symbol.P .deps/utils.P
/** Trilogarithm. */
DECLARE_FUNCTION_1P(Li3)
-/** Gamma function. */
+/** Riemann's Zeta-function. */
+DECLARE_FUNCTION_1P(zeta)
+DECLARE_FUNCTION_2P(zeta)
+
+/** Gamma-function. */
DECLARE_FUNCTION_1P(gamma)
-/** Psi function (aka polygamma-function) */
+/** Psi-function (aka polygamma-function). */
+DECLARE_FUNCTION_1P(psi)
DECLARE_FUNCTION_2P(psi)
/** Factorial function. */
/** @file inifcns_gamma.cpp
*
- * Implementation of Gamma function and some related stuff. */
+ * Implementation of Gamma-function, Polygamma-functions, and some related
+ * stuff. */
/*
* GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
namespace GiNaC {
//////////
-// gamma function
+// Gamma-function
//////////
/** Evaluation of gamma(x). Knows about integer arguments, half-integer
static ex gamma_eval(ex const & x)
{
if (x.info(info_flags::numeric)) {
-
// trap integer arguments:
if ( x.info(info_flags::integer) ) {
// gamma(n+1) -> n! for postitive n
static ex gamma_diff(ex const & x, unsigned diff_param)
{
ASSERT(diff_param==0);
-
- return psi(exZERO(),x)*gamma(x);
+
+ return psi(exZERO(),x)*gamma(x); // diff(log(gamma(x)),x)==psi(0,x)
}
static ex gamma_series(ex const & x, symbol const & s, ex const & point, int order)
REGISTER_FUNCTION(gamma, gamma_eval, gamma_evalf, gamma_diff, gamma_series);
//////////
-// psi function (aka polygamma function)
+// Psi-function (aka polygamma-function)
//////////
/** Evaluation of polygamma-function psi(n,x).
--- /dev/null
+/** @file inifcns_zeta.cpp
+ *
+ * Implementation of the Zeta-function and some related stuff. */
+
+/*
+ * GiNaC Copyright (C) 1999 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 "ex.h"
+#include "constant.h"
+#include "numeric.h"
+#include "power.h"
+#include "symbol.h"
+
+namespace GiNaC {
+
+//////////
+// Riemann's Zeta-function
+//////////
+
+static ex zeta_eval(ex const & x)
+{
+ if (x.info(info_flags::numeric)) {
+ // trap integer arguments:
+ if ( x.info(info_flags::integer) ) {
+ if ( x.info(info_flags::posint) ) {
+ return numZERO(); // FIXME
+ } else {
+ return numZERO(); // FIXME
+ }
+ }
+ }
+ return zeta(x).hold();
+}
+
+static ex zeta_evalf(ex const & x)
+{
+ BEGIN_TYPECHECK
+ TYPECHECK(x,numeric)
+ END_TYPECHECK(zeta(x))
+
+ return zeta(ex_to_numeric(x));
+}
+
+static ex zeta_diff(ex const & x, unsigned diff_param)
+{
+ ASSERT(diff_param==0);
+
+ return exZERO(); // should return zeta(numONE(),x);
+}
+
+static ex zeta_series(ex const & x, symbol const & s, ex const & point, int order)
+{
+ throw(std::logic_error("don't know the series expansion of the zeta function"));
+}
+
+REGISTER_FUNCTION(zeta, zeta_eval, zeta_evalf, zeta_diff, zeta_series);
+
+} // namespace GiNaC
return ::atanh(*x.value); // -> CLN
}
+/** Numeric evaluation of Riemann's Zeta function. Currently works only for
+ * integer arguments. */
+numeric zeta(numeric const & x)
+{
+ if (x.is_integer())
+ return ::cl_zeta(x.to_int()); // -> CLN
+ else
+ clog << "zeta(): Does anybody know good way to calculate this numerically?" << endl;
+ return numeric(0);
+}
+
/** The gamma function.
* This is only a stub! */
numeric gamma(numeric const & x)
numeric asinh(numeric const & x);
numeric acosh(numeric const & x);
numeric atanh(numeric const & x);
+numeric zeta(numeric const & x);
numeric gamma(numeric const & x);
+numeric psi(numeric const & n, numeric const & x);
numeric factorial(numeric const & n);
numeric doublefactorial(numeric const & n);
numeric binomial(numeric const & n, numeric const & k);