Apply clang-format to source tree
[alexxy/gromacs.git] / src / gromacs / analysisdata / modules / histogram.h
index 4875b8926ae3e0d672e1c34f7ab63152d8defb2c..7a2f8c5ec92fe486969a7cbe9a5949a6f5078cf4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2018,2019, 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.
@@ -67,97 +67,119 @@ class AnalysisHistogramSettings;
  */
 class AnalysisHistogramSettingsInitializer
 {
-    public:
-        /*! \brief
-         * Creates an empty initializer.
-         *
-         * Should not be called directly, but histogramFromRange() or
-         * histogramFromBins() should be used instead.
-         */
-        AnalysisHistogramSettingsInitializer();
-
-        /*! \brief
-         * Sets the first bin location.
-         *
-         * Typically should not be called directly, but through
-         * histogramFromBins().
-         */
-        AnalysisHistogramSettingsInitializer &start(real min)
-        { min_ = min; return *this; }
-        /*! \brief
-         * Sets the number of bins in the histogram.
-         *
-         * If only the first bin location is specified, this value is required
-         * (and automatically provided if histogramFromBins() is used).
-         * If both the first and last bins are specified, either this value or
-         * binWidth() is required.
-         */
-        AnalysisHistogramSettingsInitializer &binCount(int binCount)
-        { binCount_ = binCount; return *this; }
-        /*! \brief
-         * Sets the first and last bin locations.
-         *
-         * Typically should not be called directly, but through
-         * histogramFromRange().
-         */
-        AnalysisHistogramSettingsInitializer &range(real min, real max)
-        { min_ = min; max_ = max; return *this; }
-        /*! \brief
-         * Sets the bin width of the histogram.
-         *
-         * If only the first bin location is specified, this value is required
-         * (and automatically provided if histogramFromBins() is used).
-         * If both the first and last bins are specified, either this value or
-         * binCount() is required.
-         * If a bin width is provided with both first and last bin locations,
-         * and the given bin width does not divide the range exactly, the last
-         * bin location is adjusted to match.
-         */
-        AnalysisHistogramSettingsInitializer &binWidth(real binWidth)
-        { binWidth_ = binWidth; return *this; }
-        /*! \brief
-         * Indicate that first and last bin locations to specify bin centers.
-         *
-         * If set, the first and last bin locations are interpreted as bin
-         * centers.
-         * If not set (the default), the first and last bin locations are
-         * interpreted as the edges of the whole histogram.
-         *
-         * Cannot be specified together with roundRange().
-         */
-        AnalysisHistogramSettingsInitializer &integerBins(bool enabled = true)
-        { bIntegerBins_ = enabled; return *this; }
-        /*! \brief
-         * Round first and last bin locations.
-         *
-         * If set, the resulting histogram will cover the range specified, but
-         * the actual bin locations will be rounded such that the edges fall
-         * on multiples of the bin width.
-         * Only implemented when both first and last bin location and bin width
-         * are defined.
-         * Cannot be specified together with integerBins() or with binCount().
-         */
-        AnalysisHistogramSettingsInitializer &roundRange(bool enabled = true)
-        { bRoundRange_ = enabled; return *this; }
-        /*! \brief
-         * Sets the histogram to match all values.
-         *
-         * If set, the histogram behaves as if the bins at the ends extended to
-         * +-infinity.
-         */
-        AnalysisHistogramSettingsInitializer &includeAll(bool enabled = true)
-        { bIncludeAll_ = enabled; return *this; }
-
-    private:
-        real                    min_;
-        real                    max_;
-        real                    binWidth_;
-        int                     binCount_;
-        bool                    bIntegerBins_;
-        bool                    bRoundRange_;
-        bool                    bIncludeAll_;
-
-        friend class AnalysisHistogramSettings;
+public:
+    /*! \brief
+     * Creates an empty initializer.
+     *
+     * Should not be called directly, but histogramFromRange() or
+     * histogramFromBins() should be used instead.
+     */
+    AnalysisHistogramSettingsInitializer();
+
+    /*! \brief
+     * Sets the first bin location.
+     *
+     * Typically should not be called directly, but through
+     * histogramFromBins().
+     */
+    AnalysisHistogramSettingsInitializer& start(real min)
+    {
+        min_ = min;
+        return *this;
+    }
+    /*! \brief
+     * Sets the number of bins in the histogram.
+     *
+     * If only the first bin location is specified, this value is required
+     * (and automatically provided if histogramFromBins() is used).
+     * If both the first and last bins are specified, either this value or
+     * binWidth() is required.
+     */
+    AnalysisHistogramSettingsInitializer& binCount(int binCount)
+    {
+        binCount_ = binCount;
+        return *this;
+    }
+    /*! \brief
+     * Sets the first and last bin locations.
+     *
+     * Typically should not be called directly, but through
+     * histogramFromRange().
+     */
+    AnalysisHistogramSettingsInitializer& range(real min, real max)
+    {
+        min_ = min;
+        max_ = max;
+        return *this;
+    }
+    /*! \brief
+     * Sets the bin width of the histogram.
+     *
+     * If only the first bin location is specified, this value is required
+     * (and automatically provided if histogramFromBins() is used).
+     * If both the first and last bins are specified, either this value or
+     * binCount() is required.
+     * If a bin width is provided with both first and last bin locations,
+     * and the given bin width does not divide the range exactly, the last
+     * bin location is adjusted to match.
+     */
+    AnalysisHistogramSettingsInitializer& binWidth(real binWidth)
+    {
+        binWidth_ = binWidth;
+        return *this;
+    }
+    /*! \brief
+     * Indicate that first and last bin locations to specify bin centers.
+     *
+     * If set, the first and last bin locations are interpreted as bin
+     * centers.
+     * If not set (the default), the first and last bin locations are
+     * interpreted as the edges of the whole histogram.
+     *
+     * Cannot be specified together with roundRange().
+     */
+    AnalysisHistogramSettingsInitializer& integerBins(bool enabled = true)
+    {
+        bIntegerBins_ = enabled;
+        return *this;
+    }
+    /*! \brief
+     * Round first and last bin locations.
+     *
+     * If set, the resulting histogram will cover the range specified, but
+     * the actual bin locations will be rounded such that the edges fall
+     * on multiples of the bin width.
+     * Only implemented when both first and last bin location and bin width
+     * are defined.
+     * Cannot be specified together with integerBins() or with binCount().
+     */
+    AnalysisHistogramSettingsInitializer& roundRange(bool enabled = true)
+    {
+        bRoundRange_ = enabled;
+        return *this;
+    }
+    /*! \brief
+     * Sets the histogram to match all values.
+     *
+     * If set, the histogram behaves as if the bins at the ends extended to
+     * +-infinity.
+     */
+    AnalysisHistogramSettingsInitializer& includeAll(bool enabled = true)
+    {
+        bIncludeAll_ = enabled;
+        return *this;
+    }
+
+private:
+    real min_;
+    real max_;
+    real binWidth_;
+    int  binCount_;
+    bool bIntegerBins_;
+    bool bRoundRange_;
+    bool bIncludeAll_;
+
+    friend class AnalysisHistogramSettings;
 };
 
 /*! \brief
@@ -167,8 +189,7 @@ class AnalysisHistogramSettingsInitializer
  *
  * \inpublicapi
  */
