[yoda-svn] r226 - in trunk: include/YODA src

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Aug 8 19:07:52 BST 2011


Author: buckley
Date: Mon Aug  8 19:07:52 2011
New Revision: 226

Log:
Make sure that all required symbols exist, and fix some other typos and stylistic things

Modified:
   trunk/include/YODA/Axis2D.h
   trunk/include/YODA/Scatter2D.h
   trunk/include/YODA/Scatter3D.h
   trunk/src/Scatter2D.cc
   trunk/src/Scatter3D.cc

Modified: trunk/include/YODA/Axis2D.h
==============================================================================
--- trunk/include/YODA/Axis2D.h	Mon Aug  8 18:47:52 2011	(r225)
+++ trunk/include/YODA/Axis2D.h	Mon Aug  8 19:07:52 2011	(r226)
@@ -807,9 +807,9 @@
                     _binHashSparse.first[i].second[j].second.second *=scaleX;
                 }
             }
-            for(unsigned int i=0; i < _binHashSparse.second.size(); i++) {
+            for (unsigned int i=0; i < _binHashSparse.second.size(); i++) {
                 _binHashSparse.second[i].first *= scaleX;
-                for(unsigned int j=0; j < _binHashSparse.second[i].second.size(); j++){
+                for (unsigned int j=0; j < _binHashSparse.second[i].second.size(); j++){
                     _binHashSparse.second[i].second[j].second.first *=scaleY;
                     _binHashSparse.second[i].second[j].second.second *=scaleY;
                 }
@@ -820,7 +820,7 @@
             _binHashSparse.second.regenCache();
 
             /// Now, as we have the map rescaled, we need to update the bins
-            for(unsigned int i=0; i < _bins.size(); i++) _bins[i].scale(scaleX, scaleY);
+            for (size_t i = 0; i < _bins.size(); ++i) _bins[i].scale(scaleX, scaleY);
             _dbn.scale(scaleX, scaleY);
             _underflow.scale(scaleX, scaleY);
             _overflow.scale(scaleX, scaleY);
@@ -829,13 +829,12 @@
             _regenDelimiters();
         }
 
-        /// Scales the heights of the bins
-        void scaleW(double scalefactor)
-        {
+        /// Scales the bin weights
+        void scaleW(double scalefactor) {
             _dbn.scaleW(scalefactor);
             _underflow.scaleW(scalefactor);
             _overflow.scaleW(scalefactor);
-            for (unsigned int i=0; i<_bins.size(); i++) _bins[i].scaleW(scalefactor);
+            for (size_t i=0; i<_bins.size(); i++) _bins[i].scaleW(scalefactor);
         }
        //@}
 
@@ -918,7 +917,7 @@
 
    };
 
-    /// Additon operator
+    /// Addition operator
     template <typename BIN>
     Axis2D<BIN> operator + (const Axis2D<BIN>& first, const Axis2D<BIN>& second)
     {
@@ -927,7 +926,7 @@
         return tmp;
     }
 
-    /// Substraciton operator
+    /// Subtraction operator
     template <typename BIN>
     Axis2D<BIN> operator - (const Axis2D<BIN>& first, const Axis2D<BIN>& second)
     {

Modified: trunk/include/YODA/Scatter2D.h
==============================================================================
--- trunk/include/YODA/Scatter2D.h	Mon Aug  8 18:47:52 2011	(r225)
+++ trunk/include/YODA/Scatter2D.h	Mon Aug  8 19:07:52 2011	(r226)
@@ -214,7 +214,7 @@
       }
       return *this;
     }
-    
+
     /// Scaling
     void scale(double scaleX, double scaleY) {
         for(unsigned int i=0; i < _points.size(); i++) _points[i].scale(scaleX, scaleY);
@@ -289,10 +289,10 @@
   //@{
 
   /// Add two scatters
-  inline Scatter2D operator + (const Scatter2D& first, const Scatter2D& second);
+  Scatter2D operator + (const Scatter2D& first, const Scatter2D& second);
 
   /// Subtract two scatters
-  inline Scatter2D operator - (const Scatter2D& first, const Scatter2D& second);
+  Scatter2D operator - (const Scatter2D& first, const Scatter2D& second);
 
   /// Divide two scatters
   Scatter2D operator / (const Scatter2D& numer, const Scatter2D& denom);

Modified: trunk/include/YODA/Scatter3D.h
==============================================================================
--- trunk/include/YODA/Scatter3D.h	Mon Aug  8 18:47:52 2011	(r225)
+++ trunk/include/YODA/Scatter3D.h	Mon Aug  8 19:07:52 2011	(r226)
@@ -92,7 +92,7 @@
     void reset() {
       _points.clear();
     }
-    
+
     /// Scale
     void scale(double scaleX, double scaleY, double scaleZ) {
         for(unsigned int i=0; i < _points.size(); i++) _points[i].scale(scaleX, scaleY, scaleZ);
@@ -150,7 +150,7 @@
       return *this;
     }
 
-    Scatter3D& addPoint(double x, double y, double z, 
+    Scatter3D& addPoint(double x, double y, double z,
                         std::pair<double,double> ex, std::pair<double,double> ey, std::pair<double,double> ez) {
       _points.insert(Point3D(x, y, z, ex, ey, ez));
       return *this;
@@ -207,10 +207,9 @@
   }
 
 
-  inline Scatter3D combine(const std::vector< Scatter3D >& scatters) {
+  inline Scatter3D combine(const std::vector<Scatter3D>& scatters) {
     Scatter3D rtn;
-    for (std::vector<Scatter3D>::const_iterator s = scatters.begin();
-         s != scatters.end(); ++s) {
+    for (std::vector<Scatter3D>::const_iterator s = scatters.begin(); s != scatters.end(); ++s) {
       rtn.combineWith(*s);
     }
     return rtn;

Modified: trunk/src/Scatter2D.cc
==============================================================================
--- trunk/src/Scatter2D.cc	Mon Aug  8 18:47:52 2011	(r225)
+++ trunk/src/Scatter2D.cc	Mon Aug  8 19:07:52 2011	(r226)
@@ -51,7 +51,7 @@
 
 
   /// Subtract two scatters
-  inline Scatter2D operator + (const Scatter2D& first, const Scatter2D& second) {
+  Scatter2D operator + (const Scatter2D& first, const Scatter2D& second) {
     Scatter2D tmp;
     for (size_t i = 0; i < first.numPoints(); ++i) {
       const Point2D& p1 = first.point(i);
@@ -71,7 +71,7 @@
 
 
   /// Subtract two scatters
-  inline Scatter2D operator - (const Scatter2D& first, const Scatter2D& second) {
+  Scatter2D operator - (const Scatter2D& first, const Scatter2D& second) {
     Scatter2D tmp;
     for (size_t i = 0; i < first.numPoints(); ++i) {
       const Point2D& p1 = first.point(i);

Modified: trunk/src/Scatter3D.cc
==============================================================================
--- trunk/src/Scatter3D.cc	Mon Aug  8 18:47:52 2011	(r225)
+++ trunk/src/Scatter3D.cc	Mon Aug  8 19:07:52 2011	(r226)
@@ -31,7 +31,7 @@
 
 
   /// Subtract two scatters
-  inline Scatter3D operator + (const Scatter3D& first, const Scatter3D& second) {
+  Scatter3D operator + (const Scatter3D& first, const Scatter3D& second) {
     /// @todo Implement
     Scatter3D tmp;
     return tmp;
@@ -39,7 +39,7 @@
 
 
   /// Subtract two scatters
-  inline Scatter3D operator - (const Scatter3D& first, const Scatter3D& second) {
+  Scatter3D operator - (const Scatter3D& first, const Scatter3D& second) {
     /// @todo Implement
     Scatter3D tmp;
     return tmp;
@@ -52,7 +52,7 @@
     for (size_t i = 0; i < numer.numPoints(); ++i) {
       const Point3D& p1 = numer.point(i);
       const Point3D& p2 = denom.point(i);
-      
+
       assert(fuzzyEquals(p1.xMin(), p2.xMin()));
       assert(fuzzyEquals(p1.xMax(), p2.xMax()));
 
@@ -65,7 +65,7 @@
       const double z = p1.z() / p2.z();
       /// @todo Generally deal with +/- errors separately
       const double ez = z * sqrt( sqr(p1.yErrAvg()/p1.z()) + sqr(p2.yErrAvg()/p2.z()) );
-      tmp.addPoint(x, p1.xErrMinus(), p1.xErrPlus(), 
+      tmp.addPoint(x, p1.xErrMinus(), p1.xErrPlus(),
                    y, p1.yErrMinus(), p1.yErrPlus(), z, ez, ez);
     }
     assert(tmp.numPoints() == numer.numPoints());


More information about the yoda-svn mailing list