Changeset a13e21 for src/FunctionApproximation/Extractors.hpp
- Timestamp:
- Oct 2, 2016, 1:59:41 PM (9 years ago)
- Branches:
- Fix_FitPotential_needs_atomicnumbers
- Children:
- 6ffdf2
- Parents:
- 8d5db8
- git-author:
- Frederik Heber <heber@…> (10/02/16 13:59:35)
- git-committer:
- Frederik Heber <heber@…> (10/02/16 13:59:41)
- File:
-
- 1 edited
-
src/FunctionApproximation/Extractors.hpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/FunctionApproximation/Extractors.hpp
r8d5db8 ra13e21 52 52 */ 53 53 namespace _detail { 54 /** Gather all distance arguments from the same aligned vector of charges.55 *56 * Basically, we filter the positions indicated by the targets but57 * from a different vector that has the same layout.58 *59 * \param positions all nuclei positions60 * \param charges all nuclei charges61 * \param targets iterators on charges62 * \return filtered distance arguments63 */64 FunctionModel::arguments_t gatherDistancesFromTargets(65 const Fragment::positions_t& positions,66 const Fragment::charges_t& charges,67 const chargeiters_t &targets,68 const size_t globalid69 );70 71 /** Gather all positions from the same aligned vector of charges.72 *73 * Basically, we filter the positions indicated by the targets but74 * from a different vector that has the same layout.75 *76 * \param positions all nuclei positions77 * \param charges all nuclei charges78 * \param targets iterators on charges79 * \return filtered positions80 */81 Fragment::positions_t gatherPositionsFromTargets(82 const Fragment::positions_t& positions,83 const Fragment::charges_t& charges,84 const chargeiters_t& targets85 );86 54 87 55 /** Counts all same elements in the vector and places into map of elements. … … 94 62 ); 95 63 96 /** Gather iterators to the elements related to the desired elementcounts.97 *98 * \param charges charges wherein to search for the elements99 * \param elementcounts number of desired hits per element100 * \return iterators equal to the initial vector of elements101 */102 elementtargets_t convertElementcountsToTargets(103 const Fragment::charges_t &charges,104 const elementcounts_t &elementcounts105 );106 107 /** Convert the alignment back to as it was in the original vector.108 *109 * We lost the information by storing it in a map. Hence, we need this110 * final step.111 *112 * \param elementtargets targets as they are in the map \a elementcounts113 * \param elements the original order of the elements114 * \param elementcounts the count per element for debugging checks115 * \return vector of targets in the order as they are in \a element116 */117 chargeiters_t realignElementtargets(118 const elementtargets_t &elementtargets,119 const Fragment::charges_t elements,120 const elementcounts_t &elementcounts121 );122 123 /** Searches for desired elements in charges in a unique manner.124 *125 * The idea is to have e.g. a fragment with charges 8,1,1,2 and126 * elements as 1,8,1 (e.g. for an angle HOH) and we get the127 * chargeiters in the desired manner on indices: 1,0,3.128 *129 * \param charges charges to look through130 * \param elements vector of elements to find131 */132 chargeiters_t133 gatherTargetsFromFragment(134 const Fragment::charges_t& charges,135 const Fragment::charges_t elements136 );137 138 /** Brings all charges together in a map.139 *140 * @param charges charges as possible keys and their iterators as values in the map141 * @param elements list of charges to pick as keys142 * @return map of key and a vector of charge iterators143 */144 elementtargets_t convertChargesToTargetMap(145 const Fragment::charges_t& charges,146 Fragment::charges_t elements147 );148 149 /** Brings combinatorially together desired list of \a charges and \a targets.150 *151 * @param charges list of desired charges152 * @param elementtargets map of available targets per element153 * @return vector of chargeiters with all unique combinations154 */155 targets_per_combination_t156 CombineChargesAndTargets(157 const Fragment::charges_t& charges,158 const elementtargets_t& elementtargets159 );160 161 /** Recursive function to pick the next target.162 *163 * This is used by \sa CombineChargesAndTargets()164 *165 * @param charges set of charges, reduced by one per recursion166 * @param elementtargets targets, map of targets to pick from167 * @param currenttargets current set of targets, "global" through recursion168 * @param addFunction bound function to add a set when complete169 */170 void pickLastElementAsTarget(171 Fragment::charges_t elements,172 elementtargets_t elementtargets,173 chargeiters_t& currenttargets,174 boost::function<void (const chargeiters_t ¤ttargets)> &addFunction175 );176 177 /** Converts a list of chargeiters to a list of respective arguments.178 *179 * @param positions positions from fragment180 * @param charges charges associated to each element in \a positions181 * @param combinations vector of chargeiters182 * \param globalid refers to the index within the global set of configurations183 * @return list of arguments184 */185 FunctionModel::arguments_t186 convertTargetsToArguments(187 const Fragment::positions_t& positions,188 const Fragment::charges_t& charges,189 const targets_per_combination_t combinations,190 const size_t globalid191 );192 64 } 193 194 /** Gather all distances from a given set of positions.195 *196 * \param positions all nuclei positions197 * \param charges all nuclei charges198 * \param globalid index to associated in argument_t with199 * \return vector of argument_ , each with a distance200 */201 FunctionModel::arguments_t202 gatherAllDistanceArguments(203 const Fragment::positions_t& positions,204 const Fragment::charges_t& charges,205 const size_t globalid);206 65 207 66 /** Gather all distances from a given set of positions. … … 219 78 const Fragment::charges_t& charges, 220 79 const size_t globalid); 221 222 /** Simple extractor of all unique pair distances of a given \a fragment.223 *224 * \param positions all nuclei positions225 * \param charges all nuclei charges226 * \param index index refers to the index within the global set of configurations227 * \return vector of of argument_t containing all found distances228 */229 inline FunctionModel::arguments_t gatherAllDistances(230 const Fragment::positions_t& positions,231 const Fragment::charges_t& charges,232 const size_t index233 ) {234 // get distance out of Fragment235 return gatherAllDistanceArguments(positions, charges, index);236 }237 80 238 81 /** Simple extractor of all unique pair distances of a given \a fragment, where … … 252 95 return gatherAllSymmetricDistanceArguments(positions, charges, index); 253 96 } 254 255 /** Filters only those positions out of given \a fragment that match \a elements.256 *257 * \param positions all nuclei positions258 * \param charges all nuclei charges259 * \param elements tuple of desired elements260 * \return vector of positions_t containing261 */262 Fragment::positions_t gatherPositionsFromFragment(263 const Fragment::positions_t positions,264 const Fragment::charges_t charges,265 const Fragment::charges_t& elements266 );267 268 /** Filters only those distances out of given \a fragment that match \a elements.269 *270 * \param positions all nuclei positions271 * \param charges all nuclei charges272 * \param elements tuple of desired elements273 * \param globalid refers to the index within the global set of configurations274 * \return vector of arguments_t containing those matched with elements275 */276 FunctionModel::arguments_t gatherDistancesFromFragment(277 const Fragment::positions_t positions,278 const Fragment::charges_t charges,279 const Fragment::charges_t& elements,280 const size_t globalid281 );282 283 /** Gather all combinations of charges as distance arguments from the fragment.284 *285 * E.g. we have a water fragment, i.e. (8,1,1) and we we want elements (8,1),286 * then two arguments are returned, first to second and first to third.287 *288 * With \sa gatherDistancesFromFragment() only the first distance would be289 * returned.290 *291 * @param positions positions in fragment292 * @param charges charges in fragment293 * @param elements list of desired elements294 * @param globalid some global id to discern training data tuples295 * @return list of arguments with distances296 */297 FunctionModel::arguments_t gatherAllDistancesFromFragment(298 const Fragment::positions_t& positions,299 const Fragment::charges_t& charges,300 const Fragment::charges_t elements,301 const size_t globalid302 );303 304 /** Reorder arguments by increasing distance.305 *306 * \param listargs list of arguments to reorder each307 * \return reordered args308 */309 FunctionModel::list_of_arguments_t reorderArgumentsByIncreasingDistance(310 const FunctionModel::list_of_arguments_t &listargs311 );312 97 313 98 /** Reorder the arguments to bring adjacent ones together.
Note:
See TracChangeset
for help on using the changeset viewer.
