00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
#ifndef __NESTEDSUMS_ROOT_OF_UNITY_H__
00027
#define __NESTEDSUMS_ROOT_OF_UNITY_H__
00028
00029
#include "ginac/ginac.h"
00030
00031
namespace nestedsums {
00032
00041 class root_of_unity :
public GiNaC::basic
00042 {
00043 GINAC_DECLARE_REGISTERED_CLASS(
root_of_unity, GiNaC::basic)
00044
00045
00046
public:
00047
root_of_unity(
unsigned l,
unsigned k);
00048
00049
00050
public:
00051
void archive(GiNaC::archive_node &node)
const;
00052
void read_archive(
const GiNaC::archive_node &node, GiNaC::lst &sym_lst);
00053
00054
unsigned return_type(
void)
const {
return GiNaC::return_types::noncommutative; }
00055
00056
void print(
const GiNaC::print_context & c,
unsigned level = 0)
const;
00057
unsigned precedence(
void)
const {
return 50;}
00058 GiNaC::ex
eval(
int level = 0)
const;
00059 GiNaC::ex subs(
const GiNaC::exmap & m,
unsigned options = 0)
const;
00060
00061
protected:
00062 GiNaC::ex
eval_ncmul(
const GiNaC::exvector & v)
const;
00063 GiNaC::ex derivative(
const GiNaC::symbol & s)
const;
00064
unsigned calchash(
void)
const;
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
protected:
00075
00076
unsigned l;
00077
unsigned k;
00078 };
00079
00080 GINAC_DECLARE_UNARCHIVER(
root_of_unity);
00081
00082
00083
00089 inline GiNaC::ex
create_root_of_unity(
unsigned l ,
unsigned k)
00090 {
00091
return (
new root_of_unity(l,k))->setflag(GiNaC::status_flags::dynallocated);
00092 }
00093
00094 }
00095
00096
#endif // ndef __NESTEDSUMS_ROOT_OF_UNITY_H__