File: solvable.cpp

package info (click to toggle)
macaulay2 1.21%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 133,096 kB
  • sloc: cpp: 110,377; ansic: 16,306; javascript: 4,193; makefile: 3,821; sh: 3,580; lisp: 764; yacc: 590; xml: 177; python: 140; perl: 114; lex: 65; awk: 3
file content (82 lines) | stat: -rw-r--r-- 2,137 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Copyright 2003 Michael E. Stillman

#include "solvable.hpp"
#include "gbring.hpp"

SolvableAlgebra::~SolvableAlgebra()
{
  // Nothing to do
}
bool SolvableAlgebra::initialize_solvable(const Matrix *Q)
{
  Q_ = Q;
  return true;
}

SolvableAlgebra *SolvableAlgebra::create(const Ring *K,
                                         const Monoid *M,
                                         const Matrix *Q)
{
  SolvableAlgebra *result = new SolvableAlgebra;

  result->initialize_poly_ring(K, M);
  if (!result->initialize_solvable(Q)) return 0;
  result->gb_ring_ = GBRing::create_SolvableAlgebra(K, M, result);
  return result;
}

SolvableAlgebra *SolvableAlgebra::create(const PolynomialRing *R,
                                         const Matrix *Q)
{
  return create(R->getCoefficients(), R->getMonoid(), Q);
}

#if 0
// const SolvableAlgebra *SolvableAlgebra::createPolyRing(const Monoid *M) const
//   // creates this[M], which is commutative in M variables, but skew commutative in
//   // (some of) the variables of this
// {
//   const Monoid *newM = Monoid::tensor_product(M, getMonoid());
//   if (newM == 0) return 0;
//
//   // Somehow generate a new matrix Q?
//   const Matrix *Q = Q_;
//
//   return create(getCoefficients(),
//              newM,
//              this,
//              M,
//              Q);
// }
#endif

ring_elem SolvableAlgebra::mult_by_term(const ring_elem f,
                                        const ring_elem c,
                                        const int *m) const
// Computes c*m*f, BUT NOT doing normal form wrt a quotient ideal..
{
// TODO
#ifdef DEVELOPMENT
#warning "implement SolvableAlgebra::mult_by_term"
#endif
  return ZERO_RINGELEM;
}

ring_elem SolvableAlgebra::power(const ring_elem f, mpz_srcptr n) const
{
  std::pair<bool, int> n1 = RingZZ::get_si(n);
  if (n1.first)
    return power(f, n1.second);
  else
    throw exc::engine_error("exponent too large");
}

ring_elem SolvableAlgebra::power(const ring_elem f, int n) const
{
  return Ring::power(f, n);
}

// Local Variables:
// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
// indent-tabs-mode: nil
// End: