[mathicgb] 04/393: Moved BitTriangle out of mathicgb and into mathic.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Fri Apr 3 15:58:20 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 d15546b95b91a3d873c289effd30600be18df07d
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date: Mon Jul 9 20:13:15 2012 -0400
Moved BitTriangle out of mathicgb and into mathic.
---
Makefile.am | 3 +-
src/mathicgb/BitTriangle.cpp | 13 --------
src/mathicgb/BitTriangle.hpp | 78 -------------------------------------------
src/mathicgb/SPairHandler.hpp | 4 +--
src/mathicgb/SPairs.cpp | 4 +--
src/mathicgb/SPairs.hpp | 4 +--
6 files changed, 7 insertions(+), 99 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 0bac575..a7f4fa2 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,8 +17,7 @@ libmathicgb_la_LIBADD= $(DEPS_LIBS)
# the sources that are built to make libmathicgb. Listing the headers in
# sources ensure that those files are included in distributions.
-libmathicgb_la_SOURCES = src/mathicgb/BitTriangle.cpp \
- src/mathicgb/BitTriangle.hpp src/mathicgb/BjarkeGeobucket.cpp \
+libmathicgb_la_SOURCES = src/mathicgb/BjarkeGeobucket.cpp \
src/mathicgb/BjarkeGeobucket.hpp src/mathicgb/BuchbergerAlg.cpp \
src/mathicgb/BuchbergerAlg.hpp src/mathicgb/ChainedHashTable.cpp \
src/mathicgb/ChainedHashTable.hpp src/mathicgb/DivisorLookup.cpp \
diff --git a/src/mathicgb/BitTriangle.cpp b/src/mathicgb/BitTriangle.cpp
deleted file mode 100644
index b141cca..0000000
--- a/src/mathicgb/BitTriangle.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "stdinc.h"
-#include "BitTriangle.hpp"
-
-size_t BitTriangle::getMemoryUse() const
-{
- size_t sum = mColumns.capacity() * sizeof(mColumns.front());
- const size_t stop = mColumns.size();
- for (size_t i = 0; i != stop; ++i) {
- size_t const capacity = mColumns[i].capacity();
- sum += (capacity / 8) + (capacity % 8 != 0); // 8 bits per byte rounded up
- }
- return sum;
-}
diff --git a/src/mathicgb/BitTriangle.hpp b/src/mathicgb/BitTriangle.hpp
deleted file mode 100644
index 309e766..0000000
--- a/src/mathicgb/BitTriangle.hpp
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef _bit_triangle_h_
-#define _bit_triangle_h_
-
-#include <vector>
-
-// Object that stores a triangular 2-dimensional array of bits. For example:
-//
-// row
-// 3|
-// 2| 1
-// 1| 0 1
-// 0| 0 0 0
-// -------
-// 0 1 2 3 column
-//
-// A bit is addressed by a pair (column, row) where the column goes first.
-// All valid address pairs have 0 <= row < column < columnCount().
-class BitTriangle {
-public:
- // Returns how many columns the triangle has
- size_t columnCount() const {return mColumns.size();}
-
- // Returns true if there are no columns in the triangle
- bool empty() const {return mColumns.empty();}
-
- // Adds a new column of the triangle. This increases columnCount() by
- // one, and the index of the new column is the previous value of
- // columnCount(). The new bits are all set to false initially.
- void addColumn() {
- size_t oldSize = mColumns.size();
- mColumns.resize(oldSize + 1);
- mColumns[oldSize].resize(oldSize);
- }
-
- // Returns the bit in the given column and row. As this is a triangle it
- // must be true that column >= row.
- bool bit(size_t column, size_t row) const {
- ASSERT(column < columnCount());
- ASSERT(row < column);
- return mColumns[column][row];
- }
-
- // As bit, but uses max(x,y) as the column and min(x,y) as the row.
- bool bitUnordered(size_t x, size_t y) const {
- ASSERT(x < columnCount());
- ASSERT(y < columnCount());
- ASSERT(x != y);
- if (x < y)
- std::swap(x, y);
- return bit(x, y);
- }
-
- // Returns the bit in the given column and row. As this is a triangle it
- // must be true that column >= row.
- void setBit(size_t column, size_t row, bool value) {
- ASSERT(column < columnCount());
- ASSERT(row < column);
- mColumns[column][row] = value;
- }
-
- // As setBit, but uses max(x,y) as the column and min(x,y) as the row.
- void setBitUnordered(size_t x, size_t y, bool value) {
- ASSERT(x < columnCount());
- ASSERT(y < columnCount());
- ASSERT(x != y);
- if (x < y)
- std::swap(x, y);
- setBit(x, y, value);
- }
-
- size_t getMemoryUse() const;
-
-private:
- std::vector<std::vector<bool> > mColumns;
-};
-
-#endif
-
diff --git a/src/mathicgb/SPairHandler.hpp b/src/mathicgb/SPairHandler.hpp
old mode 100644
new mode 100755
index c29bbbe..635db4d
--- a/src/mathicgb/SPairHandler.hpp
+++ b/src/mathicgb/SPairHandler.hpp
@@ -13,7 +13,7 @@
#include "PolyRing.hpp"
#include "KoszulQueue.hpp"
#include "SPairQueue.hpp"
-#include "BitTriangle.hpp"
+#include <mathic.h>
#include <memtailor.h>
class Poly;
@@ -171,7 +171,7 @@ private:
// one entry for every s-pair, which is set to true if the
// s-pair is known to be a syzygy. Only used if
// mUseBaseDivisors is true.
- BitTriangle mKnownSyzygyTri;
+ mathic::BitTriangle mKnownSyzygyTri;
// From elsewhere
MonomialTableArray *Hsyz; // we often modify this
diff --git a/src/mathicgb/SPairs.cpp b/src/mathicgb/SPairs.cpp
old mode 100644
new mode 100755
index ece1865..82d17fa
--- a/src/mathicgb/SPairs.cpp
+++ b/src/mathicgb/SPairs.cpp
@@ -47,7 +47,7 @@ namespace {
public:
RecordIndexes(
size_t newGen,
- BitTriangle& eliminated,
+ mathic::BitTriangle& eliminated,
std::vector<size_t>& indexes
):
mNewGen(newGen),
@@ -72,7 +72,7 @@ namespace {
}
private:
size_t const mNewGen;
- BitTriangle& mEliminated;
+ mathic::BitTriangle& mEliminated;
std::vector<size_t>& mIndexes;
};
}
diff --git a/src/mathicgb/SPairs.hpp b/src/mathicgb/SPairs.hpp
old mode 100644
new mode 100755
index 62f906b..18ed5e5
--- a/src/mathicgb/SPairs.hpp
+++ b/src/mathicgb/SPairs.hpp
@@ -2,8 +2,8 @@
#define _s_pairs_h_
#include "PairTriangle.hpp"
-#include "BitTriangle.hpp"
#include <utility>
+#include <mathic.h>
class PolyBasis;
@@ -135,7 +135,7 @@ private:
// basis element i and j does not have to be reduced. This can be due to a
// useless S-pair criterion eliminating that pair, or it can be because the
// S-polynomial of that pair has already been reduced.
- BitTriangle mEliminated;
+ mathic::BitTriangle mEliminated;
const PolyBasis& mBasis;
const PolyRing& mRing;
mutable Stats mStats;
--
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