source: src/Dynamics/BondVectors_impl.hpp@ d51e62

AutomationFragmentation_failures Candidate_v1.6.1 ChemicalSpaceEvaluator Exclude_Hydrogens_annealWithBondGraph ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_contraction-expansion Gui_displays_atomic_force_velocity PythonUI_with_named_parameters StoppableMakroAction TremoloParser_IncreasedPrecision
Last change on this file since d51e62 was d51e62, checked in by Frederik Heber <frederik.heber@…>, 7 years ago

Added helper class BondVectors.

  • Property mode set to 100644
File size: 939 bytes
Line 
1/*
2 * BondVectors_impl.hpp
3 *
4 * Created on: Jun 13, 2017
5 * Author: heber
6 */
7
8
9#ifndef DYNAMICS_BONDVECTORS_IMPL_HPP_
10#define DYNAMICS_BONDVECTORS_IMPL_HPP_
11
12// include config.h
13#ifdef HAVE_CONFIG_H
14#include <config.h>
15#endif
16
17#include "BondVectors.hpp"
18
19#include <algorithm>
20
21#include "Atom/atom.hpp"
22
23template <class T>
24void BondVectors::setFromAtomRange(
25 typename T::iterator _start,
26 typename T::iterator _end,
27 const size_t &_step)
28{
29 container.clear();
30 for (typename T::iterator iter = _start; iter != _end; ++iter) {
31 const atom &walker = **iter;
32 const BondList &ListOfBonds = walker.getListOfBondsAtStep(_step);
33 container.insert(container.end(), ListOfBonds.begin(), ListOfBonds.end());
34 }
35 // sort and make unique
36 std::sort(container.begin(), container.end());
37 container.erase(std::unique(container.begin(), container.end()), container.end());
38}
39
40
41#endif /* DYNAMICS_BONDVECTORS_IMPL_HPP_ */
Note: See TracBrowser for help on using the repository browser.