Nestedsums library
Csum.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_Csum_H__
27#define __NESTEDSUMS_Csum_H__
28
29#include "ginac/ginac.h"
30
31namespace nestedsums {
32
34
87 class Csum : public GiNaC::basic
88 {
89
90 GINAC_DECLARE_REGISTERED_CLASS(Csum, GiNaC::basic)
91
92 // ctors
93 public:
94 Csum(const GiNaC::ex & nc, const GiNaC::ex & llc);
95
96 // functions overriding virtual functions from bases classes
97 public:
98 void archive(GiNaC::archive_node &node) const override;
99 void read_archive(const GiNaC::archive_node &node, GiNaC::lst &sym_lst) override;
100
101 unsigned return_type(void) const override { return GiNaC::return_types::noncommutative; }
102
103 void print(const GiNaC::print_context & c, unsigned level = 0) const override;
104 unsigned precedence(void) const override {return 60;}
105 GiNaC::ex eval() const override;
106 GiNaC::ex subs(const GiNaC::exmap & m, unsigned options = 0) const override;
107
108 protected:
109 GiNaC::ex eval_ncmul(const GiNaC::exvector & v) const override;
110 GiNaC::ex derivative(const GiNaC::symbol & s) const override;
111 unsigned calchash(void) const override;
112
113 // new virtual functions which can be overridden by derived classes
114 public :
115 virtual GiNaC::ex convert_to_Ssum_exvector(const GiNaC::exvector & Z1) const;
116
117 virtual GiNaC::ex expand_members(int level = 0) const;
118
119 protected:
120 virtual GiNaC::ex decrease_letter_degree(int m) const;
121 virtual GiNaC::ex move_x0_into_x1(void) const;
122 virtual GiNaC::ex move_x1_into_x2(void) const;
123 virtual GiNaC::ex remove_x0(void) const;
124 virtual GiNaC::ex remove_x0_and_x1(void) const;
125 virtual GiNaC::ex cast_to_Bsum(void) const;
126
127 // non-virtual functions
128 public :
129 GiNaC::ex get_index(void) const;
130 GiNaC::ex get_letter_list(void) const;
131 unsigned get_depth(void) const;
132
133 // friends :
134 friend GiNaC::ex convert_Csum_to_Ssum(const GiNaC::ex & C);
135 friend GiNaC::ex convert_Csum_to_Zsum(const GiNaC::ex & C);
136
137 // member variables :
138
139 protected:
140
141 GiNaC::ex n;
142 GiNaC::ex letter_list;
143 };
144
145GINAC_DECLARE_UNARCHIVER(Csum);
146
147 // inline functions
148
154inline GiNaC::ex Csum::get_index(void) const
155 {
156 return n;
157 }
158
164inline GiNaC::ex Csum::get_letter_list(void) const
165 {
166 return letter_list;
167 }
168
174inline unsigned Csum::get_depth(void) const
175 {
176 return letter_list.nops();
177 }
178
184inline GiNaC::ex create_Csum(const GiNaC::ex & nc, const GiNaC::ex & llc)
185 {
186 return (new Csum(nc,llc))->setflag(GiNaC::status_flags::dynallocated);
187 }
188
189 GiNaC::ex create_Csum_from_exvector(const GiNaC::ex & nc, const GiNaC::exvector & v);
190
191 GiNaC::ex convert_Csum_to_Ssum(const GiNaC::ex & C);
192 GiNaC::ex convert_Csum_to_Zsum(const GiNaC::ex & C);
193
194} // namespace nestedsums
195
196#endif // ndef __NESTEDSUMS_Csum_H__
Csums involve a conjugation.
Definition Csum.h:88
unsigned get_depth(void) const
Definition Csum.h:174
GiNaC::ex eval_ncmul(const GiNaC::exvector &v) const override
Definition Csum.cc:176
GiNaC::ex get_letter_list(void) const
Definition Csum.h:164
virtual GiNaC::ex cast_to_Bsum(void) const
Definition Csum.cc:566
virtual GiNaC::ex decrease_letter_degree(int m) const
Definition Csum.cc:414
virtual GiNaC::ex move_x0_into_x1(void) const
Definition Csum.cc:451
virtual GiNaC::ex remove_x0(void) const
Definition Csum.cc:518
GiNaC::ex eval() const override
Definition Csum.cc:164
virtual GiNaC::ex move_x1_into_x2(void) const
Definition Csum.cc:488
GiNaC::ex get_index(void) const
Definition Csum.h:154
virtual GiNaC::ex convert_to_Ssum_exvector(const GiNaC::exvector &Z1) const
Definition Csum.cc:270
virtual GiNaC::ex remove_x0_and_x1(void) const
Definition Csum.cc:542
Definition basic_letter.cc:35
ex create_Csum_from_exvector(const ex &nc, const exvector &v)
Definition Csum.cc:626
ex convert_Csum_to_Zsum(const ex &C)
Definition Csum.cc:610
GiNaC::ex create_Csum(const GiNaC::ex &nc, const GiNaC::ex &llc)
Definition Csum.h:184
ex convert_Csum_to_Ssum(const ex &C)
Definition Csum.cc:594