Macaulay2 Engine
Loading...
Searching...
No Matches
comp-gb.hpp
Go to the documentation of this file.
1// Copyright 2004 Michael E. Stillman.
2
3#ifndef _comp_gb_hpp_
4#define _comp_gb_hpp_
5
44
45#include "comp.hpp"
46class buffer;
47
48// The following are the return values from s_pair_step,
49// These are used in GB_comp, GBinhom_comp
50const int SPAIR_DONE = 0;
51const int SPAIR_GB = 1;
52const int SPAIR_SYZ = 2;
53const int SPAIR_ZERO = 3;
54const int SPAIR_MINGEN = 4;
55const int SPAIR_GEN = 5;
56const int SPAIR_PAIR = 6;
57const int SPAIR_RING = 7;
58const int SPAIR_REMOVED = 8;
59const int SPAIR_DEFERRED = 9;
60
67// This is the base type for all Groebner basis and syzygy computations
68// Note: some abstract methods in Computation need also to be defined.
69{
70 protected:
71 friend class GBProxy;
74 // If the stop conditions in _Stop are inappropriate,
75 // return false, and use ERROR(...) to provide an error message.
76
77 public:
78 virtual ~GBComputation();
79
80 virtual void remove_gb() = 0; // Should free all space associated with GB
81
82 GBComputation *cast_to_GBComputation() override { return this; }
83 static GBComputation *choose_gb(const Matrix *m,
84 M2_bool collect_syz,
85 int n_rows_to_keep,
86 M2_arrayint gb_weights,
87 M2_bool use_max_degree,
88 int max_degree,
89 int algorithm,
90 int strategy,
91 int numThreads,
92 int max_reduction_count = 10);
93 // Values for algorithm and strategy are documented in engine.h
94 // Returns NULL if an error occurs
95
96 virtual const Ring *get_ring() const = 0;
97
98 virtual Computation /* or null */ *set_hilbert_function(const RingElement *h);
99 // The default version returns an error saying that Hilbert functions cannot
100 // be used.
101
102 void start_computation() override = 0;
103
104 int complete_thru_degree() const override = 0;
105 // The computation is complete up through this degree.
106
107 // Recall that the status of the computation is maintained by the Computation
108 // class,
109
111 // Results of the computation //
113 virtual const Matrix /* or null */ *get_gb() = 0;
114
115 virtual const Matrix /* or null */ *get_mingens() = 0;
116
117 virtual const Matrix /* or null */ *get_change() = 0;
118
119 virtual const Matrix /* or null */ *get_syzygies() = 0;
120
121 virtual const Matrix /* or null */ *get_initial(int nparts) = 0;
122
123 virtual const Matrix /* or null */ *get_parallel_lead_terms(M2_arrayint w);
124
126 // Normal forms and lifting ////
128
129 virtual const Matrix /* or null */ *matrix_remainder(const Matrix *m) = 0;
130
131 virtual M2_bool matrix_lift(const Matrix *m,
132 const Matrix /* or null */ **result_remainder,
133 const Matrix /* or null */ **result_quotient) = 0;
134
135 virtual int contains(const Matrix *m) = 0;
136
138 // Statistics and spair information //
140
141 void text_out(buffer &o) const override;
142 // This displays statistical information, and depends on the
143 // M2_gbTrace value.
144};
145
146#endif
147
148// Local Variables:
149// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
150// indent-tabs-mode: nil
151// End:
Computation()
Definition comp.cpp:40
int complete_thru_degree() const override=0
virtual Computation * set_hilbert_function(const RingElement *h)
Definition comp-gb.cpp:208
virtual const Matrix * get_change()=0
virtual ~GBComputation()
Definition comp-gb.cpp:33
virtual const Matrix * get_mingens()=0
virtual M2_bool matrix_lift(const Matrix *m, const Matrix **result_remainder, const Matrix **result_quotient)=0
virtual const Matrix * matrix_remainder(const Matrix *m)=0
GBComputation * cast_to_GBComputation() override
Definition comp-gb.hpp:82
void start_computation() override=0
virtual void remove_gb()=0
static GBComputation * choose_gb(const Matrix *m, M2_bool collect_syz, int n_rows_to_keep, M2_arrayint gb_weights, M2_bool use_max_degree, int max_degree, int algorithm, int strategy, int numThreads, int max_reduction_count=10)
Definition comp-gb.cpp:39
friend class GBProxy
Definition comp-gb.hpp:71
virtual const Ring * get_ring() const =0
void text_out(buffer &o) const override
Definition comp-gb.cpp:34
virtual int contains(const Matrix *m)=0
virtual const Matrix * get_parallel_lead_terms(M2_arrayint w)
Definition comp-gb.cpp:218
virtual const Matrix * get_syzygies()=0
virtual const Matrix * get_gb()=0
virtual const Matrix * get_initial(int nparts)=0
base class for Groebner basis computations.
Definition comp-gb.hpp:69
Front-end-visible "ring element" value: an engine ring_elem paired with the Ring* that gives it meani...
Definition relem.hpp:67
xxx xxx xxx
Definition ring.hpp:102
const int SPAIR_ZERO
Definition comp-gb.hpp:53
const int SPAIR_PAIR
Definition comp-gb.hpp:56
const int SPAIR_DONE
Definition comp-gb.hpp:50
const int SPAIR_GB
Definition comp-gb.hpp:51
const int SPAIR_SYZ
Definition comp-gb.hpp:52
const int SPAIR_DEFERRED
Definition comp-gb.hpp:59
const int SPAIR_RING
Definition comp-gb.hpp:57
const int SPAIR_GEN
Definition comp-gb.hpp:55
const int SPAIR_REMOVED
Definition comp-gb.hpp:58
const int SPAIR_MINGEN
Definition comp-gb.hpp:54
Abstract Computation base class — stop-condition machinery for incremental engine work.
#define Matrix
Definition factory.cpp:14
char M2_bool
Definition m2-types.h:82