Nestedsums library
Bsum.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_Bsum_H__
27#define __NESTEDSUMS_Bsum_H__
28
29#include "ginac/ginac.h"
30
31namespace nestedsums {
32
34
59 class Bsum : public GiNaC::basic
60 {
61
62 GINAC_DECLARE_REGISTERED_CLASS(Bsum, GiNaC::basic)
63
64 // ctors
65 public:
66 Bsum(const GiNaC::ex & nc, const GiNaC::ex & llc);
67
68 // functions overriding virtual functions from bases classes
69 public:
70 void archive(GiNaC::archive_node &node) const override;
71 void read_archive(const GiNaC::archive_node &node, GiNaC::lst &sym_lst) override;
72
73 unsigned return_type(void) const override { return GiNaC::return_types::noncommutative; }
74
75 void print(const GiNaC::print_context & c, unsigned level = 0) const override;
76 unsigned precedence(void) const override {return 60;}
77 GiNaC::ex eval() const override;
78 GiNaC::ex subs(const GiNaC::exmap & m, unsigned options = 0) const override;
79
80 protected:
81 GiNaC::ex eval_ncmul(const GiNaC::exvector & v) const override;
82 GiNaC::ex derivative(const GiNaC::symbol & s) const override;
83 unsigned calchash(void) const override;
84
85 // new virtual functions which can be overridden by derived classes
86 public :
87 virtual GiNaC::ex convert_to_Ssum_exvector(const GiNaC::exvector & Z1) const;
88
89 virtual GiNaC::ex expand_members(int level = 0) const;
90
91 // non-virtual functions
92 public :
93 GiNaC::ex get_index(void) const;
94 GiNaC::ex get_letter_list(void) const;
95 unsigned get_depth(void) const;
96
97 protected:
98
99 // friends :
100 friend GiNaC::ex convert_Bsum_to_Ssum(const GiNaC::ex & C);
101 friend GiNaC::ex convert_Bsum_to_Zsum(const GiNaC::ex & C);
102
103 // member variables :
104
105 protected:
106
107 GiNaC::ex n;
108 GiNaC::ex letter_list;
109 };
110
111GINAC_DECLARE_UNARCHIVER(Bsum);
112
113 // inline functions
114
120inline GiNaC::ex Bsum::get_index(void) const
121 {
122 return n;
123 }
124
130inline GiNaC::ex Bsum::get_letter_list(void) const
131 {
132 return letter_list;
133 }
134
140inline unsigned Bsum::get_depth(void) const
141 {
142 return letter_list.nops();
143 }
144
150inline GiNaC::ex create_Bsum(const GiNaC::ex & nc, const GiNaC::ex & llc)
151 {
152 return (new Bsum(nc,llc))->setflag(GiNaC::status_flags::dynallocated);
153 }
154
155 GiNaC::ex create_Bsum_from_exvector(const GiNaC::ex & nc, const GiNaC::exvector & v);
156
157 GiNaC::ex convert_Bsum_to_Ssum(const GiNaC::ex & C);
158 GiNaC::ex convert_Bsum_to_Zsum(const GiNaC::ex & C);
159
160} // namespace nestedsums
161
162#endif // ndef __NESTEDSUMS_Bsum_H__
Bsums arise from Hoelder convolutions.
Definition Bsum.h:60
unsigned get_depth(void) const
Definition Bsum.h:140
GiNaC::ex eval_ncmul(const GiNaC::exvector &v) const override
Definition Bsum.cc:175
GiNaC::ex get_letter_list(void) const
Definition Bsum.h:130
GiNaC::ex eval() const override
Definition Bsum.cc:163
GiNaC::ex get_index(void) const
Definition Bsum.h:120
virtual GiNaC::ex convert_to_Ssum_exvector(const GiNaC::exvector &Z1) const
Definition Bsum.cc:224
Definition basic_letter.cc:35
ex convert_Bsum_to_Ssum(const ex &C)
Definition Bsum.cc:302
ex convert_Bsum_to_Zsum(const ex &C)
Definition Bsum.cc:318
GiNaC::ex create_Bsum(const GiNaC::ex &nc, const GiNaC::ex &llc)
Definition Bsum.h:150
ex create_Bsum_from_exvector(const ex &nc, const exvector &v)
Definition Bsum.cc:334