Macaulay2 Engine
Loading...
Searching...
No Matches
weylalg.hpp
Go to the documentation of this file.
1// Copyright 1997 Michael E. Stillman
2// TODO: utilize ExponentVector instead of int *
3
4#ifndef _weylalg_hh_
5#define _weylalg_hh_
6
39
40#include "poly.hpp"
41#include "gbring.hpp"
42
44
60class WeylAlgebra : public PolyRing
61{
64 int _homog_var; // Only used if 'homogeneous_weyl_algebra' is true.
65 int *_derivative; // a value _derivative[i] = r >= 0 means that i is diff(r).
66 // If < 0 : the variable i does not have a diff op.
67 int *_commutative; // Same as above, but in opposite direction.
68
69 static int binomtop;
70 static int diffcoeffstop;
71 static int **binomtable;
72 static int **diffcoeffstable;
73
74 void initialize1();
75 bool initialize_weyl(M2_arrayint derivs, M2_arrayint comms, int homog_var);
77 virtual ~WeylAlgebra() {}
78 protected:
79 void extractDerivativePart(const_exponents exp, int *result) const;
80 void extractCommutativePart(const_exponents exp, int *result) const;
81 ring_elem binomial(int top, int bottom) const;
83 const_exponents exptop,
84 const_exponents expbottom) const;
85 bool increment(int *current_derivative, const int *top_derivative) const;
86
87 bool divides(const_exponents expbottom, const_exponents exptop) const;
89 const int *derivatives,
90 const_exponents exp) const;
91
92 Nterm *weyl_diff(const ring_elem c,
93 const_exponents expf,
94 const int *derivatives,
95 const Nterm *g) const; // An entire polynomial
96 vec weyl_diff(const ring_elem c,
97 const_exponents expf,
98 const int *derivatives,
99 const vec g) const; // An entire polynomial
100 vec weyl_diff(const FreeModule *resultF,
101 const ring_elem c,
102 const_exponents expf,
103 int component,
104 const int *derivatives,
105 const Nterm *g) const; // An entire polynomial
106
108 GBRing *GR,
109 const ring_elem c, // in K
110 int comp, // adds this component to each component of g.
111 const_exponents expf,
112 const int *derivatives,
113 const FreeModule *Fg, // Free module of g, unless g is a ring element
114 const gbvector *g) const; // An entire polynomial
115 public:
116 static WeylAlgebra *create(const Ring *K,
117 const Monoid *M,
118 M2_arrayint derivs,
119 M2_arrayint comms,
120 int homog_var);
121
122 virtual bool is_commutative_ring() const { return false; }
123 virtual bool is_weyl_algebra() const { return true; }
124 virtual const WeylAlgebra *cast_to_WeylAlgebra() const { return this; }
125 virtual void text_out(buffer &o) const;
126
127 virtual ring_elem power(const ring_elem f, mpz_srcptr n) const;
128 virtual ring_elem power(const ring_elem f, int n) const;
129
131
132 public:
133 virtual ring_elem mult_by_term(const ring_elem f,
134 const ring_elem c,
135 const_monomial m) const;
136
139 const gbvector *f,
140 const ring_elem c, // in the base K
141 const_monomial m, // monomial, in M
142 int comp) const; // comp is either 0 or a real component.
143};
144
145#endif
146
147// Local Variables:
148// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
149// indent-tabs-mode: nil
150// End:
exponents::ConstExponents const_exponents
Polynomial-ring view tuned for the inner loop of classical Buchberger Groebner-basis computations.
Definition gbring.hpp:120
Engine-side commutative monomial monoid: variable names, ordering, multidegree machinery,...
Definition monoid.hpp:89
friend class FreeModule
Definition poly.hpp:66
PolyRing()
Definition poly.hpp:82
xxx xxx xxx
Definition ring.hpp:102
bool initialize_weyl(M2_arrayint derivs, M2_arrayint comms, int homog_var)
Definition weylalg.cpp:10
static int diffcoeffstop
Definition weylalg.hpp:70
ring_elem diff_coefficients(const ring_elem c, const int *derivatives, const_exponents exp) const
Definition weylalg.cpp:307
vec weyl_diff(const FreeModule *resultF, const ring_elem c, const_exponents expf, int component, const int *derivatives, const Nterm *g) const
void extractCommutativePart(const_exponents exp, int *result) const
Definition weylalg.cpp:298
static int binomtop
Definition weylalg.hpp:69
int * _derivative
Definition weylalg.hpp:65
gbvector * gbvector_weyl_diff(GBRing *GR, const ring_elem c, int comp, const_exponents expf, const int *derivatives, const FreeModule *Fg, const gbvector *g) const
Definition weylalg.cpp:456
ring_elem multinomial(const ring_elem a, const_exponents exptop, const_exponents expbottom) const
virtual bool is_commutative_ring() const
Definition weylalg.hpp:122
int _homog_var
Definition weylalg.hpp:64
virtual ring_elem power(const ring_elem f, mpz_srcptr n) const
Exponentiation. This is the default function, if a class doesn't define this.
Definition weylalg.cpp:597
gbvector * gbvector_mult_by_term(gbvectorHeap &result, const gbvector *f, const ring_elem c, const_monomial m, int comp) const
Definition weylalg.cpp:541
void extractDerivativePart(const_exponents exp, int *result) const
Definition weylalg.cpp:290
int _nderivatives
Definition weylalg.hpp:62
virtual void text_out(buffer &o) const
Definition weylalg.cpp:161
bool _homogeneous_weyl_algebra
Definition weylalg.hpp:63
virtual ring_elem mult_by_term(const ring_elem f, const ring_elem c, const_monomial m) const
Definition weylalg.cpp:420
int * _commutative
Definition weylalg.hpp:67
vec weyl_diff(const ring_elem c, const_exponents expf, const int *derivatives, const vec g) const
static int ** binomtable
Definition weylalg.hpp:71
void initialize1()
Definition weylalg.cpp:175
ring_elem binomial(int top, int bottom) const
Definition weylalg.cpp:227
virtual const WeylAlgebra * cast_to_WeylAlgebra() const
Definition weylalg.hpp:124
virtual ~WeylAlgebra()
Definition weylalg.hpp:77
Nterm * weyl_diff(const ring_elem c, const_exponents expf, const int *derivatives, const Nterm *g) const
Definition weylalg.cpp:339
virtual bool is_weyl_algebra() const
Definition weylalg.hpp:123
bool divides(const_exponents expbottom, const_exponents exptop) const
Definition weylalg.cpp:266
bool increment(int *current_derivative, const int *top_derivative) const
Definition weylalg.cpp:273
static WeylAlgebra * create(const Ring *K, const Monoid *M, M2_arrayint derivs, M2_arrayint comms, int homog_var)
Definition weylalg.cpp:99
static int ** diffcoeffstable
Definition weylalg.hpp:72
GBRing and gbvector — the GB-tuned polynomial-ring view used by classical Buchberger code.
const int * const_monomial
Definition imonorder.hpp:45
VALGRIND_MAKE_MEM_DEFINED & result(result)
Concrete commutative PolyRing — standard polynomial ring inheriting from PolyRingFlat.
Singly linked-list node carrying one term of a polynomial-ring element.
Definition ringelem.hpp:156