source: src/Fragmentation/Homology/HomologyGraph.hpp@ 77b350

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 Candidate_v1.7.0 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 77b350 was 77b350, checked in by Frederik Heber <heber@…>, 13 years ago

HomologyGraph may now be created from a given KeySet referring to World's atoms.

  • Property mode set to 100644
File size: 2.8 KB
Line 
1/*
2 * HomologyGraph.hpp
3 *
4 * Created on: Sep 24, 2012
5 * Author: heber
6 */
7
8#ifndef HOMOLOGYGRAPH_HPP_
9#define HOMOLOGYGRAPH_HPP_
10
11
12// include config.h
13#ifdef HAVE_CONFIG_H
14#include <config.h>
15#endif
16
17#include <set>
18
19#include "Fragmentation/Homology/FragmentEdge.hpp"
20#include "Fragmentation/Homology/FragmentNode.hpp"
21
22class KeySet;
23
24/** This class contains the representation of a molecular fragment as a graph.
25 *
26 * Only, we do not store the full graph in here. We have to include symmetries
27 * such that two hydrogens may switch places. Eventually, we only look for the
28 * set of distances of a fragment. If two hydrogens switch places, then also in
29 * the set of distances some distances are interchanged but the whole fragment
30 * remains the same. Hence, we have to store the bond graph representation in
31 * such a way as to automatically include these symmetries.
32 *
33 * To this end, we use FragmentNode and FragmentEdge to store the vital
34 * information.
35 *
36 */
37class HomologyGraph
38{
39public:
40 //!> typedef for a set of nodes representing node information
41 typedef std::set<FragmentNode> nodes_t;
42 //!> typedef for a set of nodes representing edge information
43 typedef std::set<FragmentEdge> edges_t;
44public:
45 /** Default constructor for class HomologyGraph.
46 *
47 * This is required to allow placement in STL containers
48 *
49 */
50 HomologyGraph() {}
51
52 /** Constructor for class HomologyGraph.
53 *
54 * @param _nodes information on nodes of this graph
55 * @param _edges information on edges of this graph
56 */
57 HomologyGraph(const nodes_t &_nodes, const edges_t &_edges) :
58 nodes(_nodes),
59 edges(_edges)
60 {}
61
62 /** Constructor for class HomologyGraph from a keyset (i.e. from atoms in the World).
63 *
64 * @param keyset global ids of atoms to pick
65 */
66 HomologyGraph(const KeySet &keyset);
67
68 /** Destructor for class HomologyGraph.
69 *
70 */
71 ~HomologyGraph() {}
72
73 // comparators (allows sorting and hence quicker finding in STL containers)
74 bool operator<(const HomologyGraph &graph) const;
75 bool operator>(const HomologyGraph &graph) const;
76 bool operator==(const HomologyGraph &graph) const;
77 bool operator!=(const HomologyGraph &graph) const {
78 return (!(*this == graph));
79 }
80
81 /** Assignment operator for class HomologyGraph.
82 *
83 * This is required to allow placement in STL container as we need to
84 * const_cast override our const member variables.
85 *
86 */
87 HomologyGraph& operator=(const HomologyGraph &graph);
88
89private:
90 //!> information on the nodes of the graph
91 const nodes_t nodes;
92 //!> information on the edges of the graph
93 const edges_t edges;
94};
95
96// define some helpers outside to allow for light-weight unit testing
97namespace detail {
98 const HomologyGraph::nodes_t getNodesFromKeySet(const KeySet &keyset);
99 const HomologyGraph::edges_t getEdgesFromKeySet(const KeySet &keyset);
100};
101
102
103#endif /* HOMOLOGYGRAPH_HPP_ */
Note: See TracBrowser for help on using the repository browser.