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

Csum.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_Csum_H__ 00027 #define __NESTEDSUMS_Csum_H__ 00028 00029 #include "ginac/ginac.h" 00030 00031 namespace nestedsums { 00032 00034 00087 class Csum : public GiNaC::basic 00088 { 00089 00090 GINAC_DECLARE_REGISTERED_CLASS(Csum, GiNaC::basic) 00091 00092 // ctors 00093 public: 00094 Csum(const GiNaC::ex & nc, const GiNaC::ex & llc); 00095 00096 // functions overriding virtual functions from bases classes 00097 public: 00098 void archive(GiNaC::archive_node &node) const; 00099 void read_archive(const GiNaC::archive_node &node, GiNaC::lst &sym_lst); 00100 00101 unsigned return_type(void) const { return GiNaC::return_types::noncommutative; } 00102 00103 void print(const GiNaC::print_context & c, unsigned level = 0) const; 00104 unsigned precedence(void) const {return 60;} 00105 GiNaC::ex eval(int level = 0) const; 00106 GiNaC::ex subs(const GiNaC::exmap & m, unsigned options = 0) const; 00107 00108 protected: 00109 GiNaC::ex eval_ncmul(const GiNaC::exvector & v) const; 00110 GiNaC::ex derivative(const GiNaC::symbol & s) const; 00111 unsigned calchash(void) const; 00112 00113 // new virtual functions which can be overridden by derived classes 00114 public : 00115 virtual GiNaC::ex convert_to_Ssum_exvector(const GiNaC::exvector & Z1) const; 00116 00117 virtual GiNaC::ex expand_members(int level = 0) const; 00118 00119 protected: 00120 virtual GiNaC::ex decrease_letter_degree(int m) const; 00121 virtual GiNaC::ex move_x0_into_x1(void) const; 00122 virtual GiNaC::ex move_x1_into_x2(void) const; 00123 virtual GiNaC::ex remove_x0(void) const; 00124 virtual GiNaC::ex remove_x0_and_x1(void) const; 00125 virtual GiNaC::ex cast_to_Bsum(void) const; 00126 00127 // non-virtual functions 00128 public : 00129 GiNaC::ex get_index(void) const; 00130 GiNaC::ex get_letter_list(void) const; 00131 unsigned get_depth(void) const; 00132 00133 // friends : 00134 friend GiNaC::ex convert_Csum_to_Ssum(const GiNaC::ex & C); 00135 friend GiNaC::ex convert_Csum_to_Zsum(const GiNaC::ex & C); 00136 00137 // member variables : 00138 00139 protected: 00140 00141 GiNaC::ex n; 00142 GiNaC::ex letter_list; 00143 }; 00144 00145 GINAC_DECLARE_UNARCHIVER(Csum); 00146 00147 // inline functions 00148 00154 inline GiNaC::ex Csum::get_index(void) const 00155 { 00156 return n; 00157 } 00158 00164 inline GiNaC::ex Csum::get_letter_list(void) const 00165 { 00166 return letter_list; 00167 } 00168 00174 inline unsigned Csum::get_depth(void) const 00175 { 00176 return letter_list.nops(); 00177 } 00178 00184 inline GiNaC::ex create_Csum(const GiNaC::ex & nc, const GiNaC::ex & llc) 00185 { 00186 return (new Csum(nc,llc))->setflag(GiNaC::status_flags::dynallocated); 00187 } 00188 00189 GiNaC::ex create_Csum_from_exvector(const GiNaC::ex & nc, const GiNaC::exvector & v); 00190 00191 GiNaC::ex convert_Csum_to_Ssum(const GiNaC::ex & C); 00192 GiNaC::ex convert_Csum_to_Zsum(const GiNaC::ex & C); 00193 00194 } // namespace nestedsums 00195 00196 #endif // ndef __NESTEDSUMS_Csum_H__

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