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

Ssum.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_SSUM_H__ 00027 #define __NESTEDSUMS_SSUM_H__ 00028 00029 #include "ginac/ginac.h" 00030 00031 namespace nestedsums { 00032 00034 00055 class Ssum : public GiNaC::basic 00056 { 00057 // Csum accesses the methods 00058 // multiply_last_letter 00059 // increases_las_letter 00060 // append_letter 00061 friend class Csum; 00062 00063 GINAC_DECLARE_REGISTERED_CLASS(Ssum, GiNaC::basic) 00064 00065 // ctors 00066 public: 00067 explicit Ssum(const GiNaC::ex & nc); 00068 Ssum(const GiNaC::ex & nc, const GiNaC::ex & llc); 00069 00070 // functions overriding virtual functions from bases classes 00071 public: 00072 void archive(GiNaC::archive_node &node) const; 00073 void read_archive(const GiNaC::archive_node &node, GiNaC::lst &sym_lst); 00074 00075 unsigned return_type(void) const { return GiNaC::return_types::noncommutative; } 00076 00077 void print(const GiNaC::print_context & c, unsigned level = 0) const; 00078 unsigned precedence(void) const {return 60;} 00079 GiNaC::ex eval(int level = 0) const; 00080 GiNaC::ex subs(const GiNaC::exmap & m, unsigned options = 0) const; 00081 00082 protected: 00083 GiNaC::ex eval_ncmul(const GiNaC::exvector & v) const; 00084 GiNaC::ex derivative(const GiNaC::symbol & s) const; 00085 unsigned calchash(void) const; 00086 00087 // new virtual functions which can be overridden by derived classes 00088 public : 00089 virtual GiNaC::ex convert_to_Zsum_exvector(const GiNaC::exvector & Z0, const GiNaC::exvector & Z1) const; 00090 virtual GiNaC::ex shuffle_exvector(const GiNaC::exvector & Z0, const GiNaC::exvector & Z1, const GiNaC::exvector & Z2) const; 00091 00092 virtual GiNaC::ex refine_exvector(unsigned q, const GiNaC::exvector & Z0, const GiNaC::exvector & Z1) const; 00093 virtual GiNaC::ex refine(unsigned q) const; 00094 00095 virtual GiNaC::ex set_index(const GiNaC::ex & i) const; 00096 virtual GiNaC::ex shift_plus_one(void) const; 00097 virtual GiNaC::ex shift_minus_one(void) const; 00098 virtual GiNaC::ex adjust_upper_limit_downwards(const GiNaC::ex & i) const; 00099 virtual GiNaC::ex adjust_upper_limit_upwards(const GiNaC::ex & i) const; 00100 virtual GiNaC::ex adjust_upper_limit_plus_one(void) const; 00101 virtual GiNaC::ex index_eq_one(void) const; 00102 00103 virtual GiNaC::ex get_head(int k) const; 00104 virtual GiNaC::ex get_tail(int k) const; 00105 virtual int flag_remove_negative_degrees(void) const; 00106 virtual GiNaC::ex remove_negative_degrees(void) const; 00107 00108 virtual GiNaC::ex expand_members(int level = 0) const; 00109 virtual GiNaC::ex eval_explicit(int level = 0) const; 00110 00111 virtual GiNaC::ex get_first_letter(void) const; 00112 virtual GiNaC::ex remove_first_letter(void) const; 00113 virtual GiNaC::ex remove_first_letter(const GiNaC::ex & nc) const; 00114 virtual GiNaC::ex prepend_letter(const GiNaC::ex & lc) const; 00115 virtual GiNaC::ex prepend_letter(const GiNaC::ex & nc, const GiNaC::ex & lc) const; 00116 virtual GiNaC::ex append_letter(const GiNaC::ex & lc) const; 00117 virtual GiNaC::ex append_letter_list(const GiNaC::ex & lc) const; 00118 00119 protected: 00120 virtual GiNaC::ex cast_to_Zsum(void) const; 00121 00122 virtual GiNaC::ex multiply_letter_with_last_letter(const GiNaC::ex & lc) const; 00123 virtual GiNaC::ex multiply_letter_with_first_letter(const GiNaC::ex & lc) const; 00124 virtual GiNaC::ex concat_two_sums(const GiNaC::ex & Z1, const GiNaC::ex & Z2) const; 00125 00126 // non-virtual functions 00127 public : 00128 GiNaC::ex get_index(void) const; 00129 GiNaC::ex get_letter_list(void) const; 00130 unsigned get_depth(void) const; 00131 GiNaC::ex get_weight(void) const; 00132 00133 // friends : 00134 friend GiNaC::ex shuffle_Ssum(const GiNaC::ex & Z1, const GiNaC::ex & Z2); 00135 friend GiNaC::ex convert_Ssum_to_Zsum(const GiNaC::ex & Z1); 00136 friend GiNaC::ex remove_trivial_Ssum(const GiNaC::ex & expr); 00137 00138 // member variables : 00139 00140 protected: 00141 00142 GiNaC::ex n; 00143 GiNaC::ex letter_list; 00144 }; 00145 00146 GINAC_DECLARE_UNARCHIVER(Ssum); 00147 00148 // inline functions 00149 00155 inline GiNaC::ex Ssum::get_index(void) const 00156 { 00157 return n; 00158 } 00159 00165 inline GiNaC::ex Ssum::get_letter_list(void) const 00166 { 00167 return letter_list; 00168 } 00169 00175 inline unsigned Ssum::get_depth(void) const 00176 { 00177 return letter_list.nops(); 00178 } 00179 00185 inline GiNaC::ex create_Ssum(const GiNaC::ex & nc, const GiNaC::ex & llc) 00186 { 00187 return (new Ssum(nc,llc))->setflag(GiNaC::status_flags::dynallocated); 00188 } 00189 00190 GiNaC::ex shuffle_Ssum(const GiNaC::ex & Z1, const GiNaC::ex & Z2); 00191 00192 GiNaC::ex convert_Ssum_to_Zsum(const GiNaC::ex & Z1); 00193 00194 GiNaC::ex create_Ssum_from_exvector(const GiNaC::ex & nc, const GiNaC::exvector & v); 00195 00196 GiNaC::ex Ssum_to_Zsum(const GiNaC::ex & expr); 00197 00198 GiNaC::ex shift_upper_limit_plus_one_for_Ssum(const GiNaC::ex & expr); 00199 00200 GiNaC::ex remove_negative_degrees_from_Ssum(const GiNaC::ex & expr); 00201 00202 GiNaC::ex remove_trivial_Ssum(const GiNaC::ex & expr); 00203 00204 GiNaC::ex refine_Ssum(const GiNaC::ex & expr, unsigned q); 00205 00206 } // namespace nestedsums 00207 00208 #endif // ndef __NESTEDSUMS_SSUM_H__

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