[mathic] 02/30: apply diffs from Macaulay2 source tree

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sun Mar 20 20:58:51 UTC 2016


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository mathic.

commit 35df1e914586d5f43832b5f60a57256a248909e5
Author: Daniel R. Grayson <dan at math.uiuc.edu>
Date:   Mon Sep 22 16:01:14 2014 -0500

    apply diffs from Macaulay2 source tree
---
 configure.ac              | 11 +++++----
 src/mathic/DivList.h      | 57 ++++++++++++++++++++++++++---------------------
 src/test/PairQueue.cpp    |  9 ++++++--
 src/test/gtestInclude.cpp |  2 +-
 4 files changed, 46 insertions(+), 33 deletions(-)

diff --git a/configure.ac b/configure.ac
index da428a3..a38cfb6 100755
--- a/configure.ac
+++ b/configure.ac
@@ -4,6 +4,8 @@ AC_INIT([mathic], [1.0]) # package, version, bug-report-email
 # Check that memtailor is installed and locate it
 PKG_CHECK_MODULES([MEMTAILOR], [memtailor])
 
+AM_PROG_AR
+
 dnl ----- The gtest dependency
 
 AC_ARG_WITH([gtest], AS_HELP_STRING(
@@ -24,7 +26,8 @@ AS_IF([test "x$GTEST_VERSION" == "x"], [GTEST_VERSION="1.6.0"])
 AS_IF([test "x$with_gtest" == "x"], [with_gtest="download"])
 
 AS_IF([test "x$with_gtest" == "xdownload"],
-  [with_gtest="yes"; AC_CHECK_FILE([$GTEST_PATH/gtest/src/gtest-all.cc], [], [
+  [with_gtest="yes"; AC_CHECK_FILE([$GTEST_PATH/src/gtest-all.cc], [], [
+    echo "downloading of gtest disabled" >&2; exit 1
     mkdir -p "$GTEST_PATH";
     (
       cd $GTEST_PATH;
@@ -35,7 +38,7 @@ AS_IF([test "x$with_gtest" == "xdownload"],
       rm -rf gtest/
       mv gtest-$GTEST_VERSION/ gtest/
     );
-    if test ! -e "$GTEST_PATH/gtest/src/gtest-all.cc"; then
+    if test ! -e "$GTEST_PATH/src/gtest-all.cc"; then
       AC_MSG_WARN([Failed to download or extract gtest.]);
       with_gtest="no";
     else
@@ -43,7 +46,7 @@ AS_IF([test "x$with_gtest" == "xdownload"],
     fi
   ])],
   [test "x$with_gtest" == "xyes"], [
-    AC_CHECK_FILE([$GTEST_PATH/gtest/src/gtest-all.cc], [], [
+    AC_CHECK_FILE([$GTEST_PATH/src/gtest-all.cc], [], [
       AC_MSG_ERROR([could not find gtest source at path $GTEST_PATH.])
     ])
   ],
@@ -51,7 +54,7 @@ AS_IF([test "x$with_gtest" == "xdownload"],
   [AC_MSG_ERROR([invalid value $with_gtest for with_gtest.])]
 )
 AS_IF([test "x$with_gtest" == "xyes"],
-  [GTEST_CFLAGS="-I`cd $GTEST_PATH/gtest/include; echo $PWD` -I`cd $GTEST_PATH/gtest/; echo $PWD`"]);
+  [GTEST_CFLAGS="-I$GTEST_PATH/include -I$GTEST_PATH"]);
 AM_CONDITIONAL(with_gtest, test "x$with_gtest" == "xyes")
 
 DEPS_CFLAGS="$MEMTAILOR_CFLAGS $GTEST_CFLAGS"
diff --git a/src/mathic/DivList.h b/src/mathic/DivList.h
index 03cf87d..b4558c2 100755
--- a/src/mathic/DivList.h
+++ b/src/mathic/DivList.h
@@ -159,6 +159,34 @@ namespace mathic {
   };
 
   template<class C>
+    class DivList<C>::iterator :
+  public std::iterator<std::bidirectional_iterator_tag, Entry> {
+  public:
+    friend class DivList<C>;
+    explicit iterator(ListIter it): _it(it) {}
+    operator const_iterator() const {return const_iterator(_it);}
+
+    bool operator==(iterator it) {return _it == it._it;}
+    bool operator!=(iterator it) {return _it != it._it;}
+    bool operator==(const_iterator it); // {return it == const_iterator(*this);}
+    bool operator!=(const_iterator it); // {return it != const_iterator(*this);}
+
+    iterator& operator++() {++_it; return *this;}
+    iterator operator++(int) {iterator tmp = *this; operator++(); return tmp;}
+    iterator& operator--() {--_it; return *this;}
+    iterator operator--(int) {iterator tmp = *this; operator--(); return tmp;}
+
+    Entry& operator*() const {return _it->get();}
+    Entry* operator->() const {return &_it->get();}
+
+  protected:
+    ListIter getInternal() {return _it;}
+
+  private:
+    ListIter _it;
+  };
+
+  template<class C>
     class DivList<C>::const_iterator :
   public std::iterator<std::bidirectional_iterator_tag, const Entry> {
   public:
@@ -193,32 +221,9 @@ namespace mathic {
   };
 
   template<class C>
-    class DivList<C>::iterator :
-  public std::iterator<std::bidirectional_iterator_tag, Entry> {
-  public:
-    friend class DivList<C>;
-    explicit iterator(ListIter it): _it(it) {}
-    operator const_iterator() const {return const_iterator(_it);}
-
-    bool operator==(iterator it) {return _it == it._it;}
-    bool operator!=(iterator it) {return _it != it._it;}
-    bool operator==(const_iterator it) {return it == const_iterator(*this);}
-    bool operator!=(const_iterator it) {return it != const_iterator(*this);}
-
-    iterator& operator++() {++_it; return *this;}
-    iterator operator++(int) {iterator tmp = *this; operator++(); return tmp;}
-    iterator& operator--() {--_it; return *this;}
-    iterator operator--(int) {iterator tmp = *this; operator--(); return tmp;}
-
-    Entry& operator*() const {return _it->get();}
-    Entry* operator->() const {return &_it->get();}
-
-  protected:
-    ListIter getInternal() {return _it;}
-
-  private:
-    ListIter _it;
-  };
+    bool DivList<C>::iterator::operator==(const_iterator it) {return it == const_iterator(*this);}
+  template<class C>
+    bool DivList<C>::iterator::operator!=(const_iterator it) {return it != const_iterator(*this);}
 
   namespace DivListHelper {
     template<class C, class E, class M, class MO>
diff --git a/src/test/PairQueue.cpp b/src/test/PairQueue.cpp
index b911176..0043cd6 100755
--- a/src/test/PairQueue.cpp
+++ b/src/test/PairQueue.cpp
@@ -114,6 +114,7 @@ TEST(PairQueue, Ordering) {
   // distinguish all pairs and that, according to the pairdata,
   //   (11,0) < (11,10) = (111,0) < (11,5)
   // so the order that pairs are extracted mix up columns 11 and 111.
+
   for (size_t col = 0; col < 112; ++col) {
 	Index const* begin = 0;
 	Index const* end = 0;
@@ -121,20 +122,24 @@ TEST(PairQueue, Ordering) {
 	  Index const rows[] = {0};
 	  begin = rows;
 	  end = rows + sizeof(rows) / sizeof(rows[0]);
+      pq.addColumnDescending(begin, end);
 	} else if (col == 11) {
 	  Index const rows[] = {0, 10, 5};
 	  begin = rows;
 	  end = rows + sizeof(rows) / sizeof(rows[0]);
+      pq.addColumnDescending(begin, end);
 	} else if (col == 13) {
 	  Index const rows[] = {12, 3, 7};
 	  begin = rows;
 	  end = rows + sizeof(rows) / sizeof(rows[0]);
+      pq.addColumnDescending(begin, end);
 	} else if (col == 111) {
 	  Index const rows[] = {0, 100};
 	  begin = rows;
 	  end = rows + sizeof(rows) / sizeof(rows[0]);
-	}
-	pq.addColumnDescending(begin, end);
+      pq.addColumnDescending(begin, end);
+	} else
+      pq.addColumnDescending(begin, end);
   }
   std::ostringstream out;
   std::string lastPd;
diff --git a/src/test/gtestInclude.cpp b/src/test/gtestInclude.cpp
index a14f48f..a956b23 100755
--- a/src/test/gtestInclude.cpp
+++ b/src/test/gtestInclude.cpp
@@ -7,4 +7,4 @@
 
 // the .. goes back from the include/ directory of gtest so we can
 // enter the src directory.
-#include <../src/gtest-all.cc>
+#include "src/gtest-all.cc"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mathic.git



More information about the debian-science-commits mailing list