Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

Zsum.h

Go to the documentation of this file.
00001 00008 /* 00009 * Copyright (C) 2001 Stefan Weinzierl 00010 * 00011 * This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 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 // ctors 00059 public: 00060 explicit Zsum(const GiNaC::ex & nc); 00061 Zsum(const GiNaC::ex & nc, const GiNaC::ex & llc); 00062 00063 // functions overriding virtual functions from bases classes 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 // new virtual functions which can be overridden by derived classes 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 // non-virtual functions 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 // friends : 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 // member variables : 00132 00133 protected: 00134 00135 GiNaC::ex n; 00136 GiNaC::ex letter_list; 00137 }; 00138 00139 GINAC_DECLARE_UNARCHIVER(Zsum); 00140 00141 // inline functions 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 } // namespace nestedsums 00198 00199 #endif // ndef __NESTEDSUMS_ZSUM_H__

Generated on Wed Jun 10 22:59:10 2009 for Nestedsums library by doxygen 1.3.7