Apply clang-format to source tree
[alexxy/gromacs.git] / src / gromacs / math / exponentialmovingaverage.h
index f2c705d947ad40f16fafa70f13e1666078a57aad..27a664b3c0a9025bc113ca64be01e6a0dc82f035 100644 (file)
@@ -64,11 +64,11 @@ struct ExponentialMovingAverageState
 };
 
 //! Convert the exponential moving average state as key-value-tree object
-void exponentialMovingAverageStateAsKeyValueTree(KeyValueTreeObjectBuilder builder, const ExponentialMovingAverageState &state);
+void exponentialMovingAverageStateAsKeyValueTree(KeyValueTreeObjectBuilder            builder,
+                                                 const ExponentialMovingAverageState& state);
 
 //! Sets the expoential moving average state from a key-value-tree object
-ExponentialMovingAverageState
-exponentialMovingAverageStateFromKeyValueTree(const KeyValueTreeObject &object);
+ExponentialMovingAverageState exponentialMovingAverageStateFromKeyValueTree(const KeyValueTreeObject& object);
 
 /*! \libinternal
  * \brief Evaluate the exponential moving average with bias correction.
@@ -84,38 +84,36 @@ exponentialMovingAverageStateFromKeyValueTree(const KeyValueTreeObject &object);
  */
 class ExponentialMovingAverage
 {
-    public:
-        /*! \brief Construct by setting the time constant and state.
-         * Allows reinitiating with data from memory.
-         * \param[in] timeConstant time in number of data points
-         * \param[in] state of the exponential moving average
-         * \throws InconsistentInputError if timeConstant < 1
-         */
-        ExponentialMovingAverage(real                                 timeConstant,
-                                 const ExponentialMovingAverageState &state = {}
-                                 );
-
-        //! Update the moving average with a data point
-        void updateWithDataPoint(real dataPoint);
-
-        //! The exponential weighted average with bias correction
-        real biasCorrectedAverage() const;
-
-        //! Returns true if last added data point increased the average
-        bool increasing() const;
-
-        //! Return the current state of the exponential moving average
-        const ExponentialMovingAverageState &state() const;
-
-        //! The inverse time constant for the exponential moving average
-        real inverseTimeConstant() const;
-    private:
-
-        //! The current state of the exponential moving average
-        ExponentialMovingAverageState state_;
-
-        //! The inverse time constant for the exponential moving average
-        real inverseTimeConstant_;
+public:
+    /*! \brief Construct by setting the time constant and state.
+     * Allows reinitiating with data from memory.
+     * \param[in] timeConstant time in number of data points
+     * \param[in] state of the exponential moving average
+     * \throws InconsistentInputError if timeConstant < 1
+     */
+    ExponentialMovingAverage(real timeConstant, const ExponentialMovingAverageState& state = {});
+
+    //! Update the moving average with a data point
+    void updateWithDataPoint(real dataPoint);
+
+    //! The exponential weighted average with bias correction
+    real biasCorrectedAverage() const;
+
+    //! Returns true if last added data point increased the average
+    bool increasing() const;
+
+    //! Return the current state of the exponential moving average
+    const ExponentialMovingAverageState& state() const;
+
+    //! The inverse time constant for the exponential moving average
+    real inverseTimeConstant() const;
+
+private:
+    //! The current state of the exponential moving average
+    ExponentialMovingAverageState state_;
+
+    //! The inverse time constant for the exponential moving average
+    real inverseTimeConstant_;
 };
 
 } // namespace gmx