diff options
author | Tim King <taking@google.com> | 2016-01-08 16:44:57 -0800 |
---|---|---|
committer | Tim King <taking@google.com> | 2016-01-08 16:44:57 -0800 |
commit | f4ef7af0a2295691f281ee1604dfeb4082fe229c (patch) | |
tree | 995e512e5669cec6bbc9447d00ec912d5e4c19e3 /src/theory/arith/approx_simplex.cpp | |
parent | def0a07f9676a292a849d7fc8269ffd0901ce156 (diff) |
Removing StatisticsRegistry's static functions current() and registerStat().
- The functionality the get the StatisticsRegistry attached to the SmtEngine was previously through StatisticsRegistry::current(). This is the dominant StatisticsRegistry in the code. (There is another StatisticsRegistry attached to the NodeManager.) Having this be a static function on StatisticsRegistry requires the use of an SmtEngine in the wrong compilation unit.
- Usages of StatisticsRegistry::current() that were visible in prop/{bvminisat,minisat} has been removed. A pointer to the relevant StatisticsRegistry should be passed instead into the constructor.
- The function StatisticsRegistry::current() has been replaced by SmtScope::currentStatisticsRegistry(). SmtScope is in the libcvc4 package, where SmtEngine is available in the compilation unit.
- The function smtStatisticsRegistry() is a synonym for SmtScope::currentStatisticsRegistry() in smt/smt_statistics_registry.h. This header has fewer include dependencies than the one for SmtScope.
- Correspondingly, the static functions StatisticsRegistry::{registerStat, unregisterStat} have been removed. One should instead use smtStatisticsRegistry()->{registerStat,unregisterStat} instead.
- The KEEP_STATISTIC macro has been moved into smt/smt_statistics_registry.h.
- Documents the reason StatisticsRegistry is CVC4_PUBLIC. This lets me remove the warning I added.
- Removing most operators for timespec from statistics_registry.h file. These a bit error prone in clang.
- Most of the really confusing ifdef's in util/statistics_registry.h are gone.
Diffstat (limited to 'src/theory/arith/approx_simplex.cpp')
-rw-r--r-- | src/theory/arith/approx_simplex.cpp | 119 |
1 files changed, 60 insertions, 59 deletions
diff --git a/src/theory/arith/approx_simplex.cpp b/src/theory/arith/approx_simplex.cpp index 71ac18e84..5bbe29bc5 100644 --- a/src/theory/arith/approx_simplex.cpp +++ b/src/theory/arith/approx_simplex.cpp @@ -14,6 +14,7 @@ ** [[ Add lengthier description here ]] ** \todo document this file **/ +#include "theory/arith/approx_simplex.h" #include <cfloat> #include <cmath> @@ -22,7 +23,7 @@ #include "base/output.h" #include "cvc4autoconfig.h" -#include "theory/arith/approx_simplex.h" +#include "smt/smt_statistics_registry.h" #include "theory/arith/constraint.h" #include "theory/arith/cut_log.h" #include "theory/arith/matrix.h" @@ -169,67 +170,67 @@ ApproximateStatistics::ApproximateStatistics() , d_gaussianElimConstruct("z::approx::gaussianElimConstruct::calls",0) , d_averageGuesses("z::approx::averageGuesses") { - // StatisticsRegistry::registerStat(&d_relaxCalls); - // StatisticsRegistry::registerStat(&d_relaxUnknowns); - // StatisticsRegistry::registerStat(&d_relaxFeasible); - // StatisticsRegistry::registerStat(&d_relaxInfeasible); - // StatisticsRegistry::registerStat(&d_relaxPivotsExhausted); - - // StatisticsRegistry::registerStat(&d_mipCalls); - // StatisticsRegistry::registerStat(&d_mipUnknowns); - // StatisticsRegistry::registerStat(&d_mipBingo); - // StatisticsRegistry::registerStat(&d_mipClosed); - // StatisticsRegistry::registerStat(&d_mipBranchesExhausted); - // StatisticsRegistry::registerStat(&d_mipPivotsExhausted); - // StatisticsRegistry::registerStat(&d_mipExecExhausted); - - - // StatisticsRegistry::registerStat(&d_gmiGen); - // StatisticsRegistry::registerStat(&d_gmiReplay); - // StatisticsRegistry::registerStat(&d_mipGen); - // StatisticsRegistry::registerStat(&d_mipReplay); - - StatisticsRegistry::registerStat(&d_branchMaxDepth); - //StatisticsRegistry::registerStat(&d_branchTotal); - //StatisticsRegistry::registerStat(&d_branchCuts); - StatisticsRegistry::registerStat(&d_branchesMaxOnAVar); - - StatisticsRegistry::registerStat(&d_gaussianElimConstructTime); - StatisticsRegistry::registerStat(&d_gaussianElimConstruct); - - StatisticsRegistry::registerStat(&d_averageGuesses); + // smtStatisticsRegistry()->registerStat(&d_relaxCalls); + // smtStatisticsRegistry()->registerStat(&d_relaxUnknowns); + // smtStatisticsRegistry()->registerStat(&d_relaxFeasible); + // smtStatisticsRegistry()->registerStat(&d_relaxInfeasible); + // smtStatisticsRegistry()->registerStat(&d_relaxPivotsExhausted); + + // smtStatisticsRegistry()->registerStat(&d_mipCalls); + // smtStatisticsRegistry()->registerStat(&d_mipUnknowns); + // smtStatisticsRegistry()->registerStat(&d_mipBingo); + // smtStatisticsRegistry()->registerStat(&d_mipClosed); + // smtStatisticsRegistry()->registerStat(&d_mipBranchesExhausted); + // smtStatisticsRegistry()->registerStat(&d_mipPivotsExhausted); + // smtStatisticsRegistry()->registerStat(&d_mipExecExhausted); + + + // smtStatisticsRegistry()->registerStat(&d_gmiGen); + // smtStatisticsRegistry()->registerStat(&d_gmiReplay); + // smtStatisticsRegistry()->registerStat(&d_mipGen); + // smtStatisticsRegistry()->registerStat(&d_mipReplay); + + smtStatisticsRegistry()->registerStat(&d_branchMaxDepth); + //smtStatisticsRegistry()->registerStat(&d_branchTotal); + //smtStatisticsRegistry()->registerStat(&d_branchCuts); + smtStatisticsRegistry()->registerStat(&d_branchesMaxOnAVar); + + smtStatisticsRegistry()->registerStat(&d_gaussianElimConstructTime); + smtStatisticsRegistry()->registerStat(&d_gaussianElimConstruct); + + smtStatisticsRegistry()->registerStat(&d_averageGuesses); } ApproximateStatistics::~ApproximateStatistics(){ - // StatisticsRegistry::unregisterStat(&d_relaxCalls); - // StatisticsRegistry::unregisterStat(&d_relaxUnknowns); - // StatisticsRegistry::unregisterStat(&d_relaxFeasible); - // StatisticsRegistry::unregisterStat(&d_relaxInfeasible); - // StatisticsRegistry::unregisterStat(&d_relaxPivotsExhausted); - - // StatisticsRegistry::unregisterStat(&d_mipCalls); - // StatisticsRegistry::unregisterStat(&d_mipUnknowns); - // StatisticsRegistry::unregisterStat(&d_mipBingo); - // StatisticsRegistry::unregisterStat(&d_mipClosed); - // StatisticsRegistry::unregisterStat(&d_mipBranchesExhausted); - // StatisticsRegistry::unregisterStat(&d_mipPivotsExhausted); - // StatisticsRegistry::unregisterStat(&d_mipExecExhausted); - - - // StatisticsRegistry::unregisterStat(&d_gmiGen); - // StatisticsRegistry::unregisterStat(&d_gmiReplay); - // StatisticsRegistry::unregisterStat(&d_mipGen); - // StatisticsRegistry::unregisterStat(&d_mipReplay); - - StatisticsRegistry::unregisterStat(&d_branchMaxDepth); - //StatisticsRegistry::unregisterStat(&d_branchTotal); - //StatisticsRegistry::unregisterStat(&d_branchCuts); - StatisticsRegistry::unregisterStat(&d_branchesMaxOnAVar); - - StatisticsRegistry::unregisterStat(&d_gaussianElimConstructTime); - StatisticsRegistry::unregisterStat(&d_gaussianElimConstruct); - - StatisticsRegistry::unregisterStat(&d_averageGuesses); + // smtStatisticsRegistry()->unregisterStat(&d_relaxCalls); + // smtStatisticsRegistry()->unregisterStat(&d_relaxUnknowns); + // smtStatisticsRegistry()->unregisterStat(&d_relaxFeasible); + // smtStatisticsRegistry()->unregisterStat(&d_relaxInfeasible); + // smtStatisticsRegistry()->unregisterStat(&d_relaxPivotsExhausted); + + // smtStatisticsRegistry()->unregisterStat(&d_mipCalls); + // smtStatisticsRegistry()->unregisterStat(&d_mipUnknowns); + // smtStatisticsRegistry()->unregisterStat(&d_mipBingo); + // smtStatisticsRegistry()->unregisterStat(&d_mipClosed); + // smtStatisticsRegistry()->unregisterStat(&d_mipBranchesExhausted); + // smtStatisticsRegistry()->unregisterStat(&d_mipPivotsExhausted); + // smtStatisticsRegistry()->unregisterStat(&d_mipExecExhausted); + + + // smtStatisticsRegistry()->unregisterStat(&d_gmiGen); + // smtStatisticsRegistry()->unregisterStat(&d_gmiReplay); + // smtStatisticsRegistry()->unregisterStat(&d_mipGen); + // smtStatisticsRegistry()->unregisterStat(&d_mipReplay); + + smtStatisticsRegistry()->unregisterStat(&d_branchMaxDepth); + //smtStatisticsRegistry()->unregisterStat(&d_branchTotal); + //smtStatisticsRegistry()->unregisterStat(&d_branchCuts); + smtStatisticsRegistry()->unregisterStat(&d_branchesMaxOnAVar); + + smtStatisticsRegistry()->unregisterStat(&d_gaussianElimConstructTime); + smtStatisticsRegistry()->unregisterStat(&d_gaussianElimConstruct); + + smtStatisticsRegistry()->unregisterStat(&d_averageGuesses); } Integer ApproximateSimplex::s_defaultMaxDenom(1<<26); |