//! Defaults for energy comparisons
static EnergyTermsToCompare defaultEnergyTermsToCompare();
//! Constructor
- EnergyComparison(const EnergyTermsToCompare& energyTermsToCompare, FramesToCompare framesToCompare);
+ EnergyComparison(const EnergyTermsToCompare& energyTermsToCompare, MaxNumFrames maxNumFrames);
/*! \brief Return the names of energies that will be compared
*
* This function can be used to provide an input for
private:
//! Energy terms to match with given tolerances.
EnergyTermsToCompare energyTermsToCompare_;
- //! Which frames should be compared.
- FramesToCompare framesToCompare_ = FramesToCompare::AllFrames;
- /*! \brief Whether the first frame has been compared yet
+ //! How many frames should be compared.
+ MaxNumFrames maxNumFrames_ = MaxNumFrames::compareAllFrames();
+ /*! \brief The number of frames that have been compared until now
*
* This field is mutable because the need to update the flag
- * after the first frame is merely an implementation detail,
+ * when checking frames is merely an implementation detail,
* rather than a proper change of internal state triggered
* by the caller. */
- mutable bool firstFrameHasBeenCompared_ = false;
+ mutable unsigned int numComparedFrames_ = 0;
};
/*! \brief Check a subset of the energies found in an energy file
* \param[in] energyFilename The name of an energy file.
* \param[in] energyTermsToCompare Set of energies to match at given tolerances.
* \param[in] checker Root checker for reference data.
+ * \param[in] maxNumEnergyFrames The maximum number of frames to check
*
* \todo This is quite similar to the functionality used in PmeTest,
* and we should consider reducing the duplication.
*/
+void checkEnergiesAgainstReferenceData(const std::string& energyFilename,
+ const EnergyTermsToCompare& energyTermsToCompare,
+ TestReferenceChecker* checker,
+ MaxNumFrames maxNumEnergyFrames);
+
+/*!
+ * \brief Check a subset of the energies found in an energy file
+ * against reference data.
+ *
+ * Convenience overload using all frames
+ *
+ * \see checkEnergiesAgainstReferenceData(const std::string&, const EnergyTermsToCompare&, TestReferenceChecker*, MaxNumFrames)
+ */
void checkEnergiesAgainstReferenceData(const std::string& energyFilename,
const EnergyTermsToCompare& energyTermsToCompare,
TestReferenceChecker* checker);