[mathicgb] 328/393: Changes to make this compile in MSVC.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Fri Apr 3 15:59:30 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch upstream
in repository mathicgb.
commit c29d43d4044da78cad8618464619671027c27275
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date: Fri Aug 16 16:03:00 2013 +0200
Changes to make this compile in MSVC.
---
build/vs12/mathicgb-lib/mathicgb-lib.vcxproj | 24 +++--
.../vs12/mathicgb-lib/mathicgb-lib.vcxproj.filters | 72 +++++++++-----
build/vs12/mathicgb-test/mathicgb-test.vcxproj | 1 -
.../mathicgb-test/mathicgb-test.vcxproj.filters | 3 -
src/mathicgb.cpp | 14 +--
src/mathicgb.h | 16 +--
src/mathicgb/Atomic.hpp | 3 +-
src/mathicgb/F4Reducer.cpp | 2 +-
src/mathicgb/F4Reducer.hpp | 2 +-
src/mathicgb/MonoMonoid.hpp | 4 +-
src/mathicgb/MonoProcessor.hpp | 7 +-
src/mathicgb/RawVector.hpp | 9 +-
src/mathicgb/Reducer.hpp | 2 +-
src/mathicgb/Scanner.cpp | 2 +-
src/mathicgb/Scanner.hpp | 5 +-
src/mathicgb/SignatureGB.cpp | 6 +-
src/mathicgb/SignatureGB.hpp | 1 +
src/mathicgb/TypicalReducer.cpp | 2 +-
src/mathicgb/TypicalReducer.hpp | 2 +-
src/mathicgb/Unchar.hpp | 2 +-
src/mathicgb/mtbb.hpp | 1 +
src/mathicgb/stdinc.h | 110 ++++++++++-----------
src/test/MonoMonoid.cpp | 8 +-
src/test/mathicgb.cpp | 22 +++--
24 files changed, 182 insertions(+), 138 deletions(-)
diff --git a/build/vs12/mathicgb-lib/mathicgb-lib.vcxproj b/build/vs12/mathicgb-lib/mathicgb-lib.vcxproj
index 914ace1..b3c2206 100755
--- a/build/vs12/mathicgb-lib/mathicgb-lib.vcxproj
+++ b/build/vs12/mathicgb-lib/mathicgb-lib.vcxproj
@@ -440,11 +440,12 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\mathicgb.cpp" />
+ <ClCompile Include="..\..\..\src\mathicgb\Basis.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\BjarkeGeobucket.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\BjarkeGeobucket2.cpp" />
- <ClCompile Include="..\..\..\src\mathicgb\BuchbergerAlg.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\CFile.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\ChainedHashTable.cpp" />
+ <ClCompile Include="..\..\..\src\mathicgb\ClassicGBAlg.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\DivisorLookup.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\F4MatrixBuilder.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\F4MatrixBuilder2.cpp" />
@@ -452,14 +453,11 @@
<ClCompile Include="..\..\..\src\mathicgb\F4MatrixReducer.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\F4ProtoMatrix.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\F4Reducer.cpp" />
- <ClCompile Include="..\..\..\src\mathicgb\FreeModuleOrder.cpp" />
- <ClCompile Include="..\..\..\src\mathicgb\GroebnerBasis.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\HashTourReducer.cpp" />
- <ClCompile Include="..\..\..\src\mathicgb\Ideal.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\io-util.cpp" />
- <ClCompile Include="..\..\..\src\mathicgb\KoszulQueue.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\LogDomain.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\LogDomainSet.cpp" />
+ <ClCompile Include="..\..\..\src\mathicgb\MathicIO.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\MonTableNaive.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\MTArray.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\PairTriangle.cpp" />
@@ -474,7 +472,9 @@
<ClCompile Include="..\..\..\src\mathicgb\QuadMatrix.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\QuadMatrixBuilder.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\Reducer.cpp" />
+ <ClCompile Include="..\..\..\src\mathicgb\Scanner.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\SignatureGB.cpp" />
+ <ClCompile Include="..\..\..\src\mathicgb\SigPolyBasis.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\SigSPairQueue.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\SigSPairs.cpp" />
<ClCompile Include="..\..\..\src\mathicgb\SPairs.cpp" />
@@ -485,11 +485,12 @@
<ItemGroup>
<ClInclude Include="..\..\..\src\mathicgb.h" />
<ClInclude Include="..\..\..\src\mathicgb\Atomic.hpp" />
+ <ClInclude Include="..\..\..\src\mathicgb\Basis.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\BjarkeGeobucket.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\BjarkeGeobucket2.hpp" />
- <ClInclude Include="..\..\..\src\mathicgb\BuchbergerAlg.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\CFile.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\ChainedHashTable.hpp" />
+ <ClInclude Include="..\..\..\src\mathicgb\ClassicGBAlg.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\DivisorLookup.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\DivLookup.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\F4MatrixBuilder.hpp" />
@@ -499,21 +500,23 @@
<ClInclude Include="..\..\..\src\mathicgb\F4ProtoMatrix.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\F4Reducer.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\FixedSizeMonomialMap.h" />
- <ClInclude Include="..\..\..\src\mathicgb\FreeModuleOrder.hpp" />
- <ClInclude Include="..\..\..\src\mathicgb\GroebnerBasis.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\HashTourReducer.hpp" />
- <ClInclude Include="..\..\..\src\mathicgb\Ideal.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\io-util.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\KoszulQueue.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\LogDomain.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\LogDomainSet.hpp" />
+ <ClInclude Include="..\..\..\src\mathicgb\MathicIO.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\MonomialHashTable.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\MonomialMap.hpp" />
+ <ClInclude Include="..\..\..\src\mathicgb\MonoMonoid.hpp" />
+ <ClInclude Include="..\..\..\src\mathicgb\MonoOrder.hpp" />
+ <ClInclude Include="..\..\..\src\mathicgb\MonoProcessor.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\MonTableDivList.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\MonTableKDTree.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\MonTableNaive.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\MTArray.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\mtbb.hpp" />
+ <ClInclude Include="..\..\..\src\mathicgb\NonCopyable.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\PairTriangle.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\Poly.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\PolyBasis.hpp" />
@@ -535,8 +538,10 @@
<ClInclude Include="..\..\..\src\mathicgb\ReducerNoDedup.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\ReducerPack.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\ReducerPackDedup.hpp" />
+ <ClInclude Include="..\..\..\src\mathicgb\Scanner.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\ScopeExit.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\SignatureGB.hpp" />
+ <ClInclude Include="..\..\..\src\mathicgb\SigPolyBasis.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\SigSPairQueue.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\SigSPairs.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\SPairs.hpp" />
@@ -544,6 +549,7 @@
<ClInclude Include="..\..\..\src\mathicgb\stdinc.h" />
<ClInclude Include="..\..\..\src\mathicgb\TournamentReducer.hpp" />
<ClInclude Include="..\..\..\src\mathicgb\TypicalReducer.hpp" />
+ <ClInclude Include="..\..\..\src\mathicgb\Unchar.hpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/build/vs12/mathicgb-lib/mathicgb-lib.vcxproj.filters b/build/vs12/mathicgb-lib/mathicgb-lib.vcxproj.filters
index 9542d84..8b95d32 100755
--- a/build/vs12/mathicgb-lib/mathicgb-lib.vcxproj.filters
+++ b/build/vs12/mathicgb-lib/mathicgb-lib.vcxproj.filters
@@ -21,9 +21,6 @@
<ClCompile Include="..\..\..\src\mathicgb\BjarkeGeobucket2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\..\..\src\mathicgb\BuchbergerAlg.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\..\..\src\mathicgb\ChainedHashTable.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -39,24 +36,12 @@
<ClCompile Include="..\..\..\src\mathicgb\F4Reducer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\..\..\src\mathicgb\FreeModuleOrder.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="..\..\..\src\mathicgb\GroebnerBasis.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\..\..\src\mathicgb\HashTourReducer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\..\..\src\mathicgb\Ideal.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\..\..\src\mathicgb\io-util.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\..\..\src\mathicgb\KoszulQueue.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\..\..\src\mathicgb\MonTableNaive.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@@ -141,6 +126,21 @@
<ClCompile Include="..\..\..\src\mathicgb.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\..\src\mathicgb\Basis.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\src\mathicgb\ClassicGBAlg.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\src\mathicgb\MathicIO.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\src\mathicgb\Scanner.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\src\mathicgb\SigPolyBasis.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\src\mathicgb\BjarkeGeobucket.hpp">
@@ -149,9 +149,6 @@
<ClInclude Include="..\..\..\src\mathicgb\BjarkeGeobucket2.hpp">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\..\..\src\mathicgb\BuchbergerAlg.hpp">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="..\..\..\src\mathicgb\ChainedHashTable.hpp">
<Filter>Header Files</Filter>
</ClInclude>
@@ -170,18 +167,9 @@
<ClInclude Include="..\..\..\src\mathicgb\F4Reducer.hpp">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\..\..\src\mathicgb\FreeModuleOrder.hpp">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClInclude Include="..\..\..\src\mathicgb\GroebnerBasis.hpp">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="..\..\..\src\mathicgb\HashTourReducer.hpp">
<Filter>Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\..\..\src\mathicgb\Ideal.hpp">
- <Filter>Header Files</Filter>
- </ClInclude>
<ClInclude Include="..\..\..\src\mathicgb\io-util.hpp">
<Filter>Header Files</Filter>
</ClInclude>
@@ -326,5 +314,35 @@
<ClInclude Include="..\..\..\src\mathicgb\PrimeField.hpp">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\..\src\mathicgb\Basis.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\mathicgb\ClassicGBAlg.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\mathicgb\MathicIO.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\mathicgb\MonoMonoid.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\mathicgb\MonoOrder.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\mathicgb\MonoProcessor.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\mathicgb\NonCopyable.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\mathicgb\Scanner.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\mathicgb\SigPolyBasis.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\..\src\mathicgb\Unchar.hpp">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
diff --git a/build/vs12/mathicgb-test/mathicgb-test.vcxproj b/build/vs12/mathicgb-test/mathicgb-test.vcxproj
index 16043a2..5b5d3d7 100755
--- a/build/vs12/mathicgb-test/mathicgb-test.vcxproj
+++ b/build/vs12/mathicgb-test/mathicgb-test.vcxproj
@@ -398,7 +398,6 @@
<ItemGroup>
<ClCompile Include="..\..\..\src\test\F4MatrixBuilder.cpp" />
<ClCompile Include="..\..\..\src\test\F4MatrixReducer.cpp" />
- <ClCompile Include="..\..\..\src\test\FreeModuleOrderTest.cpp" />
<ClCompile Include="..\..\..\src\test\gb-test.cpp" />
<ClCompile Include="..\..\..\src\test\gtestInclude.cpp" />
<ClCompile Include="..\..\..\src\test\ideals.cpp" />
diff --git a/build/vs12/mathicgb-test/mathicgb-test.vcxproj.filters b/build/vs12/mathicgb-test/mathicgb-test.vcxproj.filters
index c4938ce..82437c0 100755
--- a/build/vs12/mathicgb-test/mathicgb-test.vcxproj.filters
+++ b/build/vs12/mathicgb-test/mathicgb-test.vcxproj.filters
@@ -21,9 +21,6 @@
<ClCompile Include="..\..\..\src\test\F4MatrixReducer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\..\..\src\test\FreeModuleOrderTest.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\..\..\src\test\gb-test.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/src/mathicgb.cpp b/src/mathicgb.cpp
index 765d059..ef51684 100755
--- a/src/mathicgb.cpp
+++ b/src/mathicgb.cpp
@@ -392,8 +392,8 @@ namespace mgb {
bool mComponentsAscending;
bool mSchreyering;
Reducer mReducer;
- size_t mMaxSPairGroupSize;
- size_t mMaxThreadCount;
+ unsigned int mMaxSPairGroupSize;
+ unsigned int mMaxThreadCount;
std::string mLogging;
void* mCallbackData;
Callback::Action (*mCallback) (void*);
@@ -532,19 +532,19 @@ namespace mgb {
return mPimpl->mReducer;
}
- void GroebnerConfiguration::setMaxSPairGroupSize(size_t size) {
+ void GroebnerConfiguration::setMaxSPairGroupSize(unsigned int size) {
mPimpl->mMaxSPairGroupSize = size;
}
- size_t GroebnerConfiguration::maxSPairGroupSize() const {
+ uint32 GroebnerConfiguration::maxSPairGroupSize() const {
return mPimpl->mMaxSPairGroupSize;
}
- void GroebnerConfiguration::setMaxThreadCount(size_t maxThreadCount) {
+ void GroebnerConfiguration::setMaxThreadCount(unsigned int maxThreadCount) {
mPimpl->mMaxThreadCount = maxThreadCount;
}
- size_t GroebnerConfiguration::maxThreadCount() const {
+ unsigned int GroebnerConfiguration::maxThreadCount() const {
return mPimpl->mMaxThreadCount;
}
@@ -831,7 +831,7 @@ namespace mgbi {
MATHICGB_ASSERT(PimplOf()(conf).debugAssertValid());
// Tell tbb how many threads to use
- const auto maxThreadCount = conf.maxThreadCount();
+ const auto maxThreadCount = int(conf.maxThreadCount());
const auto tbbMaxThreadCount = maxThreadCount == 0 ?
mgb::tbb::task_scheduler_init::automatic : maxThreadCount;
mgb::tbb::task_scheduler_init scheduler(tbbMaxThreadCount);
diff --git a/src/mathicgb.h b/src/mathicgb.h
index be693b9..70ddf1e 100755
--- a/src/mathicgb.h
+++ b/src/mathicgb.h
@@ -190,14 +190,14 @@ namespace mgb { // Part of the public interface of MathicGB
/// For matrix-based reducers, use a high value. For serial classic
/// reduction, use a low value, preferably 1. Setting the value to
/// 0 already takes care of this.
- void setMaxSPairGroupSize(size_t size);
- size_t maxSPairGroupSize() const;
+ void setMaxSPairGroupSize(unsigned int size);
+ unsigned int maxSPairGroupSize() const;
/// Sets the maximum number of threads to use. May use fewer threads.
/// A value of 0 indicates to let the library decide this value for
/// itself, which is also the default value.
- void setMaxThreadCount(size_t maxThreadCount);
- size_t maxThreadCount() const;
+ void setMaxThreadCount(unsigned int maxThreadCount);
+ unsigned int maxThreadCount() const;
/// Sets logging to occur according to the string. The format of the
/// string is the same as for the -logs command line parameter.
@@ -500,10 +500,10 @@ namespace mgb {
// This method is made inline to avoid the overhead from calling a function
// for every exponent. This is also why mExponents is not inside the pimpl -
- // otherwise we couldn't access it fro here. That then explains why mExponents
- // is a raw pointer instead of a std::vector - the compiler for the caller
- // and the library must agree on the memory layout of the object and that is
- // less likely to introduce problems for a raw pointer than for a
+ // otherwise we couldn't access it from here. That then explains why
+ // mExponents is a raw pointer instead of a std::vector - the compiler for the
+ // caller and the library must agree on the memory layout of the object and
+ // that is less likely to introduce problems for a raw pointer than for a
// std::vector. In particular, doing it this way allows the library and
// the caller to use different implementations of the STL.
inline void GroebnerInputIdealStream::appendExponent(
diff --git a/src/mathicgb/Atomic.hpp b/src/mathicgb/Atomic.hpp
index aa5ef5f..779e6f9 100755
--- a/src/mathicgb/Atomic.hpp
+++ b/src/mathicgb/Atomic.hpp
@@ -315,6 +315,7 @@ namespace AtomicInternal {
case ::std::memory_order_seq_cst:
// All operations happen in a globally consistent total order.
seqCstStore(value, mValue);
+
break;
case ::std::memory_order_consume: // not available for store
@@ -365,7 +366,7 @@ public:
Atomic(T value): mValue(value) {}
MATHICGB_INLINE
- T load(const ::std::memory_order order = ::std::memory_order_seq_cst) const {
+ T load(const std::memory_order order = std::memory_order_seq_cst) const {
MATHICGB_ASSERT(debugAligned());
return mValue.load(order);
}
diff --git a/src/mathicgb/F4Reducer.cpp b/src/mathicgb/F4Reducer.cpp
index ae5c3ca..53df836 100755
--- a/src/mathicgb/F4Reducer.cpp
+++ b/src/mathicgb/F4Reducer.cpp
@@ -55,7 +55,7 @@ F4Reducer::F4Reducer(const PolyRing& ring, Type type):
mMatrixSaveCount(0) {
}
-size_t F4Reducer::preferredSetSize() const {
+unsigned int F4Reducer::preferredSetSize() const {
return 100000;
}
diff --git a/src/mathicgb/F4Reducer.hpp b/src/mathicgb/F4Reducer.hpp
index 47d7a3d..47bb4df 100755
--- a/src/mathicgb/F4Reducer.hpp
+++ b/src/mathicgb/F4Reducer.hpp
@@ -20,7 +20,7 @@ public:
F4Reducer(const PolyRing& ring, Type type);
- virtual size_t preferredSetSize() const;
+ virtual unsigned int preferredSetSize() const;
/// Store all future matrices to file-1.mat, file-2.mat and so on.
/// Matrices with less than minEntries non-zero entries are not stored.
diff --git a/src/mathicgb/MonoMonoid.hpp b/src/mathicgb/MonoMonoid.hpp
index a94ed25..151604e 100755
--- a/src/mathicgb/MonoMonoid.hpp
+++ b/src/mathicgb/MonoMonoid.hpp
@@ -14,6 +14,7 @@
#include <ostream>
#include <cstdlib>
#include <cstring>
+#include <cctype>
#include <mathic.h>
MATHICGB_NAMESPACE_BEGIN
@@ -1630,7 +1631,8 @@ private:
void updateOrderComponent(const VarIndex newComponent, MonoRef mono) const {
if (componentGradingIndex() != Order::ComponentAfterBaseOrder)
- ptr(mono, orderIndexBegin())[componentGradingIndex()] = newComponent;
+ ptr(mono, orderIndexBegin())[componentGradingIndex()] =
+ static_cast<Exponent>(newComponent);
}
Exponent computeDegree(ConstMonoRef mono, VarIndex grading) const {
diff --git a/src/mathicgb/MonoProcessor.hpp b/src/mathicgb/MonoProcessor.hpp
index d160fe8..adb5f76 100755
--- a/src/mathicgb/MonoProcessor.hpp
+++ b/src/mathicgb/MonoProcessor.hpp
@@ -25,6 +25,7 @@ public:
typedef typename Monoid::MonoRef MonoRef;
typedef typename Monoid::ConstMonoRef ConstMonoRef;
typedef typename Monoid::ConstMonoPtr ConstMonoPtr;
+ typedef typename Monoid::Component Component;
MonoProcessor(
const Monoid& monoid,
@@ -104,8 +105,8 @@ public:
return !mSchreyerMultipliers.empty();
}
- void setComponentCount(VarIndex count) {mComponentCount = count;}
- VarIndex componentCount() const {return mComponentCount;}
+ void setComponentCount(Component count) {mComponentCount = count;}
+ Component componentCount() const {return mComponentCount;}
const Monoid& monoid() const {return mSchreyerMultipliersMemory.monoid();}
private:
@@ -126,7 +127,7 @@ private:
}
bool mComponentsAscendingDesired;
- VarIndex mComponentCount;
+ Component mComponentCount;
bool mSchreyering;
MonoVector mSchreyerMultipliersMemory;
std::vector<ConstMonoPtr> mSchreyerMultipliers;
diff --git a/src/mathicgb/RawVector.hpp b/src/mathicgb/RawVector.hpp
index 88a3447..f54a949 100755
--- a/src/mathicgb/RawVector.hpp
+++ b/src/mathicgb/RawVector.hpp
@@ -36,8 +36,8 @@ public:
typedef T value_type;
typedef T* pointer;
typedef const T* const_pointer;
- typedef std::reverse_iterator<iterator> reverse_iterator;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef ::std::reverse_iterator<iterator> reverse_iterator;
+ typedef ::std::reverse_iterator<const_iterator> const_reverse_iterator;
/// Initializes to the null state.
RawVector(): mBegin(0), mEnd(0), mCapacityEnd(0) {}
@@ -301,12 +301,13 @@ private:
T* mCapacityEnd;
};
+MATHICGB_NAMESPACE_END
+
namespace std {
template<class T>
- void swap(RawVector<T>& a, RawVector<T>& b) {
+ void swap(mgb::RawVector<T>& a, mgb::RawVector<T>& b) {
a.swap(b);
}
}
-MATHICGB_NAMESPACE_END
#endif
diff --git a/src/mathicgb/Reducer.hpp b/src/mathicgb/Reducer.hpp
index 81a5e2d..ba41a05 100755
--- a/src/mathicgb/Reducer.hpp
+++ b/src/mathicgb/Reducer.hpp
@@ -26,7 +26,7 @@ public:
/// one reduction at a time, so it should say that. A matrix-based or
/// parallel reducer will have benefit from being presented with
/// larger sets of reductions at a time.
- virtual size_t preferredSetSize() const = 0;
+ virtual unsigned int preferredSetSize() const = 0;
// ***** Methods that do reduction
diff --git a/src/mathicgb/Scanner.cpp b/src/mathicgb/Scanner.cpp
index 5d8ec09..0649c81 100755
--- a/src/mathicgb/Scanner.cpp
+++ b/src/mathicgb/Scanner.cpp
@@ -91,7 +91,7 @@ bool Scanner::match(const char* const str) {
}
bool Scanner::ensureBuffer(size_t min) {
- const auto got = std::distance(mBufferPos, mBuffer.end()) + 1;
+ const auto got = size_t(std::distance(mBufferPos, mBuffer.end()) + 1);
return got >= min || readBuffer(min - got);
}
diff --git a/src/mathicgb/Scanner.hpp b/src/mathicgb/Scanner.hpp
index d529ae9..4f32048 100755
--- a/src/mathicgb/Scanner.hpp
+++ b/src/mathicgb/Scanner.hpp
@@ -12,6 +12,7 @@
#include <limits>
#include <sstream>
#include <istream>
+#include <cctype>
MATHICGB_NAMESPACE_BEGIN
@@ -109,9 +110,9 @@ public:
/// Returns true if the next character is a digit. Does not skip
/// whitespace.
- bool peekDigit() {return std::isdigit(peek());}
+ bool peekDigit() {return ::std::isdigit(peek());}
- bool peekAlpha() {return std::isalpha(peek());}
+ bool peekAlpha() {return ::std::isalpha(peek());}
/// Returns true if the next character is whitespace. Does not skip
/// whitespace. Whitespace is defined by std::isspace().
diff --git a/src/mathicgb/SignatureGB.cpp b/src/mathicgb/SignatureGB.cpp
index c6ec1c0..f123f36 100755
--- a/src/mathicgb/SignatureGB.cpp
+++ b/src/mathicgb/SignatureGB.cpp
@@ -9,6 +9,7 @@
#include "PolyHeap.hpp"
#include "MTArray.hpp"
#include <mathic.h>
+#include <limits>
MATHICGB_NAMESPACE_BEGIN
@@ -46,7 +47,10 @@ SignatureGB::SignatureGB(
SP(make_unique<SigSPairs>(R, GB.get(), Hsyz.get(), reducer.get(), mPostponeKoszul, mUseBaseDivisors, useSingularCriterionEarly, queueType))
{
mProcessor = make_unique<MonoProcessor<Monoid>>(std::move(processor));
- mProcessor->setComponentCount(basis.size());
+ if (basis.size() > std::numeric_limits<Component>::max())
+ mathic::reportError("Dimension of module too large.");
+ const auto componentCount = Component(basis.size());
+ mProcessor->setComponentCount(componentCount);
// Populate GB
for (size_t j = 0; j < basis.size(); j++)
diff --git a/src/mathicgb/SignatureGB.hpp b/src/mathicgb/SignatureGB.hpp
index 109ff5e..b667210 100755
--- a/src/mathicgb/SignatureGB.hpp
+++ b/src/mathicgb/SignatureGB.hpp
@@ -23,6 +23,7 @@ public:
typedef PolyRing::Monoid Monoid;
typedef Monoid::MonoVector MonoVector;
typedef MonoProcessor<Monoid> Processor;
+ typedef Monoid::Component Component;
SignatureGB(
Basis&& basis,
diff --git a/src/mathicgb/TypicalReducer.cpp b/src/mathicgb/TypicalReducer.cpp
index 5c3f9df..ad10d23 100755
--- a/src/mathicgb/TypicalReducer.cpp
+++ b/src/mathicgb/TypicalReducer.cpp
@@ -9,7 +9,7 @@
MATHICGB_NAMESPACE_BEGIN
-size_t TypicalReducer::preferredSetSize() const {
+unsigned int TypicalReducer::preferredSetSize() const {
return 1;
}
diff --git a/src/mathicgb/TypicalReducer.hpp b/src/mathicgb/TypicalReducer.hpp
index 292cda6..27b55a6 100755
--- a/src/mathicgb/TypicalReducer.hpp
+++ b/src/mathicgb/TypicalReducer.hpp
@@ -23,7 +23,7 @@ class PolyBasis;
*/
class TypicalReducer : public Reducer {
public:
- virtual size_t preferredSetSize() const;
+ virtual unsigned int preferredSetSize() const;
virtual Poly* regularReduce(
const_monomial sig,
diff --git a/src/mathicgb/Unchar.hpp b/src/mathicgb/Unchar.hpp
index d560bbf..f3abc33 100755
--- a/src/mathicgb/Unchar.hpp
+++ b/src/mathicgb/Unchar.hpp
@@ -29,7 +29,7 @@ namespace UncharInternal {
template<>
struct Unchar<char> {
- typedef typename UncharInternal::ExtendedChar<>::type type;
+ typedef UncharInternal::ExtendedChar<>::type type;
};
template<>
struct Unchar<signed char> {typedef short type;};
diff --git a/src/mathicgb/mtbb.hpp b/src/mathicgb/mtbb.hpp
index 5898260..93cdb59 100755
--- a/src/mathicgb/mtbb.hpp
+++ b/src/mathicgb/mtbb.hpp
@@ -3,6 +3,7 @@
#ifndef MATHICGB_M_TBB_GUARD
#define MATHICGB_M_TBB_GUARD
+#define MATHICGB_NO_TBB
#ifndef MATHICGB_NO_TBB
#include <tbb/tbb.h>
diff --git a/src/mathicgb/stdinc.h b/src/mathicgb/stdinc.h
index 91812ff..f9afba8 100755
--- a/src/mathicgb/stdinc.h
+++ b/src/mathicgb/stdinc.h
@@ -47,7 +47,7 @@
/// does not alias any other pointer that is used in the current scope.
#define MATHICGB_RESTRICT __restrict
-#pragma warning (disable: 4996) // std::copy on pointers is flagged as dangerous
+#pragma warning (disable: 4996) // ::std::copy on pointers is flagged as dangerous
#pragma warning (disable: 4290) // VC++ ignores throw () specification.
#pragma warning (disable: 4127) // Warns about using "while (true)".
#pragma warning (disable: 4100) // Warns about unused parameters.
@@ -61,7 +61,7 @@
#pragma warning (disable: 4355)
// Tells Windows.h/Windef.h not to define macroes called min and max since that
-// clashes with std::numeric_limits::max and std::max and probably lots of
+// clashes with ::std::numeric_limits::max and ::std::max and probably lots of
// other things too.
#define NOMINMAX
@@ -176,9 +176,9 @@ See http://herbsutter.com/gotw/_102/ for a reason to have a
make_unique function. It's pretty easy to do, too:
template<typename T, typename ...Args>
-std::unique_ptr<T> make_unique( Args&& ...args )
+::std::unique_ptr<T> make_unique( Args&& ...args )
{
- return std::unique_ptr<T>( new T( std::forward<Args>(args)... ) );
+ return ::std::unique_ptr<T>( new T( ::std::forward<Args>(args)... ) );
}
Unfortunately, MSVC does not have variadic templates, so this turns
@@ -191,92 +191,92 @@ parameters.
MATHICGB_NAMESPACE_BEGIN
template<class T>
-std::unique_ptr<T> make_unique() {
- return std::unique_ptr<T>(new T());
+::std::unique_ptr<T> make_unique() {
+ return ::std::unique_ptr<T>(new T());
}
template<class T, class A1>
-std::unique_ptr<T> make_unique(A1&& a1) {
- return std::unique_ptr<T>(new T(std::forward<A1>(a1)));
+::std::unique_ptr<T> make_unique(A1&& a1) {
+ return ::std::unique_ptr<T>(new T(::std::forward<A1>(a1)));
}
template<class T, class A1, class A2>
-std::unique_ptr<T> make_unique(A1&& a1, A2&& a2) {
- return std::unique_ptr<T>(new T(std::forward<A1>(a1), std::forward<A2>(a2)));
+::std::unique_ptr<T> make_unique(A1&& a1, A2&& a2) {
+ return ::std::unique_ptr<T>(new T(::std::forward<A1>(a1), ::std::forward<A2>(a2)));
}
template<class T, class A1, class A2, class A3>
-std::unique_ptr<T> make_unique(A1&& a1, A2&& a2, A3&& a3) {
- return std::unique_ptr<T>
- (new T(std::forward<A1>(a1), std::forward<A2>(a2), std::forward<A3>(a3)));
+::std::unique_ptr<T> make_unique(A1&& a1, A2&& a2, A3&& a3) {
+ return ::std::unique_ptr<T>
+ (new T(::std::forward<A1>(a1), ::std::forward<A2>(a2), ::std::forward<A3>(a3)));
}
template<class T, class A1, class A2, class A3, class A4>
- std::unique_ptr<T> make_unique(A1&& a1, A2&& a2, A3&& a3, A4&& a4) {
- return std::unique_ptr<T>
- (new T(std::forward<A1>(a1), std::forward<A2>(a2),
- std::forward<A3>(a3), std::forward<A4>(a4)));
+ ::std::unique_ptr<T> make_unique(A1&& a1, A2&& a2, A3&& a3, A4&& a4) {
+ return ::std::unique_ptr<T>
+ (new T(::std::forward<A1>(a1), ::std::forward<A2>(a2),
+ ::std::forward<A3>(a3), ::std::forward<A4>(a4)));
}
template<class T, class A1, class A2, class A3, class A4, class A5>
- std::unique_ptr<T> make_unique(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5) {
- return std::unique_ptr<T>
- (new T(std::forward<A1>(a1), std::forward<A2>(a2),
- std::forward<A3>(a3), std::forward<A4>(a4),
- std::forward<A5>(a5)));
+ ::std::unique_ptr<T> make_unique(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5) {
+ return ::std::unique_ptr<T>
+ (new T(::std::forward<A1>(a1), ::std::forward<A2>(a2),
+ ::std::forward<A3>(a3), ::std::forward<A4>(a4),
+ ::std::forward<A5>(a5)));
}
template<class T, class A1, class A2, class A3, class A4, class A5, class A6>
- std::unique_ptr<T> make_unique
+ ::std::unique_ptr<T> make_unique
(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6) {
- return std::unique_ptr<T>
- (new T(std::forward<A1>(a1), std::forward<A2>(a2),
- std::forward<A3>(a3), std::forward<A4>(a4),
- std::forward<A5>(a5), std::forward<A6>(a6)));
+ return ::std::unique_ptr<T>
+ (new T(::std::forward<A1>(a1), ::std::forward<A2>(a2),
+ ::std::forward<A3>(a3), ::std::forward<A4>(a4),
+ ::std::forward<A5>(a5), ::std::forward<A6>(a6)));
}
template<class T, class A1, class A2, class A3, class A4, class A5, class A6,
class A7>
- std::unique_ptr<T> make_unique
+ ::std::unique_ptr<T> make_unique
(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6, A7&& a7) {
- return std::unique_ptr<T>
- (new T(std::forward<A1>(a1), std::forward<A2>(a2),
- std::forward<A3>(a3), std::forward<A4>(a4),
- std::forward<A5>(a5), std::forward<A6>(a6),
- std::forward<A7>(a7)));
+ return ::std::unique_ptr<T>
+ (new T(::std::forward<A1>(a1), ::std::forward<A2>(a2),
+ ::std::forward<A3>(a3), ::std::forward<A4>(a4),
+ ::std::forward<A5>(a5), ::std::forward<A6>(a6),
+ ::std::forward<A7>(a7)));
}
template<class T, class A1, class A2, class A3, class A4, class A5, class A6,
class A7, class A8>
- std::unique_ptr<T> make_unique
+ ::std::unique_ptr<T> make_unique
(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6, A7&& a7,
A8&& a8) {
- return std::unique_ptr<T>
- (new T(std::forward<A1>(a1), std::forward<A2>(a2),
- std::forward<A3>(a3), std::forward<A4>(a4),
- std::forward<A5>(a5), std::forward<A6>(a6),
- std::forward<A7>(a7), std::forward<A8>(a8)));
+ return ::std::unique_ptr<T>
+ (new T(::std::forward<A1>(a1), ::std::forward<A2>(a2),
+ ::std::forward<A3>(a3), ::std::forward<A4>(a4),
+ ::std::forward<A5>(a5), ::std::forward<A6>(a6),
+ ::std::forward<A7>(a7), ::std::forward<A8>(a8)));
}
template<class T, class A1, class A2, class A3, class A4, class A5, class A6,
class A7, class A8, class A9>
- std::unique_ptr<T> make_unique
+ ::std::unique_ptr<T> make_unique
(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6, A7&& a7,
A8&& a8, A9&& a9) {
- return std::unique_ptr<T>
- (new T(std::forward<A1>(a1), std::forward<A2>(a2),
- std::forward<A3>(a3), std::forward<A4>(a4),
- std::forward<A5>(a5), std::forward<A6>(a6),
- std::forward<A7>(a7), std::forward<A8>(a8),
- std::forward<A9>(a9)));
+ return ::std::unique_ptr<T>
+ (new T(::std::forward<A1>(a1), ::std::forward<A2>(a2),
+ ::std::forward<A3>(a3), ::std::forward<A4>(a4),
+ ::std::forward<A5>(a5), ::std::forward<A6>(a6),
+ ::std::forward<A7>(a7), ::std::forward<A8>(a8),
+ ::std::forward<A9>(a9)));
}
template<class T, class A1, class A2, class A3, class A4, class A5, class A6,
class A7, class A8, class A9, class A10>
- std::unique_ptr<T> make_unique
+ ::std::unique_ptr<T> make_unique
(A1&& a1, A2&& a2, A3&& a3, A4&& a4, A5&& a5, A6&& a6, A7&& a7,
A8&& a8, A9&& a9, A10&& a10) {
- return std::unique_ptr<T>
- (new T(std::forward<A1>(a1), std::forward<A2>(a2),
- std::forward<A3>(a3), std::forward<A4>(a4),
- std::forward<A5>(a5), std::forward<A6>(a6),
- std::forward<A7>(a7), std::forward<A8>(a8),
- std::forward<A9>(a9), std::forward<A9>(a10)));
+ return ::std::unique_ptr<T>
+ (new T(::std::forward<A1>(a1), ::std::forward<A2>(a2),
+ ::std::forward<A3>(a3), ::std::forward<A4>(a4),
+ ::std::forward<A5>(a5), ::std::forward<A6>(a6),
+ ::std::forward<A7>(a7), ::std::forward<A8>(a8),
+ ::std::forward<A9>(a9), ::std::forward<A9>(a10)));
}
template<class T>
-std::unique_ptr<T[]> make_unique_array(size_t count) {
- return std::unique_ptr<T[]>(new T[count]);
+::std::unique_ptr<T[]> make_unique_array(size_t count) {
+ return ::std::unique_ptr<T[]>(new T[count]);
}
// TODO: These types should be defined in some way that actually
diff --git a/src/test/MonoMonoid.cpp b/src/test/MonoMonoid.cpp
index 20ad8c0..6b18cd2 100755
--- a/src/test/MonoMonoid.cpp
+++ b/src/test/MonoMonoid.cpp
@@ -632,7 +632,7 @@ TYPED_TEST(Monoid, Order) {
sortedTotalDegreeRevLex
);
- std::vector<Exponent> dupGradings = {
+ Exponent dupGradingsArray[] = {
5, 2, 3,
10, 4, 6, // duplicate, just multiplied by 2
-6, 9, 4,
@@ -641,6 +641,8 @@ TYPED_TEST(Monoid, Order) {
-6, 9, 4,
-6, 9, 4
};
+ std::vector<Exponent> dupGradings
+ (std::begin(dupGradingsArray), std::end(dupGradingsArray));
// b: 2 9
// c: 3 4
// a: 5 -7
@@ -655,11 +657,13 @@ TYPED_TEST(Monoid, Order) {
sortedDupGradingsRevLex
);
- std::vector<Exponent> lexGradings = {
+ Exponent lexGradingsArray[] = {
0, 0, 1,
0, 1, 0,
1, 0, 0
};
+ std::vector<Exponent> lexGradings
+ (std::begin(lexGradingsArray), std::end(lexGradingsArray));
const auto sortedLex =
"1 a a2 a3 b ab a2b b2 ab2 b3 c ac bc abc c2 ac2 bc2 c3";
check(
diff --git a/src/test/mathicgb.cpp b/src/test/mathicgb.cpp
index 1e75299..f90948d 100755
--- a/src/test/mathicgb.cpp
+++ b/src/test/mathicgb.cpp
@@ -522,7 +522,10 @@ TEST(MathicGBLib, EarlyExit) {
}
TEST(MathicGBLib, SimpleEliminationGB) {
- std::vector<mgb::GroebnerConfiguration::Exponent> gradings = {1,0,0,0, 1,1,1,1};
+ typedef mgb::GroebnerConfiguration::Exponent Exponent;
+ Exponent v[] = {1,0,0,0, 1,1,1,1};
+ std::vector<Exponent> gradings(std::begin(v), std::end(v));
+
for (int i = 0; i < 2; ++i) {
mgb::GroebnerConfiguration configuration(101, 4);
const auto reducer = i == 0 ?
@@ -566,25 +569,30 @@ TEST(MathicGBLib, GlobalOrderOrNot) {
const auto revLex =
mgb::GroebnerConfiguration::BaseOrder::ReverseLexicographicBaseOrder;
- std::vector<mgb::GroebnerConfiguration::Exponent> mat;
+ typedef mgb::GroebnerConfiguration::Exponent Exponent;
+ std::vector<Exponent> mat;
- mat = {};
+ mat.clear();
ASSERT_TRUE(conf.setMonomialOrder(lex, mat));
ASSERT_FALSE(conf.setMonomialOrder(revLex, mat));
- mat = {1,2,3,0};
+ Exponent mat2[] = {1,2,3,0};
+ mat.assign(std::begin(mat2), std::end(mat2));
ASSERT_TRUE(conf.setMonomialOrder(lex, mat));
ASSERT_FALSE(conf.setMonomialOrder(revLex, mat));
- mat = {1,0,0,0, -3,0,1,2};
+ Exponent mat3[] = {1,0,0,0, -3,0,1,2};
+ mat.assign(std::begin(mat3), std::end(mat3));
ASSERT_TRUE(conf.setMonomialOrder(lex, mat));
ASSERT_FALSE(conf.setMonomialOrder(revLex, mat));
- mat = {1,1,0,0, 3,0,1,2};
+ Exponent mat4[] = {1,1,0,0, 3,0,1,2};
+ mat.assign(std::begin(mat4), std::end(mat4));
ASSERT_TRUE(conf.setMonomialOrder(lex, mat));
ASSERT_TRUE(conf.setMonomialOrder(revLex, mat));
- mat = {1,0,0,0, 3,1,1,-2};
+ Exponent mat5[] = {1,0,0,0, 3,1,1,-2};
+ mat.assign(std::begin(mat5), std::end(mat5));
ASSERT_FALSE(conf.setMonomialOrder(lex, mat));
ASSERT_FALSE(conf.setMonomialOrder(revLex, mat));
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mathicgb.git
More information about the debian-science-commits
mailing list