Macaulay2 Engine
Loading...
Searching...
No Matches
res-f4-computation.hpp
Go to the documentation of this file.
1/* Copyright 2014-2021, Michael E. Stillman */
2
3#ifndef _res_f4_computation_hpp_
4#define _res_f4_computation_hpp_
5
47
48#include "res-poly-ring.hpp"
49#include "polyring.hpp"
50#include "comp-res.hpp"
51
52#include <memory> // For std::unique_ptr
53
54class SchreyerFrame;
55
72{
73 private:
75 ResPolyRing* R,
76 const Matrix* gbmatrix,
77 int max_level,
78 int numThreads,
79 bool parallelizeByDegree);
80
81 public:
82 friend ResolutionComputation* createF4Res(const Matrix* groebnerBasisMatrix,
83 int max_level,
84 int strategy,
85 int numThreads,
86 bool parallelizeByDegree);
87
88 virtual ~F4ResComputation();
89
90 // Compute (if needed) enough to return the minimal Betti numbers
91 // of the free resolution.
92 // 'length_limit': value is infinity if it has length 0, else it is first
93 // entry.
94 // 'slanted_degree_limit': value is infinity if it has length 0, else it is
95 // first entry.
96 // then all returned values will be correct for
97 M2_arrayint minimal_betti(M2_arrayint slanted_degree_limit,
98 M2_arrayint length_limit);
99
100 public:
101 MutableMatrix /* or null */* get_mutable_matrix(const Ring* R, int level);
102 MutableMatrix /* or null */* get_mutable_matrix(const Ring* KK,
103 int slanted_degree,
104 int level);
105
106 protected:
107 // These functions override those in ResolutionComputation
109 {
110 // We ignore all stopping conditions except length_limit, degree_limit
111 return true;
112 }
113
114 SchreyerFrame& frame() { return *mComp; }
115 void start_computation();
116
117 int complete_thru_degree() const;
118 // The computation is complete up through this slanted degree.
119
120 const Matrix /* or null */* get_matrix(int level);
121
122 MutableMatrix /* or null */* get_matrix(int slanted_degree, int level);
123
124 const FreeModule /* or null */* get_free(int level);
125
126 M2_arrayint get_betti(int type) const;
127 // type is documented under rawResolutionBetti, in engine.h
128
129 void text_out(buffer& o) const;
130
131 private:
134 std::unique_ptr<ResPolyRing> mRing;
135 std::unique_ptr<SchreyerFrame> mComp;
136};
137
139 int max_level,
140 int strategy,
141 int numThreads,
142 bool parallelizeByDegree);
143
144#endif
145
146// Local Variables:
147// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
148// indent-tabs-mode: nil
149// End:
M2_arrayint get_betti(int type) const
int complete_thru_degree() const
F4ResComputation(const PolynomialRing *origR, ResPolyRing *R, const Matrix *gbmatrix, int max_level, int numThreads, bool parallelizeByDegree)
const Matrix * get_matrix(int level)
std::unique_ptr< SchreyerFrame > mComp
const FreeModule * get_free(int level)
M2_arrayint minimal_betti(M2_arrayint slanted_degree_limit, M2_arrayint length_limit)
void text_out(buffer &o) const
std::unique_ptr< ResPolyRing > mRing
SchreyerFrame & frame()
friend ResolutionComputation * createF4Res(const Matrix *groebnerBasisMatrix, int max_level, int strategy, int numThreads, bool parallelizeByDegree)
const PolynomialRing & mOriginalRing
MutableMatrix * get_mutable_matrix(const Ring *R, int level)
const Matrix & mInputGroebnerBasis
Engine-side free module R^n over a Ring.
Definition freemod.hpp:66
Abstract base class for mutable matrices over an arbitrary engine Ring, the in-place counterpart of t...
Definition mat.hpp:79
Abstract base for the engine's polynomial-ring hierarchy.
Definition polyring.hpp:96
The polynomial-ring view the F4 resolution engine reduces against: coefficient arithmetic plus the en...
Base class for free resolution computation classes.
Definition comp-res.hpp:52
xxx xxx xxx
Definition ring.hpp:102
State container for the in-progress free resolution built by the F4 resolution engine.
ResolutionComputation — abstract base for every free-resolution algorithm in the engine.
#define Matrix
Definition factory.cpp:14
PolynomialRing — abstract polynomial-ring base, the engine's most-reused class.
ResolutionComputation * createF4Res(const Matrix *m, int max_level, int strategy, int numThreads, bool parallelizeByDegree)
ResPolyRing and ResPolynomial — resolution-tuned polynomial-ring view and value type.