Remove PrivateImplPointer in favour of std::unique_ptr
[alexxy/gromacs.git] / src / gromacs / correlationfunctions / tests / correlationdataset.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2014,2019,2021, by the GROMACS development team, led by
5  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6  * and including many others, as listed in the AUTHORS file in the
7  * top-level source directory and at http://www.gromacs.org.
8  *
9  * GROMACS is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; either version 2.1
12  * of the License, or (at your option) any later version.
13  *
14  * GROMACS is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with GROMACS; if not, see
21  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
23  *
24  * If you want to redistribute modifications to GROMACS, please
25  * consider that scientific software is very special. Version
26  * control is crucial - bugs must be traceable. We will be happy to
27  * consider code for inclusion in the official distribution, but
28  * derived work must not be called official GROMACS. Details are found
29  * in the README & COPYING files - if they are missing, get the
30  * official version at http://www.gromacs.org.
31  *
32  * To help us fund GROMACS development, we humbly ask that you cite
33  * the research papers on the package. Check out http://www.gromacs.org.
34  */
35 /*! \internal \file
36  * \brief
37  * Declares helper class for autocorrelation tests
38  *
39  * \author Anders G&auml;rden&auml;s <anders.gardenas@gmail.com>
40  * \ingroup module_correlationfunctions
41  */
42 #ifndef GMX_CORRELATIONDATASET_H
43 #define GMX_CORRELATIONDATASET_H
44
45 #include <memory>
46 #include <string>
47 #include <vector>
48
49 #include "gromacs/utility/classhelpers.h"
50 #include "gromacs/utility/real.h"
51
52 class CorrelationDataSet
53 {
54     double** tempValues_;
55
56     int    nrLines_;
57     int    nrColumns_;
58     double startTime_;
59     double endTime_;
60     double dt_;
61
62 public:
63     /*! \brief
64      * Constructor
65      * \param[in] fileName containing function to test. *.xvg
66      */
67     explicit CorrelationDataSet(const std::string& fileName);
68
69     /*! \brief
70      * Return a value at an index
71      * \param[in] set the set number
72      * \param[in] t the time index of the value
73      */
74     real getValue(int set, int t) const;
75
76     /*! \brief
77      * Return the nummber of columns
78      */
79     int getNrColumns() const { return nrColumns_; }
80
81     /*! \brief
82      * Return the nummber of Lines
83      */
84     int getNrLines() const { return nrLines_; }
85
86     /*! \brief
87      * Return the time witch the function starts at
88      */
89     real getStartTime() const { return startTime_; }
90
91     /*! \brief
92      * Return the time the function ends at
93      */
94     real getEndTime() const { return endTime_; }
95
96     /*! \brief
97      * return delta time
98      */
99     real getDt() const { return dt_; }
100
101     /*! \brief
102      * Destructor
103      */
104     ~CorrelationDataSet();
105
106 private:
107     //! This class should not be copyable or assignable
108     GMX_DISALLOW_COPY_AND_ASSIGN(CorrelationDataSet);
109 };
110
111 #endif