Macaulay2 Engine
Loading...
Searching...
No Matches
res-a0-poly.hpp
Go to the documentation of this file.
1// Copyright 1996. Michael E. Stillman
2
3#ifndef _respoly2_hh_
4#define _respoly2_hh_
5
6#include "monideal.hpp"
7#include "res-a0-pair.hpp"
8struct res2term;
9
17
19{
21 const Monoid *M;
22 const Ring *K; // Coefficient field of R.
23
26
27 res2term *new_term() const;
28
29 void sort(res2term *&f) const;
30
31 public:
33 ~res2_poly();
34
35 const res2_pair *lead_component(const res2term *f) const;
36 // int lead_coefficient(const res2term *f) const;
37 const int *lead_monomial(const res2term *f) const; // Lead TOTAL monomial
38
39 res2term *new_term(ring_elem c, const int *m, res2_pair *comp) const;
40 res2term *mult_by_monomial(const res2term *f, const int *m) const;
41 res2term *mult_by_coefficient(const res2term *f, const ring_elem c) const;
42 void make_monic(res2term *&f) const;
43 res2term *mult_by_term(const res2term *f, ring_elem c, const int *m) const;
45 ring_elem c,
46 const int *m,
47 res2_pair *x) const;
48 void add_to(res2term *&f, res2term *&g) const; // Destroys both f and g.
50 ring_elem c,
51 const int *m,
52 const res2term *g) const;
54 ring_elem c,
55 const int *m,
56 res2_pair *x,
57 const ring_elem g) const;
58
59 int compare(const res2term *a, const res2term *b) const;
60
61 res2term *strip(const res2term *f) const;
63 const res2term *f) const;
64
65 res2term *copy(const res2term *f) const;
66 void remove(res2term *&f) const;
67
68 vec to_vector(const res2term *f,
69 const FreeModule *F,
70 int to_minimal = 0) const;
71 res2term *from_vector(const VECTOR(res2_pair *)& base, const vec v) const;
72
73 int n_terms(const res2term *f) const; // Used for stats
74 void elem_text_out(buffer &o,
75 const res2term *f) const; // Used for debugging and stats
76 void elem_text_out(const res2term *f) const; // Used for debugging and stats
77
78 const PolynomialRing *get_ring() const { return R; }
79};
80
81inline const res2_pair *res2_poly::lead_component(const res2term *f) const
82{
83 return f->comp;
84}
85// inline int res2_poly::lead_coefficient(const res2term *f) const { return
86// f->coeff; }
87inline const int *res2_poly::lead_monomial(const res2term *f) const
88{
89 return f->monom;
90}
91
92#endif
93
94// Local Variables:
95// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
96// indent-tabs-mode: nil
97// End:
Engine-side free module R^n over a Ring.
Definition freemod.hpp:66
Engine-side commutative monomial monoid: variable names, ordering, multidegree machinery,...
Definition monoid.hpp:89
Abstract base for the engine's polynomial-ring hierarchy.
Definition polyring.hpp:96
xxx xxx xxx
Definition ring.hpp:102
res2_poly(PolynomialRing *R)
size_t respoly_size
res2term * copy(const res2term *f) const
const Monoid * M
res2term * from_vector(const VECTOR(res2_pair *)&base, const vec v) const
const res2_pair * lead_component(const res2term *f) const
const res2term * component_occurs_in(const res2_pair *x, const res2term *f) const
res2term * mult_by_monomial(const res2term *f, const int *m) const
void sort(res2term *&f) const
stash * resterm_stash
res2term * strip(const res2term *f) const
void add_to(res2term *&f, res2term *&g) const
const Ring * K
int n_terms(const res2term *f) const
const PolynomialRing * get_ring() const
res2term * ring_mult_by_term(const ring_elem f, ring_elem c, const int *m, res2_pair *x) const
void make_monic(res2term *&f) const
void ring_subtract_multiple_to(res2term *&f, ring_elem c, const int *m, res2_pair *x, const ring_elem g) const
void subtract_multiple_to(res2term *&f, ring_elem c, const int *m, const res2term *g) const
int compare(const res2term *a, const res2term *b) const
res2term * mult_by_coefficient(const res2term *f, const ring_elem c) const
void elem_text_out(buffer &o, const res2term *f) const
res2term * mult_by_term(const res2term *f, ring_elem c, const int *m) const
const PolynomialRing * R
const int * lead_monomial(const res2term *f) const
vec to_vector(const res2term *f, const FreeModule *F, int to_minimal=0) const
res2term * new_term() const
void remove(res2term *&f) const
Definition mem.hpp:78
static CanonicalForm base
Definition factory.cpp:289
MonomialIdeal — exponent-vector-only representation of an ideal generated by monomials.
#define VECTOR(T)
Definition newdelete.hpp:78
volatile int x
res2term * next
res2_pair * comp
ring_elem coeff
int monom[1]