[mathic] 32/62: Changed name of PairQueue::size to PairQueue::pairCount.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Wed Apr 1 11:36:21 UTC 2015


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

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

commit 11cb197bbb8c5abb589e0785b0ecf58facd50c12
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date:   Mon Aug 6 02:18:39 2012 -0400

    Changed name of PairQueue::size to PairQueue::pairCount.
---
 src/mathic/PairQueue.h |  4 ++--
 src/test/PairQueue.cpp | 18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/mathic/PairQueue.h b/src/mathic/PairQueue.h
index c6622b1..5db9064 100755
--- a/src/mathic/PairQueue.h
+++ b/src/mathic/PairQueue.h
@@ -120,7 +120,7 @@ namespace mathic {
 
 	// Returns how many pairs are in the triangle. O(columnCount())
 	// time.
-	size_t size() const;
+	size_t pairCount() const;
 
 	// Returns true if there are no pairs in the triangle. O(1) time.
 	bool empty() const;
@@ -405,7 +405,7 @@ namespace mathic {
   }
 
   template<class C>
-  size_t PairQueue<C>::size() const {
+  size_t PairQueue<C>::pairCount() const {
 	ColumnSizeSummer summer;
 	mColumnQueue.forAll(summer);
 	return summer.sizeSum();
diff --git a/src/test/PairQueue.cpp b/src/test/PairQueue.cpp
index b8cfc5f..444c0cd 100755
--- a/src/test/PairQueue.cpp
+++ b/src/test/PairQueue.cpp
@@ -41,11 +41,11 @@ TEST(PairQueue, NoOp) {
   ASSERT_EQ(421, pq.configuration().id());
 };
 
-TEST(PairQueue, emptyAndSizeAndColumnCount) {
+TEST(PairQueue, emptyAndPairCountAndColumnCount) {
   mathic::PairQueue<PQConf> pq(PQConf(1));
 
   ASSERT_TRUE(pq.empty());
-  ASSERT_EQ(0, pq.size());
+  ASSERT_EQ(0, pq.pairCount());
   ASSERT_EQ(0, pq.columnCount());
   size_t const columnCount = 7;
   mathic::PairQueue<PQConf>::Index rows[columnCount - 1] = {0,1,2,3,4,5};
@@ -54,34 +54,34 @@ TEST(PairQueue, emptyAndSizeAndColumnCount) {
 	// single-digit indicies are sorted just by their numerical value
 	pq.addColumnDescending(rows, rows + i);
 	ASSERT_EQ(i == 0, pq.empty());
-	ASSERT_EQ((i * (i + 1)) / 2, pq.size()) << "i = " << i;
+	ASSERT_EQ((i * (i + 1)) / 2, pq.pairCount()) << "i = " << i;
 	ASSERT_EQ(i + 1, pq.columnCount());
   }
   size_t pairCount = (columnCount * (columnCount - 1)) / 2;
   ASSERT_FALSE(pq.empty());
-  ASSERT_EQ(pairCount, pq.size());
+  ASSERT_EQ(pairCount, pq.pairCount());
   ASSERT_EQ(columnCount, pq.columnCount());
 
   // add empty column
   pq.addColumnDescending(rows, rows);
   ASSERT_FALSE(pq.empty());
-  ASSERT_EQ(pairCount, pq.size());
+  ASSERT_EQ(pairCount, pq.pairCount());
   ASSERT_EQ(columnCount + 1, pq.columnCount());
 
   // add a 2-element column
   pq.addColumnDescending(rows, rows + 2);
   pairCount += 2;
   ASSERT_FALSE(pq.empty());
-  ASSERT_EQ(pairCount, pq.size());
+  ASSERT_EQ(pairCount, pq.pairCount());
   ASSERT_EQ(columnCount + 2, pq.columnCount());
 
   for (size_t i = 0; i < pairCount; ++i) {
-	ASSERT_EQ(pairCount - i, pq.size());
+	ASSERT_EQ(pairCount - i, pq.pairCount());
 	ASSERT_FALSE(pq.empty());
 	pq.pop();
   }
   ASSERT_TRUE(pq.empty());
-  ASSERT_EQ(0, pq.size());
+  ASSERT_EQ(0, pq.pairCount());
   ASSERT_EQ(columnCount + 2, pq.columnCount());
 
   pq.addColumnDescending(rows, rows); // empty column
@@ -126,7 +126,7 @@ TEST(PairQueue, Ordering) {
 	// either order works.
 	std::pair<size_t, size_t> p;
 	std::string pd;
-	if ((pq.size() % 2) == 0) {
+	if ((pq.pairCount() % 2) == 0) {
 	  pd = pq.topPairData();
 	  p = pq.topPair();
 	} else {

-- 
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