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

Bsum.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_Bsum_H__ 00027 #define __NESTEDSUMS_Bsum_H__ 00028 00029 #include "ginac/ginac.h" 00030 00031 namespace nestedsums { 00032 00034 00059 class Bsum : public GiNaC::basic 00060 { 00061 00062 GINAC_DECLARE_REGISTERED_CLASS(Bsum, GiNaC::basic) 00063 00064 // ctors 00065 public: 00066 Bsum(const GiNaC::ex & nc, const GiNaC::ex & llc); 00067 00068 // functions overriding virtual functions from bases classes 00069 public: 00070 void archive(GiNaC::archive_node &node) const; 00071 void read_archive(const GiNaC::archive_node &node, GiNaC::lst &sym_lst); 00072 00073 unsigned return_type(void) const { return GiNaC::return_types::noncommutative; } 00074 00075 void print(const GiNaC::print_context & c, unsigned level = 0) const; 00076 unsigned precedence(void) const {return 60;} 00077 GiNaC::ex eval(int level = 0) const; 00078 GiNaC::ex subs(const GiNaC::exmap & m, unsigned options = 0) const; 00079 00080 protected: 00081 GiNaC::ex eval_ncmul(const GiNaC::exvector & v) const; 00082 GiNaC::ex derivative(const GiNaC::symbol & s) const; 00083 unsigned calchash(void) const; 00084 00085 // new virtual functions which can be overridden by derived classes 00086 public : 00087 virtual GiNaC::ex convert_to_Ssum_exvector(const GiNaC::exvector & Z1) const; 00088 00089 virtual GiNaC::ex expand_members(int level = 0) const; 00090 00091 // non-virtual functions 00092 public : 00093 GiNaC::ex get_index(void) const; 00094 GiNaC::ex get_letter_list(void) const; 00095 unsigned get_depth(void) const; 00096 00097 protected: 00098 00099 // friends : 00100 friend GiNaC::ex convert_Bsum_to_Ssum(const GiNaC::ex & C); 00101 friend GiNaC::ex convert_Bsum_to_Zsum(const GiNaC::ex & C); 00102 00103 // member variables : 00104 00105 protected: 00106 00107 GiNaC::ex n; 00108 GiNaC::ex letter_list; 00109 }; 00110 00111 GINAC_DECLARE_UNARCHIVER(Bsum); 00112 00113 // inline functions 00114 00120 inline GiNaC::ex Bsum::get_index(void) const 00121 { 00122 return n; 00123 } 00124 00130 inline GiNaC::ex Bsum::get_letter_list(void) const 00131 { 00132 return letter_list; 00133 } 00134 00140 inline unsigned Bsum::get_depth(void) const 00141 { 00142 return letter_list.nops(); 00143 } 00144 00150 inline GiNaC::ex create_Bsum(const GiNaC::ex & nc, const GiNaC::ex & llc) 00151 { 00152 return (new Bsum(nc,llc))->setflag(GiNaC::status_flags::dynallocated); 00153 } 00154 00155 GiNaC::ex create_Bsum_from_exvector(const GiNaC::ex & nc, const GiNaC::exvector & v); 00156 00157 GiNaC::ex convert_Bsum_to_Ssum(const GiNaC::ex & C); 00158 GiNaC::ex convert_Bsum_to_Zsum(const GiNaC::ex & C); 00159 00160 } // namespace nestedsums 00161 00162 #endif // ndef __NESTEDSUMS_Bsum_H__

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