QMCPACK
RecordArray.hpp
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2022 QMCPACK developers.
6 //
7 // File developed by: Mark Dewing, mdewing@anl.gov, Argonne National Laboratory
8 // Ye Luo, yeluo@anl.gov, Argonne National Laboratory
9 //
10 // File created by: Mark Dewing, mdewing@anl.gov, Argonne National Laboratory
11 //////////////////////////////////////////////////////////////////////////////////////
12 
13 #ifndef QMCPLUSPLUS_RECORDARRAY_H
14 #define QMCPLUSPLUS_RECORDARRAY_H
15 
16 #include "OhmmsPETE/OhmmsMatrix.h"
17 
18 // This is a data structure with two indices. The data is a list of samples,
19 // and each sample has an entry for multiple parameters.
20 // Think of a spreadsheet where the samples are the rows and the parameters are the columns.
21 //
22 namespace qmcplusplus
23 {
24 template<typename T>
25 class RecordArray : public Matrix<T>
26 {
27 public:
28  using Base = Matrix<T>;
29 
31 
32  /// Constructor specifying the number of parameters and entries
33  RecordArray(size_t nentries, size_t nparams) : Base(nentries, nparams) {}
34 
35  /// Change the size
36  void resize(size_t nentries, size_t nparams)
37  {
38  Base::resize(nentries, nparams);
39  }
40 
41  int getNumOfEntries() const { return Base::rows(); }
42  int getNumOfParams() const { return Base::cols(); }
43 };
44 } // namespace qmcplusplus
45 
46 #endif
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
void resize(size_type n, size_type m)
Resize the container.
Definition: OhmmsMatrix.h:99
size_type cols() const
Definition: OhmmsMatrix.h:78
void resize(size_t nentries, size_t nparams)
Change the size.
Definition: RecordArray.hpp:36
size_type rows() const
Definition: OhmmsMatrix.h:77
RecordArray(size_t nentries, size_t nparams)
Constructor specifying the number of parameters and entries.
Definition: RecordArray.hpp:33