-inline AnalysisHistogramSettingsInitializer
-histogramFromRange(real min, real max)
+inline AnalysisHistogramSettingsInitializer histogramFromRange(real min, real max)
 {
     return AnalysisHistogramSettingsInitializer().range(min, max);
 }
@@ -180,11 +201,9 @@ histogramFromRange(real min, real max)
  *
  * \inpublicapi
  */
-inline AnalysisHistogramSettingsInitializer
-histogramFromBins(real start, int nbins, real binwidth)
+inline AnalysisHistogramSettingsInitializer histogramFromBins(real start, int nbins, real binwidth)
 {
-    return AnalysisHistogramSettingsInitializer()
-               .start(start).binCount(nbins).binWidth(binwidth);
+    return AnalysisHistogramSettingsInitializer().start(start).binCount(nbins).binWidth(binwidth);
 }
 
 
@@ -198,42 +217,42 @@ histogramFromBins(real start, int nbins, real binwidth)
  */
 class AnalysisHistogramSettings
 {
-    public:
-        //! Initializes undefined parameters.
-        AnalysisHistogramSettings();
-        /*! \brief
-         * Initializes parameters based on a named parameter object.
-         *
-         * This constructor is not explicit to allow initialization of
-         * histograms directly from AnalysisHistogramSettingsInitializer:
-         * \code
-           gmx::AnalysisDataSimpleHistogramModule *hist =
-                   new gmx::AnalysisDataSimpleHistogramModule(
-                           histogramFromRange(0.0, 5.0).binWidth(0.5));
-         * \endcode
-         */
-        AnalysisHistogramSettings(const AnalysisHistogramSettingsInitializer &settings);
-
-        //! Returns the left edge of the first bin.
-        real firstEdge() const { return firstEdge_; }
-        //! Returns the right edge of the first bin.
-        real lastEdge() const { return lastEdge_; }
-        //! Returns the number of bins in the histogram.
-        int binCount() const { return binCount_; }
-        //! Returns the width of a bin in the histogram.
-        real binWidth() const { return binWidth_; }
-        //! Whether values beyond the edges are mapped to the edge bins.
-        bool includeAll() const { return bAll_; }
-        //! Returns a zero-based bin index for a value, or -1 if not in range.
-        int findBin(real y) const;
-
-    private:
-        real                    firstEdge_;
-        real                    lastEdge_;
-        real                    binWidth_;
-        real                    inverseBinWidth_;
-        int                     binCount_;
-        bool                    bAll_;
+public:
+    //! Initializes undefined parameters.
+    AnalysisHistogramSettings();
+    /*! \brief
+     * Initializes parameters based on a named parameter object.
+     *
+     * This constructor is not explicit to allow initialization of
+     * histograms directly from AnalysisHistogramSettingsInitializer:
+     * \code
+       gmx::AnalysisDataSimpleHistogramModule *hist =
+               new gmx::AnalysisDataSimpleHistogramModule(
+                       histogramFromRange(0.0, 5.0).binWidth(0.5));
+     * \endcode
+     */
+    AnalysisHistogramSettings(const AnalysisHistogramSettingsInitializer& settings);
+
+    //! Returns the left edge of the first bin.
+    real firstEdge() const { return firstEdge_; }
+    //! Returns the right edge of the first bin.
+    real lastEdge() const { return lastEdge_; }
+    //! Returns the number of bins in the histogram.
+    int binCount() const { return binCount_; }
+    //! Returns the width of a bin in the histogram.
+    real binWidth() const { return binWidth_; }
+    //! Whether values beyond the edges are mapped to the edge bins.
+    bool includeAll() const { return bAll_; }
+    //! Returns a zero-based bin index for a value, or -1 if not in range.
+    int findBin(real y) const;
+
+private:
+    real firstEdge_;
+    real lastEdge_;
+    real binWidth_;
+    real inverseBinWidth_;
+    int  binCount_;
+    bool bAll_;
 };
 
 
