changeset 205:010b91e44098 memory

Rename getRowRange/getColRange to make nature of arg clearer
author Chris Cannam
date Fri, 27 Feb 2015 12:21:58 +0000
parents 006fd4cb95b3
children fb799a1aabd8
files src/Finder.cpp src/Matcher.cpp src/Matcher.h
diffstat 3 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/Finder.cpp	Fri Feb 27 12:20:32 2015 +0000
+++ b/src/Finder.cpp	Fri Feb 27 12:21:58 2015 +0000
@@ -58,7 +58,7 @@
 Finder::getBestRowCost(int row, int &bestCol, normpathcost_t &min)
 {
     if (!m_m->isRowAvailable(row)) return false;
-    pair<int, int> colRange = m_m->getColRange(row);
+    pair<int, int> colRange = m_m->getColRangeForRow(row);
     if (colRange.first >= colRange.second) return false;
     for (int index = colRange.first; index < colRange.second; index++) {
         normpathcost_t tmp = m_m->getNormalisedPathCost(row, index);
@@ -74,7 +74,7 @@
 Finder::getBestColCost(int col, int &bestRow, normpathcost_t &min)
 {
     if (!m_m->isColAvailable(col)) return false;
-    pair<int, int> rowRange = m_m->getRowRange(col);
+    pair<int, int> rowRange = m_m->getRowRangeForCol(col);
     if (rowRange.first >= rowRange.second) return false;
     bestRow = rowRange.first;
     for (int index = rowRange.first; index < rowRange.second; index++) {
@@ -99,7 +99,7 @@
     bestRow = row;
     bestCol = col;
 
-    pair<int, int> rowRange = m_m->getRowRange(col);
+    pair<int, int> rowRange = m_m->getRowRangeForCol(col);
     if (rowRange.second > row+1) {
         rowRange.second = row+1;	// don't cheat by looking at future :)
     }
@@ -111,7 +111,7 @@
         }
     }
 
-    pair<int, int> colRange = m_m->getColRange(row);
+    pair<int, int> colRange = m_m->getColRangeForRow(row);
     if (colRange.second > col+1) {
         colRange.second = col+1;	// don't cheat by looking at future :)
     }
@@ -177,7 +177,7 @@
 
     for (int r = r1; r <= r2; r++) {
 
-        pair<int, int> colRange = m_m->getColRange(r);
+        pair<int, int> colRange = m_m->getColRangeForRow(r);
 
         int rowStart = max(c1, colRange.first);
         int rowStop = min(c2 + 1, colRange.second);
@@ -246,7 +246,7 @@
 
     for (int r = r1; r <= r2; r++) {
 
-        pair<int, int> colRange = m_m->getColRange(r);
+        pair<int, int> colRange = m_m->getColRangeForRow(r);
 
         int rowStart = max(c1, colRange.first);
         int rowStop = min(c2 + 1, colRange.second);
--- a/src/Matcher.cpp	Fri Feb 27 12:20:32 2015 +0000
+++ b/src/Matcher.cpp	Fri Feb 27 12:21:58 2015 +0000
@@ -138,7 +138,7 @@
 }
 
 pair<int, int>
-Matcher::getColRange(int i)
+Matcher::getColRangeForRow(int i)
 {
     if (m_firstPM) {
         if (i < 0 || i >= int(m_first.size())) {
@@ -149,12 +149,12 @@
             return pair<int, int>(m_first[i], m_last[i]);
         }
     } else {
-        return m_otherMatcher->getRowRange(i);
+        return m_otherMatcher->getRowRangeForCol(i);
     }
 }
 
 pair<int, int>
-Matcher::getRowRange(int j)
+Matcher::getRowRangeForCol(int j)
 {
     if (m_firstPM) {
 
@@ -176,7 +176,7 @@
         }
 
     } else {
-        return m_otherMatcher->getColRange(j);
+        return m_otherMatcher->getColRangeForRow(j);
     }
 }
 
--- a/src/Matcher.h	Fri Feb 27 12:20:32 2015 +0000
+++ b/src/Matcher.h	Fri Feb 27 12:21:58 2015 +0000
@@ -188,7 +188,7 @@
      *  Matcher. Note that the last frame is exclusive (last valid
      *  frame + 1).
      */
-    std::pair<int, int> getColRange(int i);
+    std::pair<int, int> getColRangeForRow(int i);
 
     /** Returns the valid range of rows for the given column, that is,
      *  the range of frames in this Matcher for the given frame in the
@@ -199,7 +199,7 @@
      *  Matcher. Note that the last frame is exclusive (last valid
      *  frame + 1).
      */
-    std::pair<int, int> getRowRange(int i);
+    std::pair<int, int> getRowRangeForCol(int i);
     
     /** Retrieves a value from the distance matrix.
      *