Nestedsums library
list_polygamma.h
Go to the documentation of this file.
1
8/*
9 * Copyright (C) 2001-2017 Stefan Weinzierl
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */
25
26#ifndef __NESTEDSUMS_LIST_POLYGAMMA_H__
27#define __NESTEDSUMS_LIST_POLYGAMMA_H__
28
29#include "ginac/ginac.h"
30
31namespace nestedsums {
32
34
49 class list_of_tgamma : public GiNaC::basic
50 {
51 friend class transcendental_sum_type_A;
52 friend class transcendental_sum_type_B;
53 friend class transcendental_sum_type_C;
54 friend class transcendental_sum_type_D;
55
56 GINAC_DECLARE_REGISTERED_CLASS(list_of_tgamma, GiNaC::basic)
57
58 // ctors
59 public:
60 explicit list_of_tgamma(const GiNaC::ex & l);
61 list_of_tgamma(const GiNaC::ex & l, const GiNaC::ex & i, const GiNaC::ex & eps, int o);
62
63 // functions overriding virtual functions from base classes
64 public:
65 void archive(GiNaC::archive_node &node) const override;
66 void read_archive(const GiNaC::archive_node &node, GiNaC::lst &sym_lst) override;
67
68 unsigned return_type(void) const override { return GiNaC::return_types::noncommutative; }
69
70 void print(const GiNaC::print_context & c, unsigned level = 0) const override;
71 unsigned precedence(void) const override {return 50;}
72 GiNaC::ex eval() const override;
73 GiNaC::ex subs(const GiNaC::exmap & m, unsigned options = 0) const override;
74
75 protected:
76 GiNaC::ex eval_ncmul(const GiNaC::exvector & v) const override;
77 GiNaC::ex derivative(const GiNaC::symbol & s) const override;
78 unsigned calchash(void) const override;
79
80 // new virtual functions which can be overridden by derived classes
81 public:
82 virtual GiNaC::ex eval_explicit() const;
83 virtual unsigned get_key(void) const;
84 virtual GiNaC::ex hash_data(void) const;
85 virtual GiNaC::ex subst_data(void) const;
86
87 // non-virtual functions
88 public:
89 GiNaC::ex set_expansion(void) const;
90 GiNaC::ex set_index(const GiNaC::ex & new_index) const;
91 GiNaC::ex set_expansion_parameter(const GiNaC::ex & new_eps) const;
92 GiNaC::ex set_order(int new_order) const;
93
94 GiNaC::ex get_index(void) const;
95 unsigned get_depth(void) const;
96
97 GiNaC::ex shift_plus_one(void) const;
98 GiNaC::ex shift_minus_one(void) const;
99 GiNaC::ex index_eq_one(void) const;
100 GiNaC::ex shift_index(const GiNaC::ex & new_index) const;
101
102 GiNaC::ex concat(const GiNaC::ex & l) const;
103
104 int pole_alert(void) const;
105 int expansion_alert(void) const;
106
107
108 // friends :
109 friend GiNaC::ex create_transcendental_sum_type_A_and_set_gammas(const GiNaC::ex & nn, const GiNaC::ex & i,
110 const GiNaC::ex & l, const GiNaC::ex & v, const GiNaC::ex & ss,
111 const GiNaC::ex & eps, int o, int f);
112 friend GiNaC::ex create_transcendental_sum_type_B_and_set_gammas(const GiNaC::ex & nn, const GiNaC::ex & i, const GiNaC::ex & l, const GiNaC::ex & lr,
113 const GiNaC::ex & v, const GiNaC::ex & vr, const GiNaC::ex & ss, const GiNaC::ex & ssr,
114 const GiNaC::ex & eps, int o, int f);
115 friend GiNaC::ex create_transcendental_sum_type_C_and_set_gammas(const GiNaC::ex & nn, const GiNaC::ex & i, const GiNaC::ex & l,
116 const GiNaC::ex & v, const GiNaC::ex & ss,
117 const GiNaC::ex & eps, int o, int f);
118 friend GiNaC::ex create_transcendental_sum_type_D_and_set_gammas(const GiNaC::ex & nn, const GiNaC::ex & i, const GiNaC::ex & l, const GiNaC::ex & lr,
119 const GiNaC::ex & v, const GiNaC::ex & vr, const GiNaC::ex & ss, const GiNaC::ex & ssr,
120 const GiNaC::ex & eps, int o, int f);
121
122 // member variables :
123
124 protected:
125
126 GiNaC::ex gamma_sequence;
127 GiNaC::ex index;
128 GiNaC::ex expansion_parameter;
129 int order;
130 };
131
132GINAC_DECLARE_UNARCHIVER(list_of_tgamma);
133
134 // inline functions
135
141inline GiNaC::ex list_of_tgamma::get_index(void) const
142 {
143 return index;
144 }
145
151inline unsigned list_of_tgamma::get_depth(void) const
152 {
153 return gamma_sequence.nops();
154 }
155
161inline GiNaC::ex create_list_of_tgamma(const GiNaC::ex & l)
162 {
163 return (new list_of_tgamma(l))->setflag(GiNaC::status_flags::dynallocated);
164 }
165
171inline GiNaC::ex create_list_of_tgamma(const GiNaC::ex & l, const GiNaC::ex & i, const GiNaC::ex & eps, int o)
172 {
173 return (new list_of_tgamma(l,i,eps,o))->setflag(GiNaC::status_flags::dynallocated);
174 }
175
181inline GiNaC::ex create_list_of_tgamma_and_set_gammas(const GiNaC::ex & l, const GiNaC::ex & i, const GiNaC::ex & eps, int o)
182 {
183 // set index, expansion_parameter and order in the Gamma functions
184 GiNaC::lst* vl = new GiNaC::lst();
185 vl->setflag(GiNaC::status_flags::dynallocated);
186 int j;
187 for (j=0;j<l.nops();j++)
188 {
189 vl->append(GiNaC::ex_to<ratio_of_tgamma>(l.op(j)).set_values(i,eps,o,expand_status::no_eval_to_scalar));
190 }
191 return (new list_of_tgamma(*vl,i,eps,o))->setflag(GiNaC::status_flags::dynallocated);
192 }
193
194} // namespace nestedsums
195
196#endif // ndef __NESTEDSUMS_LIST_POLYGAMMA_H__
The class list_of_tgamma is a container for the class ratio_of_tgamma.
Definition list_polygamma.h:50
unsigned get_depth(void) const
Definition list_polygamma.h:151
GiNaC::ex eval_ncmul(const GiNaC::exvector &v) const override
Definition list_polygamma.cc:263
GiNaC::ex set_expansion_parameter(const GiNaC::ex &new_eps) const
Definition list_polygamma.cc:496
virtual GiNaC::ex eval_explicit() const
Definition list_polygamma.cc:327
GiNaC::ex index_eq_one(void) const
Definition list_polygamma.cc:596
friend GiNaC::ex create_transcendental_sum_type_B_and_set_gammas(const GiNaC::ex &nn, const GiNaC::ex &i, const GiNaC::ex &l, const GiNaC::ex &lr, const GiNaC::ex &v, const GiNaC::ex &vr, const GiNaC::ex &ss, const GiNaC::ex &ssr, const GiNaC::ex &eps, int o, int f)
Definition transcendental_B.h:150
virtual unsigned get_key(void) const
Definition list_polygamma.cc:360
GiNaC::ex shift_index(const GiNaC::ex &new_index) const
Definition list_polygamma.cc:610
GiNaC::ex eval() const override
Definition list_polygamma.cc:231
int pole_alert(void) const
Definition list_polygamma.cc:661
virtual GiNaC::ex hash_data(void) const
Definition list_polygamma.cc:373
GiNaC::ex get_index(void) const
Definition list_polygamma.h:141
int expansion_alert(void) const
Definition list_polygamma.cc:682
virtual GiNaC::ex subst_data(void) const
Definition list_polygamma.cc:386
GiNaC::ex set_index(const GiNaC::ex &new_index) const
Definition list_polygamma.cc:476
GiNaC::ex set_expansion(void) const
Definition list_polygamma.cc:405
GiNaC::ex shift_plus_one(void) const
Definition list_polygamma.cc:543
GiNaC::ex shift_minus_one(void) const
Definition list_polygamma.cc:570
GiNaC::ex concat(const GiNaC::ex &l) const
Definition list_polygamma.cc:632
GiNaC::ex set_order(int new_order) const
Definition list_polygamma.cc:516
friend GiNaC::ex create_transcendental_sum_type_C_and_set_gammas(const GiNaC::ex &nn, const GiNaC::ex &i, const GiNaC::ex &l, const GiNaC::ex &v, const GiNaC::ex &ss, const GiNaC::ex &eps, int o, int f)
Definition transcendental_C.h:137
friend GiNaC::ex create_transcendental_sum_type_A_and_set_gammas(const GiNaC::ex &nn, const GiNaC::ex &i, const GiNaC::ex &l, const GiNaC::ex &v, const GiNaC::ex &ss, const GiNaC::ex &eps, int o, int f)
Definition transcendental_A.h:134
friend GiNaC::ex create_transcendental_sum_type_D_and_set_gammas(const GiNaC::ex &nn, const GiNaC::ex &i, const GiNaC::ex &l, const GiNaC::ex &lr, const GiNaC::ex &v, const GiNaC::ex &vr, const GiNaC::ex &ss, const GiNaC::ex &ssr, const GiNaC::ex &eps, int o, int f)
Definition transcendental_D.h:154
Definition transcendental_A.h:57
The class transcendental_sum_type_B may contain and .
Definition transcendental_B.h:69
The class transcendental_sum_type_C involves a conjugation.
Definition transcendental_C.h:60
Definition transcendental_D.h:72
Definition basic_letter.cc:35
GiNaC::ex create_list_of_tgamma_and_set_gammas(const GiNaC::ex &l, const GiNaC::ex &i, const GiNaC::ex &eps, int o)
Definition list_polygamma.h:181
GiNaC::ex create_list_of_tgamma(const GiNaC::ex &l)
Definition list_polygamma.h:161