comparison data/model/EditableDenseThreeDimensionalModel.cpp @ 941:3be40cf40c49

Tidy
author Chris Cannam
date Wed, 02 Jul 2014 08:42:11 +0100
parents df82da55e86a
children 0009b2b066e0
comparison
equal deleted inserted replaced
940:2481777d4c3e 941:3be40cf40c49
285 EditableDenseThreeDimensionalModel::Column 285 EditableDenseThreeDimensionalModel::Column
286 EditableDenseThreeDimensionalModel::expandAndRetrieve(int index) const 286 EditableDenseThreeDimensionalModel::expandAndRetrieve(int index) const
287 { 287 {
288 // See comment above m_trunc declaration in header 288 // See comment above m_trunc declaration in header
289 289
290 assert(int(index) < m_data.size()); 290 assert(index >= 0 && index < int(m_data.size()));
291 Column c = m_data.at(index); 291 Column c = m_data.at(index);
292 if (index == 0) { 292 if (index == 0) {
293 return c; 293 return c;
294 } 294 }
295 int trunc = (int)m_trunc[index]; 295 int trunc = (int)m_trunc[index];
299 bool top = true; 299 bool top = true;
300 int tdist = trunc; 300 int tdist = trunc;
301 if (trunc < 0) { top = false; tdist = -trunc; } 301 if (trunc < 0) { top = false; tdist = -trunc; }
302 Column p = expandAndRetrieve(index - tdist); 302 Column p = expandAndRetrieve(index - tdist);
303 int psize = p.size(), csize = c.size(); 303 int psize = p.size(), csize = c.size();
304 if (psize != int(m_yBinCount)) { 304 if (psize != m_yBinCount) {
305 cerr << "WARNING: EditableDenseThreeDimensionalModel::expandAndRetrieve: Trying to expand from incorrectly sized column" << endl; 305 cerr << "WARNING: EditableDenseThreeDimensionalModel::expandAndRetrieve: Trying to expand from incorrectly sized column" << endl;
306 } 306 }
307 if (top) { 307 if (top) {
308 for (int i = csize; i < psize; ++i) { 308 for (int i = csize; i < psize; ++i) {
309 c.push_back(p.at(i)); 309 c.push_back(p.at(i));