- Timestamp:
- Aug 9, 2013, 2:20:36 PM (12 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:
- e355b31
- Parents:
- ff09f3
- git-author:
- Frederik Heber <heber@…> (07/04/13 08:49:28)
- git-committer:
- Frederik Heber <heber@…> (08/09/13 14:20:36)
- Location:
- src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.cpp
rff09f3 rbf1d1b 222 222 void appendToHomologies( 223 223 const FragmentationShortRangeResults &shortrangeresults, 224 const FragmentationLongRangeResults &longrangeresults 224 const FragmentationLongRangeResults &longrangeresults, 225 const bool storeGrids 225 226 ) 226 227 { … … 246 247 LOG(2, "DEBUG: Created graph " << graph << "."); 247 248 const IndexSet::ptr &index = *iter; 249 250 /// we fill the value structure 248 251 HomologyContainer::value_t value; 249 250 // obtain fragment as key252 value.containsGrids = storeGrids; 253 // obtain fragment 251 254 std::map<IndexSet::ptr, std::pair< MPQCDataFragmentMap_t, MPQCDataFragmentMap_t> >::const_iterator fragmentiter 252 255 = longrangeresults.Result_perIndexSet_Fragment.find(index); … … 254 257 "appendToHomologyFile() - cannot find index "+toString(*index) 255 258 +" in FragmentResults."); 256 value.f irst = boost::fusion::at_key<MPQCDataFused::fragment>(fragmentiter->second.first);257 258 // obtain energy as value259 value.fragment = boost::fusion::at_key<MPQCDataFused::fragment>(fragmentiter->second.first); 260 261 // obtain energy 259 262 std::map<IndexSet::ptr, std::pair< MPQCDataEnergyMap_t, MPQCDataEnergyMap_t> >::const_iterator energyiter 260 263 = shortrangeresults.Result_perIndexSet_Energy.find(index); … … 262 265 "appendToHomologyFile() - cannot find index "+toString(*index) 263 266 +" in FragmentResults."); 264 // value.second = boost::fusion::at_key<MPQCDataFused::energy_total>(energyiter->second.first); // values 265 value.second = boost::fusion::at_key<MPQCDataFused::energy_total>(energyiter->second.second); // contributions 267 value.energy = boost::fusion::at_key<MPQCDataFused::energy_total>(energyiter->second.second); // contributions 268 269 // only store sampled grids if desired 270 if (storeGrids) { 271 // obtain charge distribution 272 std::map<IndexSet::ptr, std::pair< MPQCDataGridMap_t, MPQCDataGridMap_t> >::const_iterator chargeiter 273 = longrangeresults.Result_perIndexSet_Grid.find(index); 274 ASSERT( chargeiter != longrangeresults.Result_perIndexSet_Grid.end(), 275 "appendToHomologyFile() - cannot find index "+toString(*index) 276 +" in FragmentResults."); 277 value.charge_distribution = boost::fusion::at_key<MPQCDataFused::sampled_grid>(chargeiter->second.second); // contributions 278 279 // obtain potential distribution 280 std::map<IndexSet::ptr, std::pair< VMGDataMap_t, VMGDataMap_t> >::const_iterator potentialiter 281 = longrangeresults.Result_perIndexSet_LongRange.find(index); 282 ASSERT( potentialiter != longrangeresults.Result_perIndexSet_LongRange.end(), 283 "appendToHomologyFile() - cannot find index "+toString(*index) 284 +" in FragmentResults."); 285 value.potential_distribution = boost::fusion::at_key<VMGDataFused::sampled_potential>(potentialiter->second.second); // contributions 286 } 266 287 values.insert( std::make_pair( graph, value) ); 267 288 } … … 282 303 for (HomologyContainer::container_t::const_iterator iter = 283 304 homology_container.begin(); iter != homology_container.end(); ++iter) { 284 LOG(2, "DEBUG: graph " << iter->first << " has Fragment " 285 << iter->second.first << " and associated energy " << iter->second.second << "."); 305 LOG(2, "DEBUG: graph " << iter->first 306 << " has Fragment " << iter->second.fragment 307 << ", associated energy " << iter->second.energy 308 << ", and sampled grid integral " << iter->second.charge_distribution.integral() 309 << "."); 286 310 } 287 311 } … … 383 407 384 408 // append all keysets to homology file 385 appendToHomologies(shortrangeresults, longrangeresults );409 appendToHomologies(shortrangeresults, longrangeresults, params.DoStoreGrids.get()); 386 410 } 387 411 #else -
src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.def
rff09f3 rbf1d1b 14 14 // ValueStorage by the token "Z" -> first column: int, Z, "Z" 15 15 // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value 16 #define paramtypes (boost::filesystem::path) 17 #define paramtokens ("fragment-resultfile") 18 #define paramdescriptions ("parse fragment results from the given file") 19 #define paramdefaults (PARAM_DEFAULT("")) 20 #define paramreferences (resultsfile) 16 #define paramtypes (boost::filesystem::path)(bool) 17 #define paramtokens ("fragment-resultfile")("store-grids") 18 #define paramdescriptions ("parse fragment results from the given file")("whether to store sampled grids in homology files") 19 #define paramdefaults (PARAM_DEFAULT(""))(PARAM_DEFAULT("0")) 20 #define paramreferences (resultsfile)(DoStoreGrids) 21 21 #define paramvalids \ 22 (DummyValidator< boost::filesystem::path >()) 22 (DummyValidator< boost::filesystem::path >()) \ 23 (DummyValidator< bool >()) 23 24 24 25 #undef statetypes -
src/Actions/FragmentationAction/FitPotentialAction.cpp
rff09f3 rbf1d1b 191 191 for (HomologyContainer::container_t::const_iterator iter = 192 192 homologies.begin(); iter != homologies.end(); ++iter) { 193 LOG(1, "INFO: graph " << iter->first << " has Fragment " << iter->second.first 194 << " and associated energy " << iter->second.second << "."); 193 LOG(1, "INFO: graph " << iter->first 194 << " has Fragment " << iter->second.fragment 195 << ", associated energy " << iter->second.energy 196 << ", and sampled grid integral " << iter->second.charge_distribution.integral() 197 << "."); 195 198 } 196 199 … … 289 292 iter != fragmentrange.second; 290 293 ++iter) { 291 const Fragment& fragment = iter->second.f irst;292 const double &energy = iter->second. second;294 const Fragment& fragment = iter->second.fragment; 295 const double &energy = iter->second.energy; 293 296 294 297 // create arguments from the fragment -
src/Fragmentation/Homology/HomologyContainer.cpp
rff09f3 rbf1d1b 62 62 iter != homologycontainer.container.end(); ++iter) { 63 63 out << "Graph: " << iter->first 64 << ", (Fragment " << iter->second.first 65 << ":" << iter->second.second << ")\n"; 64 << ", (Fragment " << iter->second.fragment 65 << ":" << iter->second.energy 66 << ":" << iter->second.charge_distribution.integral() 67 << ")\n"; 66 68 } 67 69 return out; 70 } 71 72 bool HomologyContainer::value_t::operator==(const value_t &othervalue) const 73 { 74 if (fragment != othervalue.fragment) 75 return false; 76 if (energy != othervalue.energy) 77 return false; 78 if (charge_distribution != othervalue.charge_distribution) 79 return false; 80 if (potential_distribution != othervalue.potential_distribution) 81 return false; 82 return true; 68 83 } 69 84 -
src/Fragmentation/Homology/HomologyContainer.hpp
rff09f3 rbf1d1b 29 29 #include "Fragmentation/Homology/HomologyGraph.hpp" 30 30 #include "Fragmentation/Summation/SetValues/Fragment.hpp" 31 #include "Fragmentation/Summation/SetValues/SamplingGrid.hpp" 31 32 32 33 class HomologyContainerTest; … … 49 50 //!> grant unit test access 50 51 friend class HomologyContainerTest; 52 51 53 public: 52 typedef double energy_t; 53 typedef std::pair<Fragment, energy_t> value_t; 54 /** This structure represents all values associated to a specific homology 55 * that we wish to store in this container for later reference. 56 */ 57 struct value_t { 58 Fragment fragment; 59 double energy; 60 bool containsGrids; 61 SamplingGrid charge_distribution; 62 SamplingGrid potential_distribution; 63 64 value_t() : 65 energy(0.), 66 containsGrids(false) 67 {} 68 69 bool operator==(const value_t &othervalue) const; 70 71 private: 72 friend class boost::serialization::access; 73 // serialization 74 template <typename Archive> 75 void serialize(Archive& ar, const unsigned int version) 76 { 77 ar & fragment; 78 ar & energy; 79 if (version > 0) { 80 ar & containsGrids; 81 if (containsGrids) { 82 ar & charge_distribution; 83 ar & potential_distribution; 84 } 85 } 86 } 87 }; 88 89 public: 54 90 typedef std::multimap< HomologyGraph, value_t> container_t; 55 91 typedef container_t::const_iterator const_iterator; … … 176 212 BOOST_CLASS_EXPORT_KEY(HomologyContainer) 177 213 214 // version for serialized information associated to HomologyGraph 215 BOOST_CLASS_VERSION(HomologyContainer::value_t, 1) 178 216 179 217 #endif /* HOMOLOGYCONTAINER_HPP_ */ -
src/Fragmentation/Homology/unittests/HomologyContainerUnitTest.cpp
rff09f3 rbf1d1b 100 100 positions[0][0] = 2.; 101 101 Fragment dummy2(positions, charges); 102 HomologyContainer::value_t value1; 103 value1.fragment = dummy1; 104 value1.energy = 1.; 105 HomologyContainer::value_t value2; 106 value2.fragment = dummy2; 107 value2.energy = 1.5; 108 HomologyContainer::value_t value3; 109 value3.fragment = dummy; 110 value3.energy = 2.; 102 111 container += 103 std::make_pair( graph, std::make_pair(dummy1, 1.)),104 std::make_pair( graph, std::make_pair(dummy2, 1.5)),105 std::make_pair( othergraph, std::make_pair(dummy, 2.));112 std::make_pair( graph, value1 ), 113 std::make_pair( graph, value2 ), 114 std::make_pair( othergraph, value3 ); 106 115 // create HomologyContainer 107 116 Keys = new HomologyContainer(container); … … 126 135 Fragment::charges_t charges(1,1.); 127 136 Fragment dummy(positions, charges); 137 HomologyContainer::value_t value; 138 value.fragment = dummy; 139 value.energy = 1.; 128 140 newcontainer += 129 std::make_pair( graph, std::make_pair(dummy, 1.));141 std::make_pair( graph, value ); 130 142 131 143 Keys->insert(newcontainer); … … 148 160 Fragment::charges_t charges(1,1.); 149 161 Fragment dummy(positions, charges); 162 HomologyContainer::value_t value; 163 value.fragment = dummy; 164 value.energy = 1.; 150 165 newcontainer += 151 std::make_pair( graph, std::make_pair(dummy, 1.));166 std::make_pair( graph, value ); 152 167 153 168 HomologyContainer other(newcontainer); -
src/Fragmentation/Homology/unittests/Makefile.am
rff09f3 rbf1d1b 25 25 26 26 FRAGMENTATIONHOMOLOGYLIBS = \ 27 ../libMolecuilderFragmentationSetValues.la \ 27 28 ../libMolecuilderFragmentation.la \ 28 29 ../libMolecuilderFragmentation_getFromKeysetStub.la \ -
src/FunctionApproximation/TrainingData.cpp
rff09f3 rbf1d1b 54 54 void TrainingData::operator()(const range_t &range) { 55 55 for (HomologyContainer::const_iterator iter = range.first; iter != range.second; ++iter) { 56 const Fragment &fragment = iter->second.f irst;56 const Fragment &fragment = iter->second.fragment; 57 57 // create internal list of arguments 58 58 FunctionModel::arguments_t all_args = Extractors::gatherAllSymmetricDistances( … … 62 62 ); 63 63 DistanceVector.push_back( all_args ); 64 const double &energy = iter->second. second;64 const double &energy = iter->second.energy; 65 65 EnergyVector.push_back( FunctionModel::results_t(1, energy) ); 66 66 // filter distances out of list of all arguments
Note:
See TracChangeset
for help on using the changeset viewer.