Macaulay2 Engine
Loading...
Searching...
No Matches
comp-res.hpp
Go to the documentation of this file.
1// Copyright 2004 Michael E. Stillman.
2
3#ifndef _comp_res_hpp_
4#define _comp_res_hpp_
5
40
41#include "comp.hpp"
42class buffer;
43
49
51// This is the base type for all resolution computations
52{
53 protected:
55
56 virtual bool stop_conditions_ok() = 0;
57 // If the stop conditions in stop_ are inappropriate,
58 // return false, and use ERROR(...) to provide an error message.
59
60 public:
61 // These three routines should be moved to a utility class
62 static void betti_init(int lo, int hi, int len, int *&bettis);
63 static M2_arrayint betti_make(int lo, int hi, int len, int *bettis);
64 static void betti_display(buffer &o, M2_arrayint a);
65
66 public:
68 {
69 return this;
70 }
71
72 virtual ~ResolutionComputation();
73
75 M2_bool resolve_cokernel,
76 int max_level,
77 M2_bool use_max_slanted_degree,
78 int max_slanted_degree,
79 int algorithm,
80 int strategy,
81 int numThreads,
82 M2_bool parallelizeByDegree);
83 // Values for algorithm and strategy are documented in engine.h
84
85 virtual void start_computation() = 0;
86
87 // virtual ComputationStatusCode compute(const StopConditions &stop_, long
88 // &complete_thru_this_degree);
89 virtual int complete_thru_degree() const = 0;
90 // The computation is complete up through this slanted degree.
91
93 // Results of the computation //
95 virtual const Matrix /* or null */ *get_matrix(int level) = 0;
96
97 virtual MutableMatrix /* or null */ *get_matrix(int level, int degree);
98 // the default version gives an error that it isn't defined
99
100 virtual const FreeModule /* or null */ *get_free(int level) = 0;
101
102 virtual M2_arrayint get_betti(int type) const = 0;
103 // type is documented under rawResolutionBetti, in engine.h
104
106 // Statistics and spair information //
108
109 virtual void text_out(buffer &o) const = 0;
110 // This displays statistical information, and depends on the
111 // M2_gbTrace value.
112};
113
115
116#endif
117
118// Local Variables:
119// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
120// indent-tabs-mode: nil
121// End:
Computation()
Definition comp.cpp:40
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
static void betti_display(buffer &o, M2_arrayint a)
Definition comp-res.cpp:207
static void betti_init(int lo, int hi, int len, int *&bettis)
Definition comp-res.cpp:151
virtual const Matrix * get_matrix(int level)=0
virtual void text_out(buffer &o) const =0
virtual M2_arrayint get_betti(int type) const =0
static ResolutionComputation * choose_res(const Matrix *m, M2_bool resolve_cokernel, int max_level, M2_bool use_max_slanted_degree, int max_slanted_degree, int algorithm, int strategy, int numThreads, M2_bool parallelizeByDegree)
Definition comp-res.cpp:16
virtual void start_computation()=0
virtual bool stop_conditions_ok()=0
virtual const FreeModule * get_free(int level)=0
static M2_arrayint betti_make(int lo, int hi, int len, int *bettis)
Definition comp-res.cpp:157
virtual int complete_thru_degree() const =0
virtual ResolutionComputation * cast_to_ResolutionComputation()
Definition comp-res.hpp:67
virtual ~ResolutionComputation()
Definition comp-res.cpp:15
Base class for free resolution computation classes.
Definition comp-res.hpp:52
void intern_res(ResolutionComputation *G)
Definition finalize.cpp:144
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
tbb::flow::graph G