27 _internalTracker(
"internal nodes"),
28 _leafTracker(
"leaf nodes") {
38 fputs(
"**** Slice Algorithm Statistics ****\n",
_out);
91 size_t genCountLog2 = 0;
98 fprintf(out,
"|-%s:\n",
_title.c_str());
100 gmp_fprintf(out,
" | %Zd nodes\n",
getNodeCount().get_mpz_t());
103 fprintf(out,
" | %f variables of ambient ring on avg.\n",
getAvgVarCount());
106 fputs(
" |- nodes by log base 2 of ideal generator count:\n", out);
109 mpz_class nodeCount = 0;
110 map<size_t, mpz_class>::const_iterator it =
113 nodeCount = it->second;
115 gmp_fprintf(out,
" | %Zd nodes has log2(#gens) = %Zd.\n",
116 nodeCount.get_mpz_t(),
117 mpz_class(genCountLog2).get_mpz_t());
119 if (genCountLog2 == 0)
virtual bool getUseSimplification() const =0
double getAvgVarCount() const
void preliminaryRecord(const Slice &slice)
Record information about slice, but store it only until this method is next called on this object...
virtual void setUseSimplification(bool use)
This method should only be called before calling run().
size_t _prelimSubGenCount
size_t getVarCount() const
Returns the number of variables in the ambient ring.
virtual bool getUseSimplification() const
void commitRecord()
Commit the most recent argument to preliminaryTrack permanently to the record.
This class represents a slice, which is the central data structure of the Slice Algorithm.
virtual void run(const Ideal &ideal)=0
Run the Slice algorithm.
virtual void run(const Ideal &ideal)
Run the Slice algorithm.
virtual ~StatisticsStrategy()
StatisticsStrategy(SliceStrategy *strategy, FILE *out)
Statistics are written to out, and every call is delegated to strategy.
size_t _prelimIdealGenCount
Represents a monomial ideal with int exponents.
double getAvgIdealGenCount() const
virtual bool processSlice(TaskEngine &tasks, auto_ptr< Slice > slice)=0
Process the parameter slice.
void printReport(FILE *out) const
Print a report on statistics of the recorded slices to the file out.
const mpz_class & getNodeCount() const
StatTracker _internalTracker
virtual void setUseIndependence(bool use)=0
This method should only be called before calling run().
SliceStrategy * _strategy
virtual void setUseSimplification(bool use)=0
This method should only be called before calling run().
size_t getGeneratorCount() const
TaskEngine handles a list of tasks that are to be carried out.
map< size_t, mpz_class > _nodesByGenCount
_nodesByGenCount[l] records how many slices have been recorded whose ideal has approximately 2^l gene...
virtual void freeSlice(auto_ptr< Slice > slice)=0
It is allowed to delete returned slices directly, but it is better to use freeSlice.
double getAvgSubGenCount() const
const Ideal & getIdeal() const
Returns for a slice .
virtual void freeSlice(auto_ptr< Slice > slice)
It is allowed to delete returned slices directly, but it is better to use freeSlice.
This class describes the interface of a strategy object for the Slice Algorithm.
virtual void setUseIndependence(bool use)
This method should only be called before calling run().
StatTracker(const string &title)
The title parameter indicates what is to be printed when calling printReport().
Ideal & getSubtract()
Returns for a slice .
virtual bool processSlice(TaskEngine &tasks, auto_ptr< Slice > slice)
Process the parameter slice.