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

basic_letter.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_BASIC_LETTER_H__ 00027 #define __NESTEDSUMS_BASIC_LETTER_H__ 00028 00029 #include "ginac/ginac.h" 00030 00031 namespace nestedsums { 00032 00034 00049 class basic_letter : public GiNaC::basic 00050 { 00051 GINAC_DECLARE_REGISTERED_CLASS(basic_letter, GiNaC::basic) 00052 00053 // ctors 00054 public: 00055 basic_letter(const GiNaC::ex & l, const GiNaC::ex & d, const GiNaC::ex & o); 00056 basic_letter(const GiNaC::ex & l, const GiNaC::ex & d, const GiNaC::ex & o, const GiNaC::ex & i); 00057 00058 // functions overriding virtual functions from base classes 00059 public: 00060 void archive(GiNaC::archive_node &node) const; 00061 void read_archive(const GiNaC::archive_node &node, GiNaC::lst &sym_lst); 00062 00063 unsigned return_type(void) const { return GiNaC::return_types::noncommutative; } 00064 00065 void print(const GiNaC::print_context & c, unsigned level = 0) const; 00066 unsigned precedence(void) const {return 50;} 00067 GiNaC::ex eval(int level = 0) const; 00068 GiNaC::ex subs(const GiNaC::exmap & m, unsigned options = 0) const; 00069 00070 protected: 00071 GiNaC::ex eval_ncmul(const GiNaC::exvector & v) const; 00072 GiNaC::ex derivative(const GiNaC::symbol & s) const; 00073 unsigned calchash(void) const; 00074 00075 // new virtual functions which can be overridden by derived classes 00076 public: 00077 virtual GiNaC::ex concat(const GiNaC::ex & l) const; 00078 virtual GiNaC::ex eval_explicit(int level = 0) const; 00079 virtual GiNaC::ex expand_members(int level = 0) const; 00080 00081 protected: 00082 virtual GiNaC::ex concat_speedy(const GiNaC::ex & l) const; 00083 00084 // non-virtual functions 00085 public: 00086 GiNaC::ex get_scale(void) const; 00087 GiNaC::ex get_degree(void) const; 00088 GiNaC::ex get_offset(void) const; 00089 GiNaC::ex get_index(void) const; 00090 00091 GiNaC::ex set_index(const GiNaC::ex & i) const; 00092 GiNaC::ex forget_index(void) const; 00093 GiNaC::ex shift_index(const GiNaC::ex & new_index) const; 00094 GiNaC::ex index_eq_one(void) const; 00095 00096 GiNaC::ex shift_plus_one(void) const; 00097 GiNaC::ex shift_minus_one(void) const; 00098 GiNaC::ex degree_minus_one(void) const; 00099 GiNaC::ex degree_plus_one(void) const; 00100 00101 protected: 00102 00103 // friends : 00104 friend GiNaC::ex concat(const basic_letter & l1, const basic_letter & l2); 00105 00106 // member variables : 00107 00108 protected: 00109 00110 GiNaC::ex scale; 00111 GiNaC::ex degree; 00112 GiNaC::ex offset; 00113 GiNaC::ex index; 00114 }; 00115 00116 GINAC_DECLARE_UNARCHIVER(basic_letter); 00117 00118 // inline functions 00119 00125 inline GiNaC::ex basic_letter::get_scale(void) const 00126 { 00127 return scale; 00128 } 00129 00135 inline GiNaC::ex basic_letter::get_degree(void) const 00136 { 00137 return degree; 00138 } 00139 00145 inline GiNaC::ex basic_letter::get_offset(void) const 00146 { 00147 return offset; 00148 } 00149 00155 inline GiNaC::ex basic_letter::get_index(void) const 00156 { 00157 return index; 00158 } 00159 00165 inline GiNaC::ex create_basic_letter(const GiNaC::ex & l, const GiNaC::ex & d, const GiNaC::ex & o) 00166 { 00167 return (new basic_letter(l,d,o))->setflag(GiNaC::status_flags::dynallocated); 00168 } 00169 00175 inline GiNaC::ex create_basic_letter(const GiNaC::ex & l, const GiNaC::ex & d, const GiNaC::ex & o, const GiNaC::ex & i) 00176 { 00177 return (new basic_letter(l,d,o,i))->setflag(GiNaC::status_flags::dynallocated); 00178 } 00179 00180 GiNaC::ex concat(const basic_letter & l1, const basic_letter & l2); 00181 00182 } // namespace nestedsums 00183 00184 #endif // ndef __NESTEDSUMS_BASIC_LETTER_H__

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