source: src/Fragmentation/Summation/Containers/FragmentationResultContainer.cpp@ 9eb71b3

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests AutomationFragmentation_failures Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph Fix_ChronosMutex 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_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes
Last change on this file since 9eb71b3 was 9eb71b3, checked in by Frederik Heber <frederik.heber@…>, 8 years ago

Commented out MemDebug include and Memory::ignore.

  • MemDebug clashes with various allocation operators that use a specific placement in memory. It is so far not possible to wrap new/delete fully. Hence, we stop this effort which so far has forced us to put ever more includes (with clashes) into MemDebug and thereby bloat compilation time.
  • MemDebug does not add that much usefulness which is not also provided by valgrind.
  • Property mode set to 100644
File size: 5.3 KB
Line 
1/*
2 * Project: MoleCuilder
3 * Description: creates and alters molecular systems
4 * Copyright (C) 2013 University of Bonn. All rights reserved.
5 * Copyright (C) 2013 Frederik Heber. All rights reserved.
6 *
7 *
8 * This file is part of MoleCuilder.
9 *
10 * MoleCuilder is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * MoleCuilder is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with MoleCuilder. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24/*
25 * FragmentationResultContainer.cpp
26 *
27 * Created on: Mar 8, 2013
28 * Author: heber
29 */
30
31// include config.h
32#ifdef HAVE_CONFIG_H
33#include <config.h>
34#endif
35
36//#include "CodePatterns/MemDebug.hpp"
37
38#include "FragmentationResultContainer.hpp"
39
40#include "CodePatterns/Assert.hpp"
41#include "CodePatterns/Singleton_impl.hpp"
42
43#if defined(HAVE_JOBMARKET) && defined(HAVE_VMG)
44void FragmentationResultContainer::addFullResults(
45 const KeySetsContainer &_keysets,
46 const KeySetsContainer &_forcekeysets,
47 const edges_per_fragment_t &_edges_per_fragment,
48 const shortrangedata_t &_shortrangedata,
49 const longrangedata_t &_longrangedata
50 )
51{
52 OBSERVE;
53 ASSERT( (ResultsType == BothRanges) || (keysets.KeySets.empty()),
54 "FragmentationResultContainer::addFullResults() - mixing full and short range is not in the cards.");
55 ASSERT( _keysets.KeySets.size() == _forcekeysets.KeySets.size(),
56 "FragmentationResultContainer::addFullResults() - keysets ("
57 +toString(_keysets.KeySets.size())+") and forcekeysets ("+toString(_forcekeysets.KeySets.size())
58 +") differ in size.");
59 ASSERT( _keysets.KeySets.size() == _edges_per_fragment.size(),
60 "FragmentationResultContainer::addFullResults() - keysets ("
61 +toString(_keysets.KeySets.size())+") and _edges_per_fragment ("+toString(_edges_per_fragment.size())
62 +") differ in size.");
63 ASSERT( _keysets.KeySets.size() == _shortrangedata.size(),
64 "FragmentationResultContainer::addFullResults() - keysets ("
65 +toString(_keysets.KeySets.size())+") and shortrangedata ("+toString(_shortrangedata.size())
66 +") differ in size.");
67 // there are more results for longrangedata!
68// ASSERT( _keysets.KeySets.size() == _longrangedata.size(),
69// "FragmentationResultContainer::addFullResults() - keysets ("
70// +toString(_keysets.KeySets.size())+") and longrangedata ("+toString(_longrangedata.size())
71// +") differ in size.");
72 keysets.insert(_keysets);
73 forcekeysets.insert(_forcekeysets);
74 edges_per_fragment.insert(edges_per_fragment.end(), _edges_per_fragment.begin(), _edges_per_fragment.end());
75 shortrangedata.insert(_shortrangedata.begin(), _shortrangedata.end());
76 longrangedata.insert(_longrangedata.begin(), _longrangedata.end());
77}
78#endif
79
80void FragmentationResultContainer::addShortRangeResults(
81 const KeySetsContainer &_keysets,
82 const KeySetsContainer &_forcekeysets,
83 const edges_per_fragment_t &_edges_per_fragment,
84 const shortrangedata_t &_shortrangedata
85 )
86{
87 OBSERVE;
88 ASSERT( (ResultsType == ShortRangeOnly) || (keysets.KeySets.empty()),
89 "FragmentationResultContainer::addFullResults() - mixing full and short range is not in the cards.");
90 ASSERT( _keysets.KeySets.size() == _forcekeysets.KeySets.size(),
91 "FragmentationResultContainer::addFullResults() - keysets ("
92 +toString(_keysets.KeySets.size())+") and forcekeysets ("+toString(_forcekeysets.KeySets.size())
93 +") differ in size.");
94 ASSERT( _keysets.KeySets.size() == _edges_per_fragment.size(),
95 "FragmentationResultContainer::addFullResults() - keysets ("
96 +toString(_keysets.KeySets.size())+") and _edges_per_fragment ("+toString(_edges_per_fragment.size())
97 +") differ in size.");
98 ASSERT( _keysets.KeySets.size() == _shortrangedata.size(),
99 "FragmentationResultContainer::addFullResults() - keysets ("
100 +toString(_keysets.KeySets.size())+") and shortrangedata ("+toString(_shortrangedata.size())
101 +") differ in size.");
102 // deteriorate to short range only
103 ResultsType = ShortRangeOnly;
104 keysets.insert(_keysets);
105 forcekeysets.insert(_forcekeysets);
106 edges_per_fragment.insert(edges_per_fragment.end(), _edges_per_fragment.begin(), _edges_per_fragment.end());
107 shortrangedata.insert(_shortrangedata.begin(), _shortrangedata.end());
108}
109
110void FragmentationResultContainer::addShortRangeSummedResults(
111 const FragmentationShortRangeResults::summedshortrange_t &_summedshortrange
112 )
113{
114 OBSERVE;
115 summedshortrange.insert(_summedshortrange.begin(), _summedshortrange.end());
116}
117
118#if defined(HAVE_JOBMARKET) && defined(HAVE_VMG)
119const FragmentationResultContainer::longrangedata_t&
120FragmentationResultContainer::getLongRangeResults() const
121{
122 ASSERT( ResultsType == BothRanges,
123 "FragmentationResultContainer::getLongRangeResults() - access although storing only short range.");
124 return longrangedata;
125}
126#endif
127
128CONSTRUCT_SINGLETON(FragmentationResultContainer)
Note: See TracBrowser for help on using the repository browser.