indigoX
cherrypicker.hpp
Go to the documentation of this file.
1 #include "../classes/athenaeum.hpp"
2 #include "../classes/forcefield.hpp"
3 #include "../utils/enum_class_bitwise.hpp"
4 #include "../utils/fwd_declares.hpp"
5 
6 #include <bitset>
7 #include <cstdint>
8 #include <list>
9 #include <type_traits>
10 
11 #ifndef INDIGOX_ALGORITHM_CHERRYPICKER_HPP
12 #define INDIGOX_ALGORITHM_CHERRYPICKER_HPP
13 
14 namespace indigox::algorithm {
15 
79  class CherryPicker {
80  public:
94  enum class Settings : uint8_t {
95  // Vertex
111  VertexCyclic,
124  VertexDegree,
125  // Edge
141  EdgeCyclic,
154  EdgeDegree,
155  // Normal bool
196  BoolCount,
209  IntCount
210  };
211 
218  bool GetBool(Settings param);
219 
225  void SetBool(Settings param);
226 
232  void UnsetBool(Settings param);
233 
240  int32_t GetInt(Settings param);
241 
248  void SetInt(Settings param, int32_t value);
249 
266  void DefaultSettings();
267 
273 
284  bool AddAthenaeum(Athenaeum &library);
285 
291  bool RemoveAthenaeum(Athenaeum &library);
292 
297  int32_t NumAthenaeums() { return (int32_t)_libs.size(); }
298 
309 
314  Forcefield GetForcefield() { return _ff; }
315 
317  CherryPicker() = delete;
318  ~CherryPicker() = default;
320 
321  private:
322  Forcefield _ff;
323  std::list<Athenaeum> _libs;
324  std::bitset<(uint8_t)Settings::BoolCount> bool_parameters;
325  std::array<int32_t,
326  (uint8_t)Settings::IntCount - (uint8_t)Settings::BoolCount - 1>
327  int_parameters;
328  };
329 
330 } // namespace indigox::algorithm
331 
332 #endif /* INDIGOX_ALGORITHM_CHERRYPICKER_HPP */
Settings
User controllable settings for the CherryPicker algorithm.
Definition: cherrypicker.hpp:94
Definition: access.hpp:7
void SetInt(Settings param, int32_t value)
Set the value of an integer setting.
Athenaeum class for fragment storage in CherryPicker algorithm.
Definition: athenaeum.hpp:76
int32_t GetInt(Settings param)
Get the current value of an integer setting.
bool GetBool(Settings param)
Get the current state of a boolean setting.
bool RemoveAthenaeum(Athenaeum &library)
Remove an Athenaeum from the list.
bool AddAthenaeum(Athenaeum &library)
Add an Athenaeum for parameterisation purposes.
int32_t NumAthenaeums()
The number of Athenaeums in the list.
Definition: cherrypicker.hpp:297
Forcefield GetForcefield()
Get the assigned forcefield.
Definition: cherrypicker.hpp:314
void UnsetBool(Settings param)
Set the state of a boolean setting to false.
Definition: molecule.hpp:15
ParamMolecule ParameteriseMolecule(Molecule &mol)
Apply the CherryPicker algorithm to a molecule.
Definition: forcefield.hpp:333
CherryPicker(Forcefield &ff)
Constructor.
void SetBool(Settings param)
Set the state of a boolean setting to true.
void DefaultSettings()
Set the default values for all of the settings.
Definition: parameterised.hpp:255
CherryPicker parameterisation algorithm class.
Definition: cherrypicker.hpp:79