@@ -262,79 +281,79 @@ typedef std::unique_ptr<AbstractAverageHistogram> AverageHistogramPointer;
  */
 class AbstractAverageHistogram : public AbstractAnalysisArrayData
 {
-    public:
-        ~AbstractAverageHistogram() override;
-
-        //! Returns bin properties for the histogram.
-        const AnalysisHistogramSettings &settings() const { return settings_; }
-
-        /*! \brief
-         * Creates a copy of the histogram with double the bin width.
-         *
-         * \param[in] bIntegerBins If `true`, the first bin in the result will
-         *     cover the first bin from the source. Otherwise, the first bin
-         *     will cover first two bins from the source.
-         * \throws std::bad_alloc if out of memory.
-         *
-         * The caller is responsible of deleting the returned object.
-         */
-        AverageHistogramPointer resampleDoubleBinWidth(bool bIntegerBins) const;
-        /*! \brief
-         * Creates a deep copy of the histogram.
-         *
-         * \throws std::bad_alloc if out of memory.
-         *
-         * The returned histogram is not necessarily of the same dynamic type
-         * as the original object, but contains the same data from the point of
-         * view of the AbstractAverageHistogram interface.
-         *
-         * The caller is responsible of deleting the returned object.
-         */
-        AverageHistogramPointer clone() const;
-        //! Normalizes the histogram such that the integral over it is one.
-        void normalizeProbability();
-        /*! \brief
-         * Makes the histograms cumulative by summing up each bin to all bins
-         * after it.
-         *
-         * The X values in the data are adjusted such that they match the right
-         * edges of bins instead of bin centers.
-         */
-        void makeCumulative();
-        //! Scales a single histogram by a uniform scaling factor.
-        void scaleSingle(int index, real factor);
-        //! Scales all histograms by a uniform scaling factor.
-        void scaleAll(real factor);
-        //! Scales the value of each bin by a different scaling factor.
-        void scaleAllByVector(const real factor[]);
-        /*! \brief
-         * Notifies attached modules of the histogram data.
-         *
-         * After this function has been called, it is no longer possible to
-         * alter the histogram.
-         */
-        void done() { AbstractAnalysisArrayData::valuesReady(); }
-
-    protected:
-        /*! \brief
-         * Creates a histogram module with undefined bins.
-         *
-         * Bin parameters must be defined with init() before data input is
-         * started.
-         */
-        AbstractAverageHistogram();
-        //! Creates a histogram module with defined bin parameters.
-        explicit AbstractAverageHistogram(const AnalysisHistogramSettings &settings);
-
-        /*! \brief
-         * (Re)initializes the histogram from settings.
-         */
-        void init(const AnalysisHistogramSettings &settings);
-
-    private:
-        AnalysisHistogramSettings  settings_;
-
-        // Copy and assign disallowed by base.
+public:
+    ~AbstractAverageHistogram() override;
+
+    //! Returns bin properties for the histogram.
+    const AnalysisHistogramSettings& settings() const { return settings_; }
+
+    /*! \brief
+     * Creates a copy of the histogram with double the bin width.
+     *
+     * \param[in] bIntegerBins If `true`, the first bin in the result will
+     *     cover the first bin from the source. Otherwise, the first bin
+     *     will cover first two bins from the source.
+     * \throws std::bad_alloc if out of memory.
+     *
+     * The caller is responsible of deleting the returned object.
+     */
+    AverageHistogramPointer resampleDoubleBinWidth(bool bIntegerBins) const;
+    /*! \brief
+     * Creates a deep copy of the histogram.
+     *
+     * \throws std::bad_alloc if out of memory.
+     *
+     * The returned histogram is not necessarily of the same dynamic type
+     * as the original object, but contains the same data from the point of
+     * view of the AbstractAverageHistogram interface.
+     *
+     * The caller is responsible of deleting the returned object.
+     */
+    AverageHistogramPointer clone() const;
+    //! Normalizes the histogram such that the integral over it is one.
+    void normalizeProbability();
+    /*! \brief
+     * Makes the histograms cumulative by summing up each bin to all bins
+     * after it.
+     *
+     * The X values in the data are adjusted such that they match the right
+     * edges of bins instead of bin centers.
+     */
+    void makeCumulative();
+    //! Scales a single histogram by a uniform scaling factor.
+    void scaleSingle(int index, real factor);
+    //! Scales all histograms by a uniform scaling factor.
+    void scaleAll(real factor);
+    //! Scales the value of each bin by a different scaling factor.
+    void scaleAllByVector(const real factor[]);
+    /*! \brief
+     * Notifies attached modules of the histogram data.
+     *
+     * After this function has been called, it is no longer possible to
+     * alter the histogram.
+     */
+    void done() { AbstractAnalysisArrayData::valuesReady(); }
+
+protected:
+    /*! \brief
+     * Creates a histogram module with undefined bins.
+     *
+     * Bin parameters must be defined with init() before data input is
+     * started.
+     */
+    AbstractAverageHistogram();
+    //! Creates a histogram module with defined bin parameters.
+    explicit AbstractAverageHistogram(const AnalysisHistogramSettings& settings);
+
+    /*! \brief
+     * (Re)initializes the histogram from settings.
+     */
+    void init(const AnalysisHistogramSettings& settings);
+
+private:
+    AnalysisHistogramSettings settings_;
+
+    // Copy and assign disallowed by base.
 };
 
 
