Nestedsums library
transcendental_B.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_TRANSCENDENTAL_B_H__
27#define __NESTEDSUMS_TRANSCENDENTAL_B_H__
28
29#include "ginac/ginac.h"
30
31namespace nestedsums {
32
34
68 class transcendental_sum_type_B : public GiNaC::basic
69 {
70 GINAC_DECLARE_REGISTERED_CLASS(transcendental_sum_type_B, GiNaC::basic)
71
72 // ctors
73 public:
74 transcendental_sum_type_B(const GiNaC::ex & nn, const GiNaC::ex & i, const GiNaC::ex & l, const GiNaC::ex & lr,
75 const GiNaC::ex & v, const GiNaC::ex & vr, const GiNaC::ex & ss, const GiNaC::ex & ssr,
76 const GiNaC::ex & eps, int o, int f);
77
78 // functions overriding virtual functions from base classes
79 public:
80 void archive(GiNaC::archive_node &node) const override;
81 void read_archive(const GiNaC::archive_node &node, GiNaC::lst &sym_lst) override;
82
83 unsigned return_type(void) const override { return GiNaC::return_types::noncommutative; }
84
85 void print(const GiNaC::print_context & c, unsigned level = 0) const override;
86 unsigned precedence(void) const override {return 40;}
87 GiNaC::ex eval() const override;
88 GiNaC::ex subs(const GiNaC::exmap & m, unsigned options = 0) const override;
89
90 protected:
91 GiNaC::ex eval_ncmul(const GiNaC::exvector & v) const override;
92 GiNaC::ex derivative(const GiNaC::symbol & s) const override;
93 unsigned calchash(void) const override;
94
95 // new virtual functions which can be overridden by derived classes
96 public:
97 virtual GiNaC::ex eval_explicit() const;
98
99 // non-virtual functions
100 public:
101 GiNaC::ex set_expansion(void) const;
102 GiNaC::ex distribute_over_subsum(void) const;
103 GiNaC::ex distribute_over_letter(void) const;
104 GiNaC::ex distribute_over_subsum_rev(void) const;
105 GiNaC::ex distribute_over_letter_rev(void) const;
106 GiNaC::ex shift_plus_one(void) const;
107 GiNaC::ex shift_plus_one_rev(void) const;
108
109 protected:
110
111 // member variables :
112
113 protected:
114
115 GiNaC::ex n;
116 GiNaC::ex index;
117 GiNaC::ex letter;
118 GiNaC::ex letter_rev;
119 GiNaC::ex lst_of_gammas;
120 GiNaC::ex lst_of_gammas_rev;
121 GiNaC::ex subsum;
122 GiNaC::ex subsum_rev;
123
124 GiNaC::ex expansion_parameter;
125
126 int order;
127
128 mutable int flag_expand_status;
129 };
130
131GINAC_DECLARE_UNARCHIVER(transcendental_sum_type_B);
132
138inline GiNaC::ex create_transcendental_sum_type_B(const GiNaC::ex & nn, const GiNaC::ex & i, const GiNaC::ex & l, const GiNaC::ex & lr,
139 const GiNaC::ex & v, const GiNaC::ex & vr, const GiNaC::ex & ss, const GiNaC::ex & ssr,
140 const GiNaC::ex & eps, int o, int f)
141 {
142 return (new transcendental_sum_type_B(nn,i,l,lr,v,vr,ss,ssr,eps,o,f))->setflag(GiNaC::status_flags::dynallocated);
143 }
144
150inline 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,
151 const GiNaC::ex & v, const GiNaC::ex & vr, const GiNaC::ex & ss, const GiNaC::ex & ssr,
152 const GiNaC::ex & eps, int o, int f)
153 {
154 // set index, expansion_parameter and order in the Gamma functions
155 GiNaC::ex new_v = create_list_of_tgamma_and_set_gammas(GiNaC::ex_to<list_of_tgamma>(v).gamma_sequence,i,eps,o);
156
157 // set index, expansion_parameter and order in the Gamma functions
158 GiNaC::ex new_vr = create_list_of_tgamma_and_set_gammas(GiNaC::ex_to<list_of_tgamma>(vr).gamma_sequence,nn-i,eps,o);
159
160 return (new transcendental_sum_type_B(nn,i,l,lr,new_v,new_vr,ss,ssr,eps,o,f))->setflag(GiNaC::status_flags::dynallocated);
161 }
162
163GiNaC::ex create_transcendental_sum_type_B_and_expand(const GiNaC::ex & nn, const GiNaC::ex & i, const GiNaC::ex & l, const GiNaC::ex & lr,
164 const GiNaC::ex & v, const GiNaC::ex & vr, const GiNaC::ex & ss, const GiNaC::ex & ssr,
165 const GiNaC::ex & eps, int o);
166
167} // namespace nestedsums
168
169#endif // ndef __NESTEDSUMS_TRANSCENDENTAL_B_H__
A letter is a basic_letter with offset=0.
Definition letter.h:45
The class transcendental_sum_type_B may contain and .
Definition transcendental_B.h:69
GiNaC::ex eval_ncmul(const GiNaC::exvector &v) const override
Definition transcendental_B.cc:942
GiNaC::ex distribute_over_subsum(void) const
Definition transcendental_B.cc:1016
virtual GiNaC::ex eval_explicit() const
Definition transcendental_B.cc:1557
GiNaC::ex shift_plus_one_rev(void) const
Definition transcendental_B.cc:1701
GiNaC::ex distribute_over_letter_rev(void) const
Definition transcendental_B.cc:1501
GiNaC::ex eval() const override
Definition transcendental_B.cc:374
GiNaC::ex set_expansion(void) const
Definition transcendental_B.cc:979
GiNaC::ex distribute_over_letter(void) const
Definition transcendental_B.cc:1438
GiNaC::ex shift_plus_one(void) const
Definition transcendental_B.cc:1627
GiNaC::ex distribute_over_subsum_rev(void) const
Definition transcendental_B.cc:1237
Definition basic_letter.cc:35
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
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_transcendental_sum_type_B(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:138
ex create_transcendental_sum_type_B_and_expand(const ex &nn, const ex &i, const ex &l, const ex &lr, const ex &v, const ex &vr, const ex &ss, const ex &ssr, const ex &eps, int o)
Definition transcendental_B.cc:1749