Changeset f66195 for src/molecule_fragmentation.cpp
- Timestamp:
- Oct 9, 2009, 10:54:52 AM (16 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, 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:
- 49f802c
- Parents:
- e41951
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_fragmentation.cpp
re41951 rf66195 6 6 */ 7 7 8 #include "atom.hpp" 9 #include "bond.hpp" 8 10 #include "config.hpp" 11 #include "element.hpp" 12 #include "helpers.hpp" 13 #include "lists.hpp" 9 14 #include "memoryallocator.hpp" 10 15 #include "molecule.hpp" 16 #include "periodentafel.hpp" 11 17 12 18 /************************************* Functions for class molecule *********************************/ … … 975 981 */ 976 982 977 /** Structure containing all values in power set combination generation.978 */979 struct UniqueFragments {980 config *configuration;981 atom *Root;982 Graph *Leaflet;983 KeySet *FragmentSet;984 int ANOVAOrder;985 int FragmentCounter;986 int CurrentIndex;987 double TEFactor;988 int *ShortestPathList;989 bool **UsedList;990 bond **BondsPerSPList;991 int *BondsPerSPCount;992 };993 994 983 /** From a given set of Bond sorted by Shortest Path distance, create all possible fragments of size \a SetDimension. 995 984 * -# loops over every possible combination (2^dimension of edge set) … … 1322 1311 }; 1323 1312 1324 //bool operator < (KeySet SubgraphA, KeySet SubgraphB)1325 //{1326 // return KeyCompare(SubgraphA, SubgraphB);1327 //};1328 1329 /** Checking whether KeySet is not already present in Graph, if so just adds factor.1330 * \param *out output stream for debugging1331 * \param &set KeySet to insert1332 * \param &graph Graph to insert into1333 * \param *counter pointer to unique fragment count1334 * \param factor energy factor for the fragment1335 */1336 inline void InsertFragmentIntoGraph(ofstream *out, struct UniqueFragments *Fragment)1337 {1338 GraphTestPair testGraphInsert;1339 1340 testGraphInsert = Fragment->Leaflet->insert(GraphPair (*Fragment->FragmentSet,pair<int,double>(Fragment->FragmentCounter,Fragment->TEFactor))); // store fragment number and current factor1341 if (testGraphInsert.second) {1342 *out << Verbose(2) << "KeySet " << Fragment->FragmentCounter << " successfully inserted." << endl;1343 Fragment->FragmentCounter++;1344 } else {1345 *out << Verbose(2) << "KeySet " << Fragment->FragmentCounter << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first << endl;1346 ((*(testGraphInsert.first)).second).second += Fragment->TEFactor; // increase the "created" counter1347 *out << Verbose(2) << "New factor is " << ((*(testGraphInsert.first)).second).second << "." << endl;1348 }1349 };1350 //void inline InsertIntoGraph(ofstream *out, KeyStack &stack, Graph &graph, int *counter, double factor)1351 //{1352 // // copy stack contents to set and call overloaded function again1353 // KeySet set;1354 // for(KeyStack::iterator runner = stack.begin(); runner != stack.begin(); runner++)1355 // set.insert((*runner));1356 // InsertIntoGraph(out, set, graph, counter, factor);1357 //};1358 1359 /** Inserts each KeySet in \a graph2 into \a graph1.1360 * \param *out output stream for debugging1361 * \param graph1 first (dest) graph1362 * \param graph2 second (source) graph1363 * \param *counter keyset counter that gets increased1364 */1365 inline void InsertGraphIntoGraph(ofstream *out, Graph &graph1, Graph &graph2, int *counter)1366 {1367 GraphTestPair testGraphInsert;1368 1369 for(Graph::iterator runner = graph2.begin(); runner != graph2.end(); runner++) {1370 testGraphInsert = graph1.insert(GraphPair ((*runner).first,pair<int,double>((*counter)++,((*runner).second).second))); // store fragment number and current factor1371 if (testGraphInsert.second) {1372 *out << Verbose(2) << "KeySet " << (*counter)-1 << " successfully inserted." << endl;1373 } else {1374 *out << Verbose(2) << "KeySet " << (*counter)-1 << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first << endl;1375 ((*(testGraphInsert.first)).second).second += (*runner).second.second;1376 *out << Verbose(2) << "New factor is " << (*(testGraphInsert.first)).second.second << "." << endl;1377 }1378 }1379 };1380 1381 1313 1382 1314 /** Performs BOSSANOVA decomposition at selected sites, increasing the cutoff by one at these sites.
Note:
See TracChangeset
for help on using the changeset viewer.