00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
#ifndef __NESTEDSUMS_ZSUM_H__
00027
#define __NESTEDSUMS_ZSUM_H__
00028
00029
#include "ginac/ginac.h"
00030
00031
namespace nestedsums {
00032
00034
00053 class Zsum :
public GiNaC::basic
00054 {
00055
00056 GINAC_DECLARE_REGISTERED_CLASS(
Zsum, GiNaC::basic)
00057
00058
00059
public:
00060
explicit Zsum(
const GiNaC::ex & nc);
00061
Zsum(
const GiNaC::ex & nc,
const GiNaC::ex & llc);
00062
00063
00064
public:
00065
void archive(GiNaC::archive_node &node)
const;
00066
void read_archive(
const GiNaC::archive_node &node, GiNaC::lst &sym_lst);
00067
00068
unsigned return_type(
void)
const {
return GiNaC::return_types::noncommutative; }
00069
00070
void print(
const GiNaC::print_context & c,
unsigned level = 0)
const;
00071
unsigned precedence(
void)
const {
return 60;}
00072 GiNaC::ex
eval(
int level = 0)
const;
00073 GiNaC::ex subs(
const GiNaC::exmap & m,
unsigned options = 0)
const;
00074
00075
protected:
00076 GiNaC::ex
eval_ncmul(
const GiNaC::exvector & v)
const;
00077 GiNaC::ex derivative(
const GiNaC::symbol & s)
const;
00078
unsigned calchash(
void)
const;
00079
00080
00081
public :
00082
virtual GiNaC::ex
convert_to_Ssum_exvector(
const GiNaC::exvector & Z0,
const GiNaC::exvector & Z1)
const;
00083
virtual GiNaC::ex
shuffle_exvector(
const GiNaC::exvector & Z0,
const GiNaC::exvector & Z1,
const GiNaC::exvector & Z2)
const;
00084
00085
virtual GiNaC::ex
set_index(
const GiNaC::ex & i)
const;
00086
virtual GiNaC::ex
shift_plus_one(
void)
const;
00087
virtual GiNaC::ex
shift_minus_one(
void)
const;
00088
virtual GiNaC::ex
adjust_upper_limit_downwards(
const GiNaC::ex & i)
const;
00089
virtual GiNaC::ex
adjust_upper_limit_upwards(
const GiNaC::ex & i)
const;
00090
virtual GiNaC::ex
adjust_upper_limit_plus_one(
void)
const;
00091
virtual GiNaC::ex
index_eq_one(
void)
const;
00092
00093
virtual GiNaC::ex
get_head(
int k)
const;
00094
virtual GiNaC::ex
get_tail(
int k)
const;
00095
00096
virtual GiNaC::ex
antipode(
void)
const;
00097
00098
virtual GiNaC::ex expand_members(
int level = 0)
const;
00099
virtual GiNaC::ex
eval_explicit(
int level = 0)
const;
00100
00101
virtual GiNaC::ex
get_first_letter(
void)
const;
00102
virtual GiNaC::ex
remove_first_letter(
void)
const;
00103
virtual GiNaC::ex
remove_first_letter(
const GiNaC::ex & nc)
const;
00104
virtual GiNaC::ex
prepend_letter(
const GiNaC::ex & lc)
const;
00105
virtual GiNaC::ex prepend_letter(
const GiNaC::ex & nc,
const GiNaC::ex & lc)
const;
00106
virtual GiNaC::ex
append_letter(
const GiNaC::ex & lc)
const;
00107
virtual GiNaC::ex
append_letter_list(
const GiNaC::ex & lc)
const;
00108
00109
protected:
00110
virtual GiNaC::ex
cast_to_Ssum(
void)
const;
00111
00112
virtual GiNaC::ex
multiply_letter_with_last_letter(
const GiNaC::ex & lc)
const;
00113
virtual GiNaC::ex
multiply_letter_with_first_letter(
const GiNaC::ex & lc)
const;
00114
virtual GiNaC::ex
concat_two_sums(
const GiNaC::ex & Z1,
const GiNaC::ex & Z2)
const;
00115
00116
00117
public :
00118 GiNaC::ex
get_index(
void)
const;
00119 GiNaC::ex
get_letter_list(
void)
const;
00120
unsigned get_depth(
void)
const;
00121 GiNaC::ex
get_weight(
void)
const;
00122
00123
protected:
00124
00125
00126
00127
friend GiNaC::ex
shuffle_Zsum(
const GiNaC::ex & Z1,
const GiNaC::ex & Z2);
00128
friend GiNaC::ex
convert_Zsum_to_Ssum(
const GiNaC::ex & Z1);
00129
friend GiNaC::ex
remove_trivial_Zsum(
const GiNaC::ex & expr);
00130
00131
00132
00133
protected:
00134
00135 GiNaC::ex n;
00136 GiNaC::ex letter_list;
00137 };
00138
00139 GINAC_DECLARE_UNARCHIVER(
Zsum);
00140
00141
00142
00148 inline GiNaC::ex Zsum::get_index(
void)
const
00149
{
00150
return n;
00151 }
00152
00158 inline GiNaC::ex Zsum::get_letter_list(
void)
const
00159
{
00160
return letter_list;
00161 }
00162
00168 inline unsigned Zsum::get_depth(
void)
const
00169
{
00170
return letter_list.nops();
00171 }
00172
00178 inline GiNaC::ex
create_Zsum(
const GiNaC::ex & nc,
const GiNaC::ex & llc)
00179 {
00180
return (
new Zsum(nc,llc))->setflag(GiNaC::status_flags::dynallocated);
00181 }
00182
00183 GiNaC::ex
shuffle_Zsum(
const GiNaC::ex & Z1,
const GiNaC::ex & Z2);
00184
00185 GiNaC::ex
convert_Zsum_to_Ssum(
const GiNaC::ex & Z1);
00186
00187 GiNaC::ex
create_Zsum_from_exvector(
const GiNaC::ex & nc,
const GiNaC::exvector & v);
00188
00189 GiNaC::ex
Zsum_to_Ssum(
const GiNaC::ex & expr);
00190
00191 GiNaC::ex
shift_upper_limit_plus_one_for_Zsum(
const GiNaC::ex & expr);
00192
00193 GiNaC::ex
remove_negative_degrees_from_Zsum(
const GiNaC::ex & expr);
00194
00195 GiNaC::ex
remove_trivial_Zsum(
const GiNaC::ex & expr);
00196
00197 }
00198
00199
#endif // ndef __NESTEDSUMS_ZSUM_H__