38 fputs(
"**** Slice Algorithm Statistics ****\n",
_out);
48 bool wasBaseCase =
_strategy->processSlice(tasks, std::move(slice));
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)
Represents a monomial ideal with int exponents.
size_t getGeneratorCount() const
This class describes the interface of a strategy object for the Slice Algorithm.
This class represents a slice, which is the central data structure of the Slice Algorithm.
const Ideal & getIdeal() const
Returns for a slice .
size_t getVarCount() const
Returns the number of variables in the ambient ring.
Ideal & getSubtract()
Returns for a slice .
virtual void setUseSimplification(bool use)
This method should only be called before calling run().
virtual void freeSlice(unique_ptr< Slice > slice)
It is allowed to delete returned slices directly, but it is better to use freeSlice.
virtual void run(const Ideal &ideal)
Run the Slice algorithm.
virtual bool processSlice(TaskEngine &tasks, unique_ptr< Slice > slice)
Process the parameter slice.
StatisticsStrategy(SliceStrategy *strategy, FILE *out)
Statistics are written to out, and every call is delegated to strategy.
virtual bool getUseSimplification() const
StatTracker _internalTracker
virtual void setUseIndependence(bool use)
This method should only be called before calling run().
SliceStrategy * _strategy
virtual ~StatisticsStrategy()
TaskEngine handles a list of tasks that are to be carried out.
This header file includes common definitions and is included as the first line of code in every imple...
void printReport(FILE *out) const
Print a report on statistics of the recorded slices to the file out.
StatTracker(const string &title)
The title parameter indicates what is to be printed when calling printReport().
double getAvgVarCount() const
size_t _prelimSubGenCount
const mpz_class & getNodeCount() const
double getAvgSubGenCount() const
void commitRecord()
Commit the most recent argument to preliminaryTrack permanently to the record.
map< size_t, mpz_class > _nodesByGenCount
_nodesByGenCount[l] records how many slices have been recorded whose ideal has approximately 2^l gene...
double getAvgIdealGenCount() const
size_t _prelimIdealGenCount
void preliminaryRecord(const Slice &slice)
Record information about slice, but store it only until this method is next called on this object.