comparison src/Finder.cpp @ 172:30d59e1e4232 structure

Minor tidy
author Chris Cannam
date Fri, 06 Feb 2015 18:09:18 +0000
parents bb4507f24dc9
children eeed3498fe96
comparison
equal deleted inserted replaced
171:bb4507f24dc9 172:30d59e1e4232
55 } 55 }
56 56
57 bool 57 bool
58 Finder::getBestRowCost(int row, int &bestCol, double &min) 58 Finder::getBestRowCost(int row, int &bestCol, double &min)
59 { 59 {
60 cerr << "Finder " << this << "::getBestRowCost(" << row << ")" << endl; 60 if (!m_m->isRowAvailable(row)) return false;
61 if (!m_m->isRowAvailable(row)) {
62 cerr << "row not available: " << row << endl;
63 return false;
64 }
65 pair<int, int> colRange = m_m->getColRange(row); 61 pair<int, int> colRange = m_m->getColRange(row);
66 if (colRange.first >= colRange.second) { 62 if (colRange.first >= colRange.second) return false;
67 cerr << "row " << row << " has invalid col range " << colRange.first
68 << " -> " << colRange.second << endl;
69 return false;
70 }
71 for (int index = colRange.first; index < colRange.second; index++) { 63 for (int index = colRange.first; index < colRange.second; index++) {
72 double tmp = m_m->getNormalisedPathCost(row, index); 64 double tmp = m_m->getNormalisedPathCost(row, index);
73 if (index == colRange.first || tmp < min) { 65 if (index == colRange.first || tmp < min) {
74 min = tmp; 66 min = tmp;
75 bestCol = index; 67 bestCol = index;