Macaulay2 Engine
Loading...
Searching...
No Matches
GBF4Interface.hpp
Go to the documentation of this file.
1#pragma once
2
42
43#include "BasicPolyList.hpp"
44#include "GBF4Computation.hpp"
45#include "PolynomialList.hpp"
46#include "../e/comp-gb.hpp"
47#include "../matrix-stream.hpp"
48
49class Matrix;
50
51auto createGBF4Interface(const Matrix *inputMatrix,
52 const std::vector<int>& variableWeights, // what is this, do we need it?
53 int strategy,
54 int numThreads
55 ) -> GBComputation*;
56
57namespace newf4 {
58
59class GBF4Computation;
60enum class Strategy { Normal };
61
62
63auto createGBF4Interface(const Matrix *inputMatrix,
64 const std::vector<int>& variableWeights, // what is this, do we need it?
65 Strategy strategy, // do we need this?
66 int numThreads
67 ) -> GBComputation*;
69
71{
72private:
73 // Upward facing data fields
75 const FreeModule * mFreeModule; // determines whether the monomial order is a
76 std::unique_ptr<VectorArithmetic> mVectorArithmetic;
77
78 // TODO: Add a MonoidData class and store information about the monoid underlying
79 // the polynomial ring without all the cruft of the usual Monoid
80
81 // F4 computation itself
82 std::unique_ptr<GBF4Computation> mComputation;
83
84public:
85 GBF4Interface(const PolynomialRing* originalRing,
86 const Matrix* inputMatrix,
87 const std::vector<int>& variableWeights,
88 Strategy strategy,
89 int numThreads
90 );
91
92 GBF4Interface(const PolynomialRing* originalRing,
93 const FreeModule* freeModule,
94 const BasicPolyList& basicPolyList,
95 const std::vector<int>& variableWeights,
96 Strategy strategy,
97 int numThreads
98 );
99
100 ~GBF4Interface() override;
101
102 void remove_gb() override { }
103
105
106 bool stop_conditions_ok() override { return true; }
107
108 void start_computation() override { };
109
110 const PolynomialRing *get_ring() const override { return mOriginalRing; }
111
112 Computation /* or null */ *set_hilbert_function(const RingElement *h) override
113 {
114 (void) h;
115 return nullptr;
116 }
117
118 const Matrix /* or null */ *get_gb() override { return nullptr; }
119
120 const Matrix /* or null */ *get_mingens() override { return nullptr; }
121
122 const Matrix /* or null */ *get_change() override { return nullptr; }
123
124 const Matrix /* or null */ *get_syzygies() override { return nullptr; }
125
126 const Matrix /* or null */ *get_initial(int nparts) override {
127 (void) nparts;
128 return nullptr;
129 }
130
131 const Matrix /* or null */ *matrix_remainder(const Matrix *m) override
132 {
133 (void) m;
134 return nullptr;
135 }
136
138 const Matrix /* or null */ **result_remainder,
139 const Matrix /* or null */ **result_quotient) override
140 {
141 (void) m;
142 (void) result_remainder;
143 (void) result_quotient;
144 return false;
145 }
146
147 int contains(const Matrix *m) override
148 {
149 (void) m;
150 return 0;
151 }
152
153 void text_out(buffer &o) const override
154 {
155 (void) o;
156 }
157 /* This displays statistical information, and depends on the
158 M2_gbTrace value */
159
160 int complete_thru_degree() const override { return 0; }
161 // The computation is complete up through this degree.
162
163 void show() const override { } // debug display
164
165 const GBF4Computation& computation() const { return *mComputation; }
166};
167
168// utility function for show functions and returning the result
169inline const Matrix* toMatrix(const FreeModule *target, const PolynomialList& Fs)
170{
171 MatrixStream S(target);
172 toStream(Fs, S);
173 return S.value();
174}
175
176} // end namespace newf4
177
178// Local Variables:
179// indent-tabs-mode: nil
180// End:
std::vector< BasicPoly > BasicPolyList
Ring-agnostic polynomial-list transport type plus its streaming collector and emitter.
newf4::GBF4Computation — top-level driver for the refactored F4 Gröbner-basis engine.
auto createGBF4Interface(const Matrix *inputMatrix, const std::vector< int > &variableWeights, int strategy, int numThreads) -> GBComputation *
Hash-table-keyed polynomial storage for the new F4.
Computation()
Definition comp.cpp:40
Engine-side free module R^n over a Ring.
Definition freemod.hpp:66
base class for Groebner basis computations.
Definition comp-gb.hpp:69
const Matrix * value() const
Streaming consumer that builds an engine Matrix from the mathicgb-style stream callbacks (idealBegin ...
Abstract base for the engine's polynomial-ring hierarchy.
Definition polyring.hpp:96
Front-end-visible "ring element" value: an engine ring_elem paired with the Ring* that gives it meani...
Definition relem.hpp:67
GBF4Interface(const PolynomialRing *originalRing, const Matrix *inputMatrix, const std::vector< int > &variableWeights, Strategy strategy, int numThreads)
Computation * set_hilbert_function(const RingElement *h) override
void show() const override
int complete_thru_degree() const override
M2_bool matrix_lift(const Matrix *m, const Matrix **result_remainder, const Matrix **result_quotient) override
const Matrix * get_mingens() override
void remove_gb() override
const PolynomialRing * get_ring() const override
const Matrix * get_syzygies() override
void text_out(buffer &o) const override
std::unique_ptr< VectorArithmetic > mVectorArithmetic
std::unique_ptr< GBF4Computation > mComputation
enum ComputationStatusCode computation_is_complete()
const Matrix * get_gb() override
const Matrix * get_change() override
const GBF4Computation & computation() const
void start_computation() override
const Matrix * matrix_remainder(const Matrix *m) override
int contains(const Matrix *m) override
const FreeModule * mFreeModule
const Matrix * get_initial(int nparts) override
bool stop_conditions_ok() override
const PolynomialRing * mOriginalRing
ComputationStatusCode
Definition computation.h:53
#define Matrix
Definition factory.cpp:14
char M2_bool
Definition m2-types.h:82
MatrixStream — term-by-term streaming construction of a Matrix.
void toStream(const PolynomialList &Fs, S &str)
const Matrix * toMatrix(const FreeModule *target, const PolynomialList &Fs)
auto createGBF4Interface(const Matrix *inputMatrix, const std::vector< int > &variableWeights, Strategy strategy, int numThreads) -> GBComputation *
void populateComputation(const Matrix *M, GBF4Computation &C)