/*
* 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
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.
*
*/
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");
*/
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");