@@ -356,61 +375,58 @@ class AbstractAverageHistogram : public AbstractAnalysisArrayData
  * \inpublicapi
  * \ingroup module_analysisdata
  */
-class AnalysisDataSimpleHistogramModule : public AbstractAnalysisData,
-                                          public AnalysisDataModuleParallel
+class AnalysisDataSimpleHistogramModule : public AbstractAnalysisData, public AnalysisDataModuleParallel
 {
-    public:
-        /*! \brief
-         * Creates a histogram module with undefined bins.
-         *
-         * Bin parameters must be defined with init() before data input is
-         * started.
-         */
-        AnalysisDataSimpleHistogramModule();
-        //! Creates a histogram module with defined bin parameters.
-        explicit AnalysisDataSimpleHistogramModule(const AnalysisHistogramSettings &settings);
-        ~AnalysisDataSimpleHistogramModule() override;
-
-        /*! \brief
-         * (Re)initializes the histogram from settings.
-         */
-        void init(const AnalysisHistogramSettings &settings);
-
-        /*! \brief
-         * Returns the average histogram over all frames.
-         *
-         * Can be called already before the histogram is calculated to
-         * customize the way the average histogram is calculated.
-         *
-         * \see AbstractAverageHistogram
-         */
-        AbstractAverageHistogram &averager();
-
-        //! Returns bin properties for the histogram.
-        const AnalysisHistogramSettings &settings() const;
-
-        int frameCount() const override;
-
-        int flags() const override;
-
-        bool parallelDataStarted(
-            AbstractAnalysisData              *data,
-            const AnalysisDataParallelOptions &options) override;
-        void frameStarted(const AnalysisDataFrameHeader &header) override;
-        void pointsAdded(const AnalysisDataPointSetRef &points) override;
-        void frameFinished(const AnalysisDataFrameHeader &header) override;
-        void frameFinishedSerial(int frameIndex) override;
-        void dataFinished() override;
-
-    private:
-        AnalysisDataFrameRef tryGetDataFrameInternal(int index) const override;
-        bool requestStorageInternal(int nframes) override;
-
-        class Impl;
-
-        PrivateImplPointer<Impl> impl_;
-
-        // Copy and assign disallowed by base.
+public:
+    /*! \brief
+     * Creates a histogram module with undefined bins.
+     *
+     * Bin parameters must be defined with init() before data input is
+     * started.
+     */
+    AnalysisDataSimpleHistogramModule();
+    //! Creates a histogram module with defined bin parameters.
+    explicit AnalysisDataSimpleHistogramModule(const AnalysisHistogramSettings& settings);
+    ~AnalysisDataSimpleHistogramModule() override;
+
+    /*! \brief
+     * (Re)initializes the histogram from settings.
+     */
+    void init(const AnalysisHistogramSettings& settings);
+
+    /*! \brief
+     * Returns the average histogram over all frames.
+     *
+     * Can be called already before the histogram is calculated to
+     * customize the way the average histogram is calculated.
+     *
+     * \see AbstractAverageHistogram
+     */
+    AbstractAverageHistogram& averager();
+
+    //! Returns bin properties for the histogram.
+    const AnalysisHistogramSettings& settings() const;
+
+    int frameCount() const override;
+
+    int flags() const override;
+
+    bool parallelDataStarted(AbstractAnalysisData* data, const AnalysisDataParallelOptions& options) override;
+    void frameStarted(const AnalysisDataFrameHeader& header) override;
+    void pointsAdded(const AnalysisDataPointSetRef& points) override;
+    void frameFinished(const AnalysisDataFrameHeader& header) override;
+    void frameFinishedSerial(int frameIndex) override;
+    void dataFinished() override;
+
+private:
+    AnalysisDataFrameRef tryGetDataFrameInternal(int index) const override;
+    bool                 requestStorageInternal(int nframes) override;
+
+    class Impl;
+
+    PrivateImplPointer<Impl> impl_;
+
+    // Copy and assign disallowed by base.
 };
 
 
