| 1 | /*
|
|---|
| 2 | * Extractors.hpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: 15.10.2012
|
|---|
| 5 | * Author: heber
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef TRAININGDATA_EXTRACTORS_HPP_
|
|---|
| 9 | #define TRAININGDATA_EXTRACTORS_HPP_
|
|---|
| 10 |
|
|---|
| 11 | // include config.h
|
|---|
| 12 | #ifdef HAVE_CONFIG_H
|
|---|
| 13 | #include <config.h>
|
|---|
| 14 | #endif
|
|---|
| 15 |
|
|---|
| 16 | #include "Fragmentation/SetValues/Fragment.hpp"
|
|---|
| 17 | #include "FunctionApproximation/FunctionModel.hpp"
|
|---|
| 18 |
|
|---|
| 19 | class Fragment;
|
|---|
| 20 |
|
|---|
| 21 | /** Namespace containing all simple extractor functions.
|
|---|
| 22 | *
|
|---|
| 23 | */
|
|---|
| 24 | namespace Extractors {
|
|---|
| 25 | /** Namespace for some internal helper functions.
|
|---|
| 26 | *
|
|---|
| 27 | */
|
|---|
| 28 | namespace _detail {
|
|---|
| 29 | /** Gather all distances from a given set of positions.
|
|---|
| 30 | *
|
|---|
| 31 | * \param positins vector of positions
|
|---|
| 32 | * \param globalid index to associated in argument_t with
|
|---|
| 33 | * \return vector of argument_ , each with a distance
|
|---|
| 34 | */
|
|---|
| 35 | FunctionModel::arguments_t
|
|---|
| 36 | gatherAllDistanceArguments(
|
|---|
| 37 | const Fragment::positions_t &positions,
|
|---|
| 38 | const size_t globalid);
|
|---|
| 39 | }
|
|---|
| 40 |
|
|---|
| 41 | /** Simple extractor of all unique pair distances of a given \a fragment.
|
|---|
| 42 | *
|
|---|
| 43 | * \param fragment fragment with all nuclei positions
|
|---|
| 44 | * \param index index refers to the index within the global set of configurations
|
|---|
| 45 | * \return vector of of argument_t containing all found distances
|
|---|
| 46 | */
|
|---|
| 47 | inline FunctionModel::arguments_t gatherAllDistances(
|
|---|
| 48 | const Fragment& fragment,
|
|---|
| 49 | const size_t index
|
|---|
| 50 | ) {
|
|---|
| 51 | // get distance out of Fragment
|
|---|
| 52 | return _detail::gatherAllDistanceArguments(fragment.getPositions(), index);
|
|---|
| 53 | }
|
|---|
| 54 |
|
|---|
| 55 | /** Gather first distance for the two matching charges.
|
|---|
| 56 | *
|
|---|
| 57 | * \param fragment fragment with all nuclei positions
|
|---|
| 58 | * \param index index refers to the index within the global set of configurations
|
|---|
| 59 | * \param firstelement first element of pair
|
|---|
| 60 | * \param secondelement second element of pair, order is reflected in indices of return argument_t
|
|---|
| 61 | * \return vector of of argument_t containing all found distances
|
|---|
| 62 | */
|
|---|
| 63 | FunctionModel::arguments_t gatherFirstDistance(
|
|---|
| 64 | const Fragment& fragment,
|
|---|
| 65 | const size_t index,
|
|---|
| 66 | const size_t firstelement,
|
|---|
| 67 | const size_t secondelement
|
|---|
| 68 | );
|
|---|
| 69 |
|
|---|
| 70 | }; /* namespace Extractors */
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 | #endif /* TRAININGDATA_EXTRACTORS_HPP_ */
|
|---|