comparison data/model/EditableDenseThreeDimensionalModel.cpp @ 537:3cc4b7cd2aa5

* Merge from one-fftdataserver-per-fftmodel branch. This bit of reworking (which is not described very accurately by the title of the branch) turns the MatrixFile object into something that either reads or writes, but not both, and separates the FFT file cache reader and writer implementations separately. This allows the FFT data server to have a single thread owning writers and one reader per "customer" thread, and for all locking to be vastly simplified and concentrated in the data server alone (because none of the classes it makes use of is used in more than one thread at a time). The result is faster and more trustworthy code.
author Chris Cannam
date Tue, 27 Jan 2009 13:25:10 +0000
parents beb51f558e9c
children 4f3e3fb07e0b
comparison
equal deleted inserted replaced
536:beb51f558e9c 537:3cc4b7cd2aa5
289 } 289 }
290 bool top = true; 290 bool top = true;
291 int tdist = trunc; 291 int tdist = trunc;
292 if (trunc < 0) { top = false; tdist = -trunc; } 292 if (trunc < 0) { top = false; tdist = -trunc; }
293 Column p = expandAndRetrieve(index - tdist); 293 Column p = expandAndRetrieve(index - tdist);
294 if (p.size() != m_yBinCount) { 294 int psize = p.size(), csize = c.size();
295 if (psize != m_yBinCount) {
295 std::cerr << "WARNING: EditableDenseThreeDimensionalModel::expandAndRetrieve: Trying to expand from incorrectly sized column" << std::endl; 296 std::cerr << "WARNING: EditableDenseThreeDimensionalModel::expandAndRetrieve: Trying to expand from incorrectly sized column" << std::endl;
296 } 297 }
297 if (top) { 298 if (top) {
298 for (int i = c.size(); i < p.size(); ++i) { 299 for (int i = csize; i < psize; ++i) {
299 c.push_back(p.at(i)); 300 c.push_back(p.at(i));
300 } 301 }
301 } else { 302 } else {
302 for (int i = int(p.size()) - int(c.size()); i >= 0; --i) { 303 for (int i = psize - csize - 1; i >= 0; --i) {
303 c.push_front(p.at(i)); 304 c.push_front(p.at(i));
304 } 305 }
305 } 306 }
306 return c; 307 return c;
307 } 308 }