source: src/Fragmentation/Summation/IndexSet.hpp@ 336da8

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator 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_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 336da8 was c8d13f5, checked in by Frederik Heber <heber@…>, 11 years ago

Summed up results are now handed-over to FragmentationResultContainer by AnalyseFragmentationResultsAction.

  • we do not use fusion::maps here but write out real maps with IndexSet::ptr to MPQCData (but we fill in only energy_t.total so far).
  • TESTFIX: index was not written and tab/newline-hiccup in .._IndexedEnergy.dat
  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 * IndexSet.hpp
3 *
4 * Created on: Apr 24, 2011
5 * Author: heber
6 */
7
8#ifndef INDEXSET_HPP_
9#define INDEXSET_HPP_
10
11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16#include <boost/serialization/access.hpp>
17#include <boost/serialization/base_object.hpp>
18#include <boost/serialization/set.hpp>
19#include <boost/serialization/shared_ptr.hpp>
20
21#include <boost/shared_ptr.hpp>
22#include <set>
23
24//!> is the type of an index
25typedef size_t Index_t;
26
27/** This class represents a single set of indices along with functions to order them
28 * and check whether one is contained in another.
29 */
30class IndexSet : public std::set<Index_t>
31{
32public:
33 //!> typedef for instance wrapped in share_ptr
34 typedef boost::shared_ptr<IndexSet> ptr;
35
36 IndexSet();
37
38 ~IndexSet();
39
40 // index set contain checks
41 bool contains(const IndexSet &_indexset) const;
42 bool contains(const Index_t _index) const;
43
44 // comparison
45 bool operator<(const IndexSet &b) const;
46 bool operator>(const IndexSet &b) const;
47 bool operator==(const IndexSet &b) const;
48 bool operator!=(const IndexSet &b) const
49 {
50 return !(*this == b);
51 }
52
53private:
54 friend class boost::serialization::access;
55 // serialization
56 template <typename Archive>
57 void serialize(Archive& ar, const unsigned int version)
58 {
59 ar & boost::serialization::base_object< std::set<Index_t> >(*this);
60 }
61};
62
63inline bool operator==(const IndexSet::ptr &a, const IndexSet::ptr &b)
64{
65 return (*a == *b);
66}
67
68inline bool operator!=(const IndexSet::ptr &a, const IndexSet::ptr &b)
69{
70 return (*a != *b);
71}
72
73inline bool operator<(const IndexSet::ptr &a, const IndexSet::ptr &b)
74{
75 return (*a < *b);
76}
77
78inline bool operator>(const IndexSet::ptr &a, const IndexSet::ptr &b)
79{
80 return (*a > *b);
81}
82
83std::ostream & operator<<(std::ostream &ost, const IndexSet &indexset);
84
85BOOST_SERIALIZATION_SHARED_PTR(IndexSet)
86
87#endif /* INDEXSET_HPP_ */
Note: See TracBrowser for help on using the repository browser.