00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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
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
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
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
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
00104
friend GiNaC::ex
concat(
const basic_letter & l1,
const basic_letter & l2);
00105
00106
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
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 }
00183
00184
#endif // ndef __NESTEDSUMS_BASIC_LETTER_H__