Changeset caa00e9 for src/FunctionApproximation/Extractors.hpp
- Timestamp:
- Feb 27, 2013, 12:39:03 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:
- df350c
- Parents:
- dbf8c8
- git-author:
- Frederik Heber <heber@…> (12/06/12 10:35:37)
- git-committer:
- Frederik Heber <heber@…> (02/27/13 12:39:03)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/FunctionApproximation/Extractors.hpp
rdbf8c8 rcaa00e9 14 14 #endif 15 15 16 #include <boost/function.hpp> 17 16 18 #include "Fragmentation/SetValues/Fragment.hpp" 17 19 #include "FunctionApproximation/FunctionModel.hpp" … … 30 32 typedef std::map< element_t, count_t> elementcounts_t; 31 33 typedef std::map< element_t, chargeiters_t > elementtargets_t; 34 typedef std::vector< chargeiters_t > targets_per_combination_t; 32 35 33 36 /** Namespace for some internal helper functions. … … 117 120 const Fragment::charges_t& charges, 118 121 const Fragment::charges_t elements 122 ); 123 124 /** Brings all charges together in a map. 125 * 126 * @param charges charges as possible keys and their iterators as values in the map 127 * @param elements list of charges to pick as keys 128 * @return map of key and a vector of charge iterators 129 */ 130 elementtargets_t convertChargesToTargetMap( 131 const Fragment::charges_t& charges, 132 Fragment::charges_t elements 133 ); 134 135 /** Brings combinatorially together desired list of \a charges and \a targets. 136 * 137 * @param charges list of desired charges 138 * @param elementtargets map of available targets per element 139 * @return vector of chargeiters with all unique combinations 140 */ 141 targets_per_combination_t 142 CombineChargesAndTargets( 143 const Fragment::charges_t& charges, 144 const elementtargets_t& elementtargets 145 ); 146 147 /** Recursive function to pick the next target. 148 * 149 * This is used by \sa CombineChargesAndTargets() 150 * 151 * @param charges set of charges, reduced by one per recursion 152 * @param elementtargets targets, map of targets to pick from 153 * @param currenttargets current set of targets, "global" through recursion 154 * @param addFunction bound function to add a set when complete 155 */ 156 void pickLastElementAsTarget( 157 Fragment::charges_t elements, 158 elementtargets_t elementtargets, 159 chargeiters_t& currenttargets, 160 boost::function<void (const chargeiters_t ¤ttargets)> &addFunction 161 ); 162 163 /** Converts a list of chargeiters to a list of respective arguments. 164 * 165 * @param positions positions from fragment 166 * @param charges charges associated to each element in \a positions 167 * @param combinations vector of chargeiters 168 * \param globalid refers to the index within the global set of configurations 169 * @return list of arguments 170 */ 171 FunctionModel::arguments_t 172 convertTargetsToArguments( 173 const Fragment::positions_t& positions, 174 const Fragment::charges_t& charges, 175 const targets_per_combination_t combinations, 176 const size_t globalid 119 177 ); 120 178 } … … 199 257 * \param charges all nuclei charges 200 258 * \param elements tuple of desired elements 259 * \param globalid refers to the index within the global set of configurations 201 260 * \return vector of arguments_t containing those matched with elements 202 261 */ … … 208 267 ); 209 268 269 /** Gather all combinations of charges as distance arguments from the fragment. 270 * 271 * E.g. we have a water fragment, i.e. (8,1,1) and we we want elements (8,1), 272 * then two arguments are returned, first to second and first to third. 273 * 274 * With \sa gatherDistancesFromFragment() only the first distance would be 275 * returned. 276 * 277 * @param positions positions in fragment 278 * @param charges charges in fragment 279 * @param elements list of desired elements 280 * @param globalid some global id to discern training data tuples 281 * @return list of arguments with distances 282 */ 283 FunctionModel::arguments_t gatherAllDistancesFromFragment( 284 const Fragment::positions_t& positions, 285 const Fragment::charges_t& charges, 286 const Fragment::charges_t elements, 287 const size_t globalid 288 ); 289 210 290 /** Reorder arguments by increasing distance. 211 291 *
Note:
See TracChangeset
for help on using the changeset viewer.