Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / analysisdata / modules / frameaverager.h
index 54c8504b2e8bd8680b50e1564c651c79d5822d76..61867c24c4c084750d1c785d72413bb3675ebb3d 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 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) 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
 
 #include <vector>
 
-#include "../../legacyheaders/types/simple.h"
-
-#include "../../utility/gmxassert.h"
+#include "gromacs/utility/gmxassert.h"
+#include "gromacs/utility/real.h"
 
 namespace gmx
 {
 
 class AnalysisDataPointSetRef;
 
-/*! \internal \brief
+/*! \internal
+ * \brief
  * Helper class for modules that average values over frames.
  *
  * This class implements common functionality for analysis data modules that
@@ -77,6 +77,11 @@ class AnalysisDataFrameAverager
     public:
         AnalysisDataFrameAverager() : bFinished_(false) {}
 
+        /*! \brief
+         * Returns the number of columns in this averager.
+         */
+        int columnCount() const { return values_.size(); }
+
         /*! \brief
          * Sets the number of columns in the input data.
          *
@@ -123,7 +128,7 @@ class AnalysisDataFrameAverager
          */
         real average(int index) const
         {
-            GMX_ASSERT(index >= 0 && index <= static_cast<int>(values_.size()),
+            GMX_ASSERT(index >= 0 && index < columnCount(),
                        "Invalid column index");
             GMX_ASSERT(bFinished_,
                        "Values available only after finished() has been called");
@@ -136,7 +141,7 @@ class AnalysisDataFrameAverager
          */
         real variance(int index) const
         {
-            GMX_ASSERT(index >= 0 && index <= static_cast<int>(values_.size()),
+            GMX_ASSERT(index >= 0 && index < columnCount(),
                        "Invalid column index");
             GMX_ASSERT(bFinished_,
                        "Values available only after finished() has been called");