GQCP
Loading...
Searching...
No Matches
Algorithm.hpp
Go to the documentation of this file.
1// This file is part of GQCG-GQCP.
2//
3// Copyright (C) 2017-2020 the GQCG developers
4//
5// GQCG-GQCP is free software: you can redistribute it and/or modify
6// it under the terms of the GNU Lesser General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// GQCG-GQCP is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with GQCG-GQCP. If not, see <http://www.gnu.org/licenses/>.
17
18#pragma once
19
20
22
23
24namespace GQCP {
25
26
32template <typename _Environment>
33class Algorithm {
34public:
35 using Environment = _Environment;
36
37
38private:
39 StepCollection<Environment> steps; // the steps that should be executed when this algorithm is performed
40
41
42public:
43 /*
44 * CONSTRUCTORS
45 */
46
51 steps {steps} {}
52
53
54 /*
55 * PUBLIC METHODS
56 */
57
61 std::string description() const {
62
63 std::string description_string = "An algorithm consisting of the following steps:\n";
64 description_string += this->steps.description();
65 return description_string;
66 }
67
68
72 void perform(Environment& environment) {
73 this->steps.execute(environment);
74 }
75};
76
77
78} // namespace GQCP
Definition: Algorithm.hpp:33
void perform(Environment &environment)
Definition: Algorithm.hpp:72
std::string description() const
Definition: Algorithm.hpp:61
Algorithm(const StepCollection< Environment > &steps)
Definition: Algorithm.hpp:50
_Environment Environment
Definition: Algorithm.hpp:35
Definition: StepCollection.hpp:41
void execute(Environment &environment) override
Definition: StepCollection.hpp:75
std::string description() const override
Definition: StepCollection.hpp:58
Definition: BaseOneElectronIntegralBuffer.hpp:25