Changeset d760bb for src/Fragmentation/UniqueFragments.cpp
- Timestamp:
- Feb 24, 2013, 12:59:18 PM (13 years ago)
- Branches:
- 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
- Children:
- c91572
- Parents:
- b6b5b8
- git-author:
- Frederik Heber <heber@…> (02/19/13 12:42:38)
- git-committer:
- Frederik Heber <heber@…> (02/24/13 12:59:18)
- File:
-
- 1 edited
-
src/Fragmentation/UniqueFragments.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Fragmentation/UniqueFragments.cpp
rb6b5b8 rd760bb 37 37 #include "UniqueFragments.hpp" 38 38 39 #include "CodePatterns/Assert.hpp" 39 40 #include "CodePatterns/Log.hpp" 40 41 … … 48 49 /** Constructor of class UniqueFragments. 49 50 * 51 * @param _TEFactor total energy factor 52 * @param _Leaflet current graph to work on 53 * @param _Root root atom 50 54 */ 51 UniqueFragments::UniqueFragments() 52 {} 55 UniqueFragments::UniqueFragments(double _TEFactor, std::vector<Graph*> &_Leaflets, atom *_Root) : 56 FragmentCounter(0), 57 Root(_Root), 58 TEFactor(_TEFactor), 59 Leaflets(_Leaflets) 60 { 61 FragmentSet = new KeySet; 62 } 53 63 54 64 /** Destructor of class UniqueFragments. … … 56 66 */ 57 67 UniqueFragments::~UniqueFragments() 58 {} 68 { 69 Cleanup(); 70 } 59 71 60 72 /** Checking whether KeySet is not already present in Graph, if so just adds factor. 73 * 74 * \param order order at which to insert 61 75 */ 62 void UniqueFragments::InsertFragmentIntoGraph( )76 void UniqueFragments::InsertFragmentIntoGraph(const size_t order) 63 77 { 64 78 GraphTestPair testGraphInsert; 65 79 66 testGraphInsert = Leaflet->insert(GraphPair (*FragmentSet,std::pair<int,double>(FragmentCounter,TEFactor))); // store fragment number and current factor 80 ASSERT( Leaflets.size() > order, 81 "UniqueFragments::InsertFragmentIntoGraph() - Leaflets has only " 82 +toString(Leaflets.size())+" entries, not enough for "+toString(order)); 83 testGraphInsert = Leaflets[order]->insert(GraphPair (*FragmentSet,std::pair<int,double>(FragmentCounter,TEFactor))); // store fragment number and current factor 67 84 if (testGraphInsert.second) { 68 85 LOG(2, "KeySet " << FragmentCounter << " successfully inserted."); … … 75 92 }; 76 93 77 /** Initialization for UniqueFragments.78 *79 * \param _Root ref to atom to start from (with graph algorithms, hence root node)80 * \param AtomCount number of nodes/atoms81 */82 void UniqueFragments::Init(atom *_Root)83 {84 // initialise the fragments structure85 FragmentCounter = 0;86 FragmentSet = new KeySet;87 Root = _Root;88 }89 90 94 /** Removes some allocated memory. 91 95 * … … 93 97 void UniqueFragments::Cleanup() 94 98 { 95 delete (FragmentSet);99 delete FragmentSet; 96 100 } 97 101 … … 113 117 Root=_root; 114 118 } 115 116 /** Sets initial values before PowerSetGenerator uses this class.117 *118 * @param _TEFactor total energy factor119 * @param _Leaflet current graph to work on120 * @param _Root root atom121 */122 void UniqueFragments::PrepareForPowersetGeneration(double _TEFactor, Graph *_Leaflet, atom *_Root)123 {124 TEFactor = _TEFactor;125 Leaflet = _Leaflet;126 Root = _Root;127 }
Note:
See TracChangeset
for help on using the changeset viewer.
