]> www.ginac.de Git - ginac.git/blobdiff - ginac/inifcns_gamma.cpp
Add support for Texinfo-5.0.
[ginac.git] / ginac / inifcns_gamma.cpp
index 30c413ee178d8c8577595dcdd5b1456bd2d1b8c8..f3d44a81e462325f5c6818ac29ba07a641903fab 100644 (file)
@@ -4,7 +4,7 @@
  *  some related stuff. */
 
 /*
- *  GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2011 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
@@ -21,9 +21,6 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <vector>
-#include <stdexcept>
-
 #include "inifcns.h"
 #include "constant.h"
 #include "pseries.h"
@@ -35,6 +32,9 @@
 #include "symmetry.h"
 #include "utils.h"
 
+#include <stdexcept>
+#include <vector>
+
 namespace GiNaC {
 
 //////////
@@ -110,10 +110,26 @@ static ex lgamma_series(const ex & arg,
 }
 
 
+static ex lgamma_conjugate(const ex & x)
+{
+       // conjugate(lgamma(x))==lgamma(conjugate(x)) unless on the branch cut
+       // which runs along the negative real axis.
+       if (x.info(info_flags::positive)) {
+               return lgamma(x);
+       }
+       if (is_exactly_a<numeric>(x) &&
+           !x.imag_part().is_zero()) {
+               return lgamma(x.conjugate());
+       }
+       return conjugate_function(lgamma(x)).hold();
+}
+
+
 REGISTER_FUNCTION(lgamma, eval_func(lgamma_eval).
                           evalf_func(lgamma_evalf).
                           derivative_func(lgamma_deriv).
                           series_func(lgamma_series).
+                          conjugate_func(lgamma_conjugate).
                           latex_name("\\log \\Gamma"));
 
 
@@ -207,10 +223,18 @@ static ex tgamma_series(const ex & arg,
 }
 
 
+static ex tgamma_conjugate(const ex & x)
+{
+       // conjugate(tgamma(x))==tgamma(conjugate(x))
+       return tgamma(x.conjugate());
+}
+
+
 REGISTER_FUNCTION(tgamma, eval_func(tgamma_eval).
                           evalf_func(tgamma_evalf).
                           derivative_func(tgamma_deriv).
                           series_func(tgamma_series).
+                          conjugate_func(tgamma_conjugate).
                           latex_name("\\Gamma"));
 
 
@@ -328,8 +352,8 @@ REGISTER_FUNCTION(beta, eval_func(beta_eval).
                         evalf_func(beta_evalf).
                         derivative_func(beta_deriv).
                         series_func(beta_series).
-                        latex_name("\\mbox{B}").
-                                               set_symmetry(sy_symm(0, 1)));
+                        latex_name("\\mathrm{B}").
+                        set_symmetry(sy_symm(0, 1)));
 
 
 //////////