From b73a6b8648538b80872f040ba2b3d1a7fd82b003 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (home)" <j.wuttke@fz-juelich.de>
Date: Fri, 1 Nov 2013 23:59:43 +0100
Subject: [PATCH] AM_MAINTAINER_MODE([disable]) # work around rebuild rules

---
 pub/configure.ac  |  1 +
 pub/src/manip.cpp | 35 +++++++++++++++++------------------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/pub/configure.ac b/pub/configure.ac
index f0036231..b265a1da 100644
--- a/pub/configure.ac
+++ b/pub/configure.ac
@@ -17,6 +17,7 @@ AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_MACRO_DIR([m4])
 
 AM_INIT_AUTOMAKE([foreign]) # don't insert GNU blala files
+AM_MAINTAINER_MODE([disable]) # work around rebuild rules
 
 ################################################################################
 ##  Select compiler and preprocessors                                         ##
diff --git a/pub/src/manip.cpp b/pub/src/manip.cpp
index 8992a739..582538de 100644
--- a/pub/src/manip.cpp
+++ b/pub/src/manip.cpp
@@ -1164,33 +1164,33 @@ void NManip::Interpolate()
 //*  Histogramming                                                           *//
 //****************************************************************************//
 
-//! Create and fill histograms based on y values.
+//! Create and fill histograms based on x values and their y weights.
 
 void NManip::HistoMake()
 {
     // Determine range:
-    double ymin=0, ymax=0; // initialized to prevent warning
+    double xmin=0, xmax=0; // initialized to prevent warning
     int npts = 0;
     NOlm::IterateD fiter;
     while ( POld fin = fiter() ) {
         for ( int j=0; j<fin->nJ(); j++ ) {
             PSpec sin = fin ->VS(j);
             for ( int i=0; i<sin->size(); i++ ) {
-                double y = sin->y[i];
+                double x = sin->x[i];
                 if ( !npts ) {
-                    ymin = y;
-                    ymax = y;
-                } else if ( y<ymin ) {
-                    ymin = y;
-                } else if ( y>ymax ) {
-                    ymax = y;
+                    xmin = x;
+                    xmax = x;
+                } else if ( x<xmin ) {
+                    xmin = x;
+                } else if ( x>xmax ) {
+                    xmax = x;
                 }
                 ++npts;
             }
         }
     }
-    cout << "there are " << npts << " points extending from " << ymin <<
-        " to " << ymax << "\n";
+    cout << "there are " << npts << " points extending from " << xmin <<
+        " to " << xmax << "\n";
 
     // Obtain number of bins:
     static int nbin = 32;
@@ -1202,9 +1202,9 @@ void NManip::HistoMake()
 
     // Set output grid:
     vector<double> xout(nbin);
-    double dx = (ymax-ymin)/(nbin-1);
+    double dx = (xmax-xmin)/(nbin-1);
     for ( int i=0; i<nbin; ++i )
-        xout[i] = ymin + dx*i;
+        xout[i] = xmin + dx*i;
 
     // Create and fill output histograms:
     fiter.reset();
@@ -1218,12 +1218,11 @@ void NManip::HistoMake()
             sout->copy_z_base( sin );
             sout->x = xout;
             sout->y = vector<double>(nbin, 0.);
-            const vector<double>& y = sin->y;
-            for ( int i=0; i<y.size(); ++i ) {
-                int iout = lrint( floor((y[i]-ymin)/dx+0.5 ) );
+            for ( int i=0; i<sin->size(); ++i ) {
+                int iout = lrint( floor((sin->x[i]-xmin)/dx+0.5 ) );
                 if ( iout<0 || iout>=nbin )
-                    throw "BUG: invalid iout="+S(iout)+" for y="+S(y[i]);
-                sout->y[iout] += 1;
+                    throw "BUG: invalid iout="+S(iout)+" for y="+S(sin->x[i]);
+                sout->y[iout] += sin->y[i];
             }
             fout->V.push_back(sout);
         }
-- 
GitLab