*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
vertex(ijpair ij = ijpair(0,0)) : indices(ij) { }
void increment_indices(const ijpair &ind) { indices.first += ind.first; indices.second += ind.second; }
virtual ~vertex() { }
vertex(ijpair ij = ijpair(0,0)) : indices(ij) { }
void increment_indices(const ijpair &ind) { indices.first += ind.first; indices.second += ind.second; }
virtual ~vertex() { }
virtual const ex evaluate(const symbol &x, const unsigned grad) const = 0;
bool operator==(const vertex &v) const { return (indices==v.indices); }
bool operator<(const vertex &v) const { return (indices<v.indices); }
virtual const ex evaluate(const symbol &x, const unsigned grad) const = 0;
bool operator==(const vertex &v) const { return (indices==v.indices); }
bool operator<(const vertex &v) const { return (indices<v.indices); }
class Sigma : public vertex {
public:
Sigma(ijpair ij = ijpair(0,0)) : vertex(ij) { }
class Sigma : public vertex {
public:
Sigma(ijpair ij = ijpair(0,0)) : vertex(ij) { }
- vertex* copy(void) const { return new Sigma(*this); }
- ijpair get_increment(void) const { return ijpair(indices.first+indices.second+1, 0); }
+ vertex* copy() const { return new Sigma(*this); }
+ ijpair get_increment() const { return ijpair(indices.first+indices.second+1, 0); }
class Sigma_flipped : public Sigma {
public:
Sigma_flipped(ijpair ij = ijpair(0,0)) : Sigma(ij) { }
class Sigma_flipped : public Sigma {
public:
Sigma_flipped(ijpair ij = ijpair(0,0)) : Sigma(ij) { }
- vertex* copy(void) const { return new Sigma_flipped(*this); }
- ijpair get_increment(void) const { return ijpair(0, indices.first+indices.second+1); }
+ vertex* copy() const { return new Sigma_flipped(*this); }
+ ijpair get_increment() const { return ijpair(0, indices.first+indices.second+1); }
class Gamma : public vertex {
public:
Gamma(ijpair ij = ijpair(0,0)) : vertex(ij) { }
class Gamma : public vertex {
public:
Gamma(ijpair ij = ijpair(0,0)) : vertex(ij) { }
- vertex* copy(void) const { return new Gamma(*this); }
- ijpair get_increment(void) const { return ijpair(indices.first+indices.second+1, 0); }
+ vertex* copy() const { return new Gamma(*this); }
+ ijpair get_increment() const { return ijpair(indices.first+indices.second+1, 0); }
class Vacuum : public vertex {
public:
Vacuum(ijpair ij = ijpair(0,0)) : vertex(ij) { }
class Vacuum : public vertex {
public:
Vacuum(ijpair ij = ijpair(0,0)) : vertex(ij) { }
ijpair get_increment() const { return ijpair(0, indices.first+indices.second+1); }
const ex evaluate(const symbol &x, const unsigned grad) const;
private:
ijpair get_increment() const { return ijpair(0, indices.first+indices.second+1); }
const ex evaluate(const symbol &x, const unsigned grad) const;
private:
~node() { delete vert; }
void add_child(const node &, bool = false);
const ex evaluate(const symbol &x, unsigned grad) const;
~node() { delete vert; }
void add_child(const node &, bool = false);
const ex evaluate(const symbol &x, unsigned grad) const;
// ...the sum, when evaluated and reexpanded, is the antipode...
ex result = 0;
for (vector<node>::iterator i=counter.begin(); i!=counter.end(); ++i)
// ...the sum, when evaluated and reexpanded, is the antipode...
ex result = 0;
for (vector<node>::iterator i=counter.begin(); i!=counter.end(); ++i)