Macaulay2 Engine
Loading...
Searching...
No Matches
schorder.hpp
Go to the documentation of this file.
1// Copyright 2002 Michael E. Stillman
2
3#ifndef _schorder_hpp_
4#define _schorder_hpp_
5
45
46#include "buffer.hpp"
47#include "monoid.hpp"
48
49class GBMatrix;
50class Matrix;
51
68{
69 const Monoid *M;
70
71 // Each 'entry' is an array of ints of length _nslots:
72 // compare_num, followed by the (encoded) monomial.
75 int _rank;
76
78 : M(m), _nslots(m->monomial_size() + 1), _rank(0)
79 {
80 }
81 ~SchreyerOrder() { abort(); }
82 public:
83 static SchreyerOrder *create(const Monoid *m);
84 static SchreyerOrder *create(const Matrix *m);
85 static SchreyerOrder *create(const GBMatrix *m);
86
87 void remove();
88
89 int rank() const { return _rank; }
90 int compare_num(int i) const { return _order[i * _nslots]; }
91 const_monomial base_monom(int i) const { return _order.data() + i * _nslots + 1; }
92 const Monoid *getMonoid() const { return M; }
93 bool is_equal(const SchreyerOrder *G) const;
94 SchreyerOrder *copy() const;
95 SchreyerOrder *sub_space(int n) const;
97 void append_order(const SchreyerOrder *G);
99 SchreyerOrder *tensor(const SchreyerOrder *G) const;
100 SchreyerOrder *exterior(int p) const;
101
102 SchreyerOrder *symm(int n) const;
103
105 // Copies the monomial
106
107 void schreyer_up(const_monomial m, int comp, monomial result) const
108 // 'result' is allowed to be 'm'.
109 {
110 M->mult(m, base_monom(comp), result);
111 }
112
114 // 'result' is allowed to be 'm'.
115 {
116 M->divide(m, base_monom(comp), result);
117 }
118
120 int m_comp,
122 int n_comp) const;
123
125 int m_comp,
127 int n_comp) const;
128
129 void text_out(buffer &o) const;
130};
131
132#endif
133
134// Local Variables:
135// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
136// indent-tabs-mode: nil
137// End:
Append-only GC-backed byte buffer used throughout the engine for text output.
Engine-side commutative monomial monoid: variable names, ordering, multidegree machinery,...
Definition monoid.hpp:89
void append_order(const SchreyerOrder *G)
Definition schorder.cpp:184
void text_out(buffer &o) const
Definition schorder.cpp:326
int schreyer_compare_encoded(const_monomial m, int m_comp, const_monomial n, int n_comp) const
Definition schorder.cpp:356
bool is_equal(const SchreyerOrder *G) const
Definition schorder.cpp:133
SchreyerOrder * exterior(int p) const
Definition schorder.cpp:219
void append(int compare_num, const_monomial base_monom)
Definition schorder.cpp:19
SchreyerOrder * symm(int n) const
Definition schorder.cpp:319
SchreyerOrder * sub_space(int n) const
Definition schorder.cpp:154
static SchreyerOrder * create(const Monoid *m)
Definition schorder.cpp:11
const Monoid * M
Definition schorder.hpp:69
const Monoid * getMonoid() const
Definition schorder.hpp:92
SchreyerOrder(const Monoid *m)
Definition schorder.hpp:77
int schreyer_compare(const_monomial m, int m_comp, const_monomial n, int n_comp) const
Definition schorder.cpp:337
void remove()
Definition schorder.cpp:18
int rank() const
Definition schorder.hpp:89
SchreyerOrder * direct_sum(const SchreyerOrder *G) const
Definition schorder.cpp:190
SchreyerOrder * tensor(const SchreyerOrder *G) const
Definition schorder.cpp:198
void schreyer_up(const_monomial m, int comp, monomial result) const
Definition schorder.hpp:107
void schreyer_down(const_monomial m, int comp, monomial result) const
Definition schorder.hpp:113
gc_vector< int > _order
Definition schorder.hpp:73
int compare_num(int i) const
Definition schorder.hpp:90
const_monomial base_monom(int i) const
Definition schorder.hpp:91
SchreyerOrder * copy() const
Definition schorder.cpp:146
Per-component tie-breaker data for a Schreyer monomial order on a FreeModule.
Definition schorder.hpp:68
#define Matrix
Definition factory.cpp:14
#define monomial
Definition gb-toric.cpp:11
int p
const int * const_monomial
Definition imonorder.hpp:45
VALGRIND_MAKE_MEM_DEFINED & result(result)
Monoid — variable count, naming, grading, and monomial order of a polynomial ring.
typename std::vector< T, gc_allocator< T > > gc_vector
a version of the STL vector, which allocates its backing memory with gc.
Definition newdelete.hpp:76
tbb::flow::graph G
gbvector-side matrix: a target FreeModule plus a list of gbvector* columns living in it.
Definition Eschreyer.hpp:54