|
[yoda-svn] r358 - trunk/include/YODAblackhole at projects.hepforge.org blackhole at projects.hepforge.orgThu Aug 25 09:58:47 BST 2011
Author: mkawalec Date: Thu Aug 25 09:58:47 2011 New Revision: 358 Log: Removed Low/High edge caches from Axis2D and made lowEdge() etc. use _binHashSparse instead. Modified: trunk/include/YODA/Axis2D.h Modified: trunk/include/YODA/Axis2D.h ============================================================================== --- trunk/include/YODA/Axis2D.h Thu Aug 25 09:46:24 2011 (r357) +++ trunk/include/YODA/Axis2D.h Thu Aug 25 09:58:47 2011 (r358) @@ -126,7 +126,6 @@ for (size_t i = 0; i < _bins.size(); ++i) { _bins[i] = bins[i]; } - _regenDelimiters(); if (isGrid()) _setOutflows(); _outflows = outflows; @@ -155,7 +154,6 @@ _binHashSparse.first.regenCache(); _binHashSparse.second.regenCache(); - _regenDelimiters(); } //@} @@ -258,7 +256,6 @@ _binHashSparse.first.regenCache(); _binHashSparse.second.regenCache(); - _regenDelimiters(); } @@ -299,22 +296,22 @@ /// Get the value of the lowest x-edge on the axis const double lowEdgeX() const { - return _lowEdgeX; + return _binHashSparse.second.front().first; } /// Get the value of the highest x-edge on the axis const double highEdgeX() const { - return _highEdgeX; + return _binHashSparse.second.back().first; } /// Get the value of the lowest y-edge on the axis const double lowEdgeY() const { - return _lowEdgeY; + return _binHashSparse.first.front().first; } /// Get the value of the highest y-edge on the axis const double highEdgeY() const { - return _highEdgeY; + return _binHashSparse.first.back().first; } @@ -500,9 +497,6 @@ } } } - - // Check if any of the bounds changed - _regenDelimiters(); } //@} @@ -548,9 +542,6 @@ _outflows[i][j].scaleXY(scaleX, scaleY); } } - - // Making sure that we have correct boundaries set after rescaling - _regenDelimiters(); } @@ -1025,38 +1016,9 @@ // Setting all the caches _binHashSparse.first.regenCache(); _binHashSparse.second.regenCache(); - _regenDelimiters(); _genGridCache(); } - /// @brief Plot extrema (re)generator. - /// - /// Since scrolling through every bin is an expensive operation to do every - /// time we need the limits of the plot, there are caches set up. This - /// function regenerates them. It should be run after any change is made to - /// bin layout. - /// - /// @todo This is too large to be inline: move to the .cc - void _regenDelimiters() { - double highEdgeX = std::numeric_limits<double>::min(); - double highEdgeY = std::numeric_limits<double>::min(); - double lowEdgeX = std::numeric_limits<double>::max(); - double lowEdgeY = std::numeric_limits<double>::max(); - - // Scroll through the bins and set the delimiters. - for (size_t i = 0; i < _bins.size(); ++i) { - if (_bins[i].xMin() < lowEdgeX) lowEdgeX = _bins[i].xMin(); - if (_bins[i].xMax() > highEdgeX) highEdgeX = _bins[i].xMax(); - if (_bins[i].yMin() < lowEdgeY) lowEdgeY = _bins[i].yMin(); - if (_bins[i].yMax() > highEdgeY) highEdgeY = _bins[i].yMax(); - } - - _lowEdgeX = lowEdgeX; - _highEdgeX = highEdgeX; - _lowEdgeY = lowEdgeY; - _highEdgeY = highEdgeY; - } - private:
More information about the yoda-svn mailing list |