Macaulay2 Engine
Loading...
Searching...
No Matches
comp-gb-proxy.hpp
Go to the documentation of this file.
1// Copyright 2004 Michael E. Stillman.
2
3#ifndef _comp_gb_proxy_hpp_
4#define _comp_gb_proxy_hpp_
5
34
35#include "comp-gb.hpp"
36
43class GBProxy : public GBComputation
44// This contains a GBComputation, which can be changed.
45// For example, we can start with a computation, and then
46// after it is done, we can jettison it, and consider only
47// the GB object itself.
48{
50
51 protected:
52 virtual bool stop_conditions_ok()
53 {
54 G->stop_ = stop_;
55 return G->stop_conditions_ok();
56 }
57 // If the stop conditions in _Stop are inappropriate,
58 // return false, and use ERROR(...) to provide an error message.
59
60 public:
61 GBProxy(GBComputation *G0) : G(G0) {}
62 virtual ~GBProxy();
63
64 virtual void remove_gb() {}
66 {
68 set_status(G->status());
69 G = G0;
70 return result;
71 }
72
73 virtual GBComputation *cast_to_GBComputation() { return this; }
74 virtual const Ring *get_ring() const { return G->get_ring(); }
75 virtual Computation /* or null */ *set_hilbert_function(const RingElement *h)
76 {
77 return G->set_hilbert_function(h);
78 }
79 // The default version returns an error saying that Hilbert functions cannot
80 // be used.
81
82 virtual void start_computation()
83 {
84 G->start_computation();
85 set_status(G->status());
86 }
87
88 virtual int complete_thru_degree() const { return G->complete_thru_degree(); }
89 // The computation is complete up through this degree.
90
91 // Recall that the status of the computation is maintained by the Computation
92 // class,
93
95 // Results of the computation //
97 virtual const Matrix /* or null */ *get_gb() { return G->get_gb(); }
98 virtual const Matrix /* or null */ *get_mingens() { return G->get_mingens(); }
99 virtual const Matrix /* or null */ *get_change() { return G->get_change(); }
100 virtual const Matrix /* or null */ *get_syzygies()
101 {
102 return G->get_syzygies();
103 }
104
105 virtual const Matrix /* or null */ *get_initial(int nparts)
106 {
107 return G->get_initial(nparts);
108 }
109
110 virtual const Matrix /* or null */ *get_parallel_lead_terms(M2_arrayint w)
111 {
112 return G->get_parallel_lead_terms(w);
113 }
114
116 // Normal forms and lifting ////
118
119 virtual const Matrix /* or null */ *matrix_remainder(const Matrix *m)
120 {
121 return G->matrix_remainder(m);
122 }
123
124 virtual M2_bool matrix_lift(const Matrix *m,
125 const Matrix /* or null */ **result_remainder,
126 const Matrix /* or null */ **result_quotient)
127 {
128 return G->matrix_lift(m, result_remainder, result_quotient);
129 }
130
131 virtual int contains(const Matrix *m) { return G->contains(m); }
133 // Statistics and spair information //
135
136 virtual void text_out(buffer &o) const { G->text_out(o); }
137 // This displays statistical information, and depends on the
138 // M2_gbTrace value.
139
140 virtual void show() const { G->show(); }
141};
142
143#endif
144
145// Local Variables:
146// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
147// indent-tabs-mode: nil
148// End:
enum ComputationStatusCode set_status(enum ComputationStatusCode)
Definition comp.cpp:66
StopConditions stop_
Definition comp.hpp:75
Computation()
Definition comp.cpp:40
virtual GBComputation * cast_to_GBComputation()
virtual M2_bool matrix_lift(const Matrix *m, const Matrix **result_remainder, const Matrix **result_quotient)
virtual const Ring * get_ring() const
virtual const Matrix * get_change()
virtual bool stop_conditions_ok()
virtual void show() const
virtual const Matrix * get_mingens()
virtual void start_computation()
virtual const Matrix * get_gb()
GBComputation * G
virtual int complete_thru_degree() const
virtual void remove_gb()
virtual ~GBProxy()
virtual void text_out(buffer &o) const
virtual int contains(const Matrix *m)
GBProxy(GBComputation *G0)
virtual const Matrix * get_initial(int nparts)
virtual const Matrix * matrix_remainder(const Matrix *m)
virtual const Matrix * get_syzygies()
virtual const Matrix * get_parallel_lead_terms(M2_arrayint w)
virtual Computation * set_hilbert_function(const RingElement *h)
GBComputation * replace_GB(GBComputation *G0)
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
GBComputation — abstract base of every Groebner-basis algorithm in the engine.
#define Matrix
Definition factory.cpp:14
VALGRIND_MAKE_MEM_DEFINED & result(result)
char M2_bool
Definition m2-types.h:82