/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
- * David van der Spoel, Berk Hess, Erik Lindahl, and including many
- * others, as listed in the AUTHORS file in the top-level source
- * directory and at http://www.gromacs.org.
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
*
* GROMACS is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* \author Teemu Murtola <teemu.murtola@gmail.com>
* \ingroup module_analysisdata
*/
-#include "gromacs/analysisdata/modules/histogram.h"
+#include "gmxpre.h"
+
+#include "histogram.h"
#include <cmath>
namespace
{
-/*! \internal \brief
+/*! \brief
* Represents copies of average histograms.
*
* Methods in AbstractAverageHistogram that return new histogram instances
{
sum += value(i, c).value();
}
- scaleSingle(c, 1.0 / (sum * xstep()));
+ if (sum > 0.0)
+ {
+ scaleSingle(c, 1.0 / (sum * xstep()));
+ }
}
}
namespace internal
{
-/*! \internal \brief
+/*! \internal
+ * \brief
* Implements average histogram module that averages per-frame histograms.
*
* This class is used for accumulating average histograms in per-frame
* \ingroup module_analysisdata
*/
class BasicAverageHistogramModule : public AbstractAverageHistogram,
- public AnalysisDataModuleInterface
+ public AnalysisDataModuleSerial
{
public:
BasicAverageHistogramModule();
}
-void
-AnalysisDataSimpleHistogramModule::dataStarted(AbstractAnalysisData *data)
+bool
+AnalysisDataSimpleHistogramModule::parallelDataStarted(
+ AbstractAnalysisData *data,
+ const AnalysisDataParallelOptions &options)
{
addModule(impl_->averager_);
setDataSetCount(data->dataSetCount());
{
setColumnCount(i, settings().binCount());
}
- impl_->storage_.startDataStorage(this, &moduleManager());
+ impl_->storage_.startParallelDataStorage(this, &moduleManager(), options);
+ return true;
}
}
-void
-AnalysisDataWeightedHistogramModule::dataStarted(AbstractAnalysisData *data)
+bool
+AnalysisDataWeightedHistogramModule::parallelDataStarted(
+ AbstractAnalysisData *data,
+ const AnalysisDataParallelOptions &options)
{
addModule(impl_->averager_);
setDataSetCount(data->dataSetCount());
{
setColumnCount(i, settings().binCount());
}
- impl_->storage_.startDataStorage(this, &moduleManager());
+ impl_->storage_.startParallelDataStorage(this, &moduleManager(), options);
+ return true;
}