Reaktoro  v2.11.0
A unified framework for modeling chemically reactive systems
ClusterConnectivity.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright © 2014-2024 Allan Leal
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library 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 GNU
13 // 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 this library. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // Reaktoro includes
21 #include <Reaktoro/Common/Types.hpp>
22 #include <Reaktoro/ODML/PriorityQueue.hpp>
23 
24 namespace Reaktoro {
25 
26 // The connectivity matrix of the clusters.
28 {
29 public:
32 
34  auto size() const -> Index;
35 
37  auto extend() -> void;
38 
46  auto increment(Index icluster, Index jcluster) -> void;
47 
52  auto order(Index icluster) const -> Deque<Index> const&;
53 
54 private:
56  Deque<PriorityQueue> matrix;
57 
59  PriorityQueue queue;
60 };
61 
62 } // namespace Reaktoro
Definition: ClusterConnectivity.hpp:28
auto order(Index icluster) const -> Deque< Index > const &
Return the order of clusters for a given starting cluster.
auto increment(Index icluster, Index jcluster) -> void
Increment the rank/usage count for the connectivity from one cluster to another.
auto extend() -> void
Extend the connectivity matrix following creation of a new cluster.
ClusterConnectivity()
Construct a default instance of ClusterConnectivity.
auto size() const -> Index
Return number of currently tracked clusters.
Definition: PriorityQueue.hpp:27
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:29
std::size_t Index
Define a type that represents an index.
Definition: Index.hpp:26
std::deque< T > Deque
Convenient alias for std::deque<T>.
Definition: Types.hpp:70