Macaulay2 Engine
Loading...
Searching...
No Matches
solvable.cpp
Go to the documentation of this file.
1// Copyright 2003 Michael E. Stillman
2
3#include "solvable.hpp"
4#include "gbring.hpp"
5
7{
8 // Nothing to do
9}
11{
12 Q_ = Q;
13 return true;
14}
15
17 const Monoid *M,
18 const Matrix *Q)
19{
21
22 result->initialize_poly_ring(K, M);
23 if (!result->initialize_solvable(Q)) return nullptr;
25 return result;
26}
27
29 const Matrix *Q)
30{
31 return create(R->getCoefficients(), R->getMonoid(), Q);
32}
33
34#if 0
35// const SolvableAlgebra *SolvableAlgebra::createPolyRing(const Monoid *M) const
36// // creates this[M], which is commutative in M variables, but skew commutative in
37// // (some of) the variables of this
38// {
39// const Monoid *newM = Monoid::tensor_product(M, getMonoid());
40// if (newM == 0) return 0;
41//
42// // Somehow generate a new matrix Q?
43// const Matrix *Q = Q_;
44//
45// return create(getCoefficients(),
46// newM,
47// this,
48// M,
49// Q);
50// }
51#endif
52
54 const ring_elem c,
55 const int *m) const
56// Computes c*m*f, BUT NOT doing normal form wrt a quotient ideal..
57{
58// TODO
59 (void) f;
60 (void) c;
61 (void) m;
62#ifdef DEVELOPMENT
63#warning "implement SolvableAlgebra::mult_by_term"
64#endif
65 return ZERO_RINGELEM;
66}
67
68ring_elem SolvableAlgebra::power(const ring_elem f, mpz_srcptr n) const
69{
70 std::pair<bool, int> n1 = RingZZ::get_si(n);
71 if (n1.first)
72 return power(f, n1.second);
73 else
74 throw exc::engine_error("exponent too large");
75}
76
78{
79 return Ring::power(f, n);
80}
81
82// Local Variables:
83// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
84// indent-tabs-mode: nil
85// End:
static GBRing * create_SolvableAlgebra(const Ring *K0, const Monoid *M0, const SolvableAlgebra *R)
Definition gbring.cpp:250
Engine-side commutative monomial monoid: variable names, ordering, multidegree machinery,...
Definition monoid.hpp:89
virtual const Monoid * getMonoid() const
Definition polyring.hpp:282
virtual const Ring * getCoefficients() const
Definition polyring.hpp:277
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 ring.cpp:109
xxx xxx xxx
Definition ring.hpp:102
static std::pair< bool, int > get_si(mpz_srcptr n)
Definition ZZ.cpp:46
static SolvableAlgebra * create(const Ring *K, const Monoid *M, const Matrix *Q)
Definition solvable.cpp:16
bool initialize_solvable(const Matrix *Q)
Definition solvable.cpp:10
virtual ring_elem mult_by_term(const ring_elem f, const ring_elem c, const int *m) const
Definition solvable.cpp:53
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 solvable.cpp:68
const Matrix * Q_
Definition solvable.hpp:58
virtual ~SolvableAlgebra()
Definition solvable.cpp:6
#define Matrix
Definition factory.cpp:14
GBRing and gbvector — the GB-tuned polynomial-ring view used by classical Buchberger code.
VALGRIND_MAKE_MEM_DEFINED & result(result)
#define ZERO_RINGELEM
Definition ring.hpp:677
SolvableAlgebra — scaffolding for a PBW algebra x_j x_i = x_i x_j + q_{ij} (multiplication unimplemen...