@@ -435,47 +451,44 @@ class AnalysisDataSimpleHistogramModule : public AbstractAnalysisData,
  * \inpublicapi
  * \ingroup module_analysisdata
  */
-class AnalysisDataWeightedHistogramModule : public AbstractAnalysisData,
-                                            public AnalysisDataModuleParallel
+class AnalysisDataWeightedHistogramModule : public AbstractAnalysisData, public AnalysisDataModuleParallel
 {
-    public:
-        //! \copydoc AnalysisDataSimpleHistogramModule::AnalysisDataSimpleHistogramModule()
-        AnalysisDataWeightedHistogramModule();
-        //! \copydoc AnalysisDataSimpleHistogramModule::AnalysisDataSimpleHistogramModule(const AnalysisHistogramSettings &)
-        explicit AnalysisDataWeightedHistogramModule(const AnalysisHistogramSettings &settings);
-        ~AnalysisDataWeightedHistogramModule() override;
+public:
+    //! \copydoc AnalysisDataSimpleHistogramModule::AnalysisDataSimpleHistogramModule()
+    AnalysisDataWeightedHistogramModule();
+    //! \copydoc AnalysisDataSimpleHistogramModule::AnalysisDataSimpleHistogramModule(const AnalysisHistogramSettings &)
+    explicit AnalysisDataWeightedHistogramModule(const AnalysisHistogramSettings& settings);
+    ~AnalysisDataWeightedHistogramModule() override;
 
-        //! \copydoc AnalysisDataSimpleHistogramModule::init()
-        void init(const AnalysisHistogramSettings &settings);
+    //! \copydoc AnalysisDataSimpleHistogramModule::init()
+    void init(const AnalysisHistogramSettings& settings);
 
-        //! \copydoc AnalysisDataSimpleHistogramModule::averager()
-        AbstractAverageHistogram &averager();
+    //! \copydoc AnalysisDataSimpleHistogramModule::averager()
+    AbstractAverageHistogram& averager();
 
-        //! \copydoc AnalysisDataSimpleHistogramModule::settings()
-        const AnalysisHistogramSettings &settings() const;
+    //! \copydoc AnalysisDataSimpleHistogramModule::settings()
+    const AnalysisHistogramSettings& settings() const;
 
-        int frameCount() const override;
+    int frameCount() const override;
 
-        int flags() const override;
+    int flags() const override;
 
-        bool parallelDataStarted(
-            AbstractAnalysisData              *data,
-            const AnalysisDataParallelOptions &options) override;
-        void frameStarted(const AnalysisDataFrameHeader &header) override;
-        void pointsAdded(const AnalysisDataPointSetRef &points) override;
-        void frameFinished(const AnalysisDataFrameHeader &header) override;
-        void frameFinishedSerial(int frameIndex) override;
-        void dataFinished() override;
+    bool parallelDataStarted(AbstractAnalysisData* data, const AnalysisDataParallelOptions& options) override;
+    void frameStarted(const AnalysisDataFrameHeader& header) override;
+    void pointsAdded(const AnalysisDataPointSetRef& points) override;
+    void frameFinished(const AnalysisDataFrameHeader& header) override;
+    void frameFinishedSerial(int frameIndex) override;
+    void dataFinished() override;
 
-    private:
-        AnalysisDataFrameRef tryGetDataFrameInternal(int index) const override;
-        bool requestStorageInternal(int nframes) override;
+private:
+    AnalysisDataFrameRef tryGetDataFrameInternal(int index) const override;
+    bool                 requestStorageInternal(int nframes) override;
 
-        class Impl;
+    class Impl;
 
-        PrivateImplPointer<Impl> impl_;
+    PrivateImplPointer<Impl> impl_;
 
-        // Copy and assign disallowed by base.
+    // Copy and assign disallowed by base.
 };
 
 
@@ -495,47 +508,43 @@ class AnalysisDataWeightedHistogramModule : public AbstractAnalysisData,
  * \inpublicapi
  * \ingroup module_analysisdata
  */
-class AnalysisDataBinAverageModule : public AbstractAnalysisArrayData,
-                                     public AnalysisDataModuleSerial
+class AnalysisDataBinAverageModule : public AbstractAnalysisArrayData, public AnalysisDataModuleSerial
 {
-    public:
-        //! \copydoc AnalysisDataSimpleHistogramModule::AnalysisDataSimpleHistogramModule()
-        AnalysisDataBinAverageModule();
-        //! \copydoc AnalysisDataSimpleHistogramModule::AnalysisDataSimpleHistogramModule(const AnalysisHistogramSettings &)
-        explicit AnalysisDataBinAverageModule(const AnalysisHistogramSettings &settings);
-        ~AnalysisDataBinAverageModule() override;
+public:
+    //! \copydoc AnalysisDataSimpleHistogramModule::AnalysisDataSimpleHistogramModule()
+    AnalysisDataBinAverageModule();
+    //! \copydoc AnalysisDataSimpleHistogramModule::AnalysisDataSimpleHistogramModule(const AnalysisHistogramSettings &)
+    explicit AnalysisDataBinAverageModule(const AnalysisHistogramSettings& settings);
+    ~AnalysisDataBinAverageModule() override;
 
-        //! \copydoc AnalysisDataSimpleHistogramModule::init()
-        void init(const AnalysisHistogramSettings &settings);
+    //! \copydoc AnalysisDataSimpleHistogramModule::init()
+    void init(const AnalysisHistogramSettings& settings);
 
-        //! \copydoc AnalysisDataSimpleHistogramModule::settings()
-        const AnalysisHistogramSettings &settings() const;
+    //! \copydoc AnalysisDataSimpleHistogramModule::settings()
+    const AnalysisHistogramSettings& settings() const;
 
-        int flags() const override;
+    int flags() const override;
 
-        void dataStarted(AbstractAnalysisData *data) override;
-        void frameStarted(const AnalysisDataFrameHeader &header) override;
-        void pointsAdded(const AnalysisDataPointSetRef &points) override;
-        void frameFinished(const AnalysisDataFrameHeader &header) override;
-        void dataFinished() override;
+    void dataStarted(AbstractAnalysisData* data) override;
+    void frameStarted(const AnalysisDataFrameHeader& header) override;
+    void pointsAdded(const AnalysisDataPointSetRef& points) override;
+    void frameFinished(const AnalysisDataFrameHeader& header) override;
+    void dataFinished() override;
 
-    private:
-        class Impl;
+private:
+    class Impl;
 
-        PrivateImplPointer<Impl>   impl_;
+    PrivateImplPointer<Impl> impl_;
 
-        // Copy and assign disallowed by base.
+    // Copy and assign disallowed by base.
 };
 
 //! Smart pointer to manage an AnalysisDataSimpleHistogramModule object.
-typedef std::shared_ptr<AnalysisDataSimpleHistogramModule>
-    AnalysisDataSimpleHistogramModulePointer;
+typedef std::shared_ptr<AnalysisDataSimpleHistogramModule> AnalysisDataSimpleHistogramModulePointer;
 //! Smart pointer to manage an AnalysisDataWeightedHistogramModule object.
-typedef std::shared_ptr<AnalysisDataWeightedHistogramModule>
-    AnalysisDataWeightedHistogramModulePointer;
+typedef std::shared_ptr<AnalysisDataWeightedHistogramModule> AnalysisDataWeightedHistogramModulePointer;
 //! Smart pointer to manage an AnalysisDataBinAverageModule object.
-typedef std::shared_ptr<AnalysisDataBinAverageModule>
-    AnalysisDataBinAverageModulePointer;
+typedef std::shared_ptr<AnalysisDataBinAverageModule> AnalysisDataBinAverageModulePointer;
 
 } // namespace gmx