source: src/Potentials/PotentialTrainer.hpp

Candidate_v1.6.1
Last change on this file was 945797, checked in by Frederik Heber <heber@…>, 8 years ago

FIX: PotentialTrainer::getFirstGraphwithSpecifiedElements() did not match graph exactly.

  • we just checked for the set of elements to be contained but the given set of elements needs to be matched exactly, e.g. CNH4 contains CH4 but is not what we want.
  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 * PotentialTrainer.hpp
3 *
4 * Created on: Sep 11, 2014
5 * Author: heber
6 */
7
8#ifndef POTENTIALTRAINER_HPP_
9#define POTENTIALTRAINER_HPP_
10
11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16#include <boost/filesystem/path.hpp>
17#include <vector>
18
19#include "Potentials/SerializablePotential.hpp"
20
21class element;
22class HomologyContainer;
23class HomologyGraph;
24
25/** This class is a functor for training a (compound) potential from homologies.
26 *
27 */
28class PotentialTrainer
29{
30public:
31 PotentialTrainer();
32 ~PotentialTrainer();
33
34 bool operator()(
35 const HomologyContainer &_homologies,
36 const HomologyGraph &_graph,
37 const boost::filesystem::path &_trainingfile,
38 const unsigned int _maxiterations,
39 const double _threshold,
40 const unsigned int _best_of_howmany) const;
41
42 /** Get the first matching homologous graph based only on the number of nodes.
43 *
44 * We could directly access the equal_range in the HomologyContainer we if were
45 * specified the full HomologyGraph. However, if we have only get "CH4", then
46 * we lack the bonding structure, hence one half of the graph is missing.
47 *
48 * Therefore, we step through all graphs and get the first to match exactly
49 * with the number of specified element.s
50 *
51 * \param homologies container sorted by homologous fragments/graphs
52 * \param types fragment specification, e.g. "CH4"
53 * \return the first matching HomologyGraph
54 */
55 static
56 HomologyGraph getFirstGraphwithSpecifiedElements(
57 const HomologyContainer &homologies,
58 const SerializablePotential::ParticleTypes_t &types);
59
60 static
61 SerializablePotential::ParticleTypes_t getNumbersFromElements(
62 const std::vector<const element *> &fragment);
63};
64
65
66#endif /* POTENTIALTRAINER_HPP_ */
Note: See TracBrowser for help on using the repository browser.