Changeset c4afdf3
- Timestamp:
- May 19, 2021, 7:06:29 PM (4 years ago)
- Branches:
- Candidate_v1.7.0, stable
- Children:
- 15fc6a
- Parents:
- 3f8238
- git-author:
- Frederik Heber <frederik.heber@…> (05/14/21 21:14:53)
- git-committer:
- Frederik Heber <frederik.heber@…> (05/19/21 19:06:29)
- Location:
- src
- Files:
- 
      - 2 added
- 4 edited
 
 - 
          
  Fragmentation/Homology/HomologyGraph.hpp (modified) (1 diff)
- 
          
  Potentials/BindingModel.cpp (modified) (1 diff)
- 
          
  Potentials/BindingModel.hpp (modified) (1 diff)
- 
          
  Potentials/unittests/BindingModelUnitTest.cpp (added)
- 
          
  Potentials/unittests/BindingModelUnitTest.hpp (added)
- 
          
  Potentials/unittests/Makefile.am (modified) (4 diffs)
 
Legend:
- Unmodified
- Added
- Removed
- 
      src/Fragmentation/Homology/HomologyGraph.hppr3f8238 rc4afdf3 127 127 } 128 128 129 /** Checks whether this graph contains the given \a graph. 130 * 131 * Every edge must be present in this graph. 132 * 133 * \return true - graph is contained, false - else 134 */ 135 bool contains(const HomologyGraph &graph) const { 136 for (edges_t::const_iterator iter = graph.edges.begin(); iter != graph.edges.end(); ++iter) { 137 edges_t::const_iterator finditer = edges.find(iter->first); 138 if (finditer == edges.end()) 139 return false; 140 else if (finditer->second < iter->second) 141 return false; 142 } 143 return true; 144 } 145 129 146 /** Checks whether this graph has \b exactly \a _times nodes with \a _number 130 147 * atomic number. 
- 
      src/Potentials/BindingModel.cppr3f8238 rc4afdf3 58 58 {} 59 59 60 bool BindingModel::operator<(const BindingModel &model) const { 61 if (graph.getEdges().empty()) { 62 return nodes < model.nodes; 63 } else 64 return graph.getEdges() < model.graph.getEdges(); 65 } 60 66 67 bool BindingModel::operator>(const BindingModel &model) const { 68 if (graph.getEdges().empty()) { 69 return nodes > model.nodes; 70 } else 71 return graph.getEdges() > model.graph.getEdges(); 72 } 73 74 bool BindingModel::operator==(const BindingModel &model) const { 75 if (graph.getEdges().empty()) { 76 return nodes == model.nodes; 77 } else 78 return graph.getEdges() == model.graph.getEdges(); 79 } 80 
- 
      src/Potentials/BindingModel.hppr3f8238 rc4afdf3 55 55 const vector_nodes_t& getNodes() const { return nodes; } 56 56 57 // comparators (allows sorting and hence quicker finding in STL containers) 58 bool operator<(const BindingModel &model) const; 59 bool operator>(const BindingModel &model) const; 60 bool operator==(const BindingModel &model) const; 61 bool operator!=(const BindingModel &model) const { 62 return (!(*this == model)); 63 } 64 57 65 private: 58 66 //!> the homology graph of this binding model 
- 
      src/Potentials/unittests/Makefile.amr3f8238 rc4afdf3 3 3 4 4 POTENTIALSTESTSSOURCES = \ 5 ../Potentials/unittests/BindingModelUnitTest.cpp \ 5 6 ../Potentials/unittests/CompoundPotentialUnitTest.cpp \ 6 7 ../Potentials/unittests/PartialNucleiChargeFitterUnitTest.cpp \ … … 8 9 9 10 POTENTIALSTESTSHEADERS = \ 11 ../Potentials/unittests/BindingModelUnitTest.hpp \ 10 12 ../Potentials/unittests/CompoundPotentialUnitTest.hpp \ 11 13 ../Potentials/unittests/PartialNucleiChargeFitterUnitTest.hpp \ … … 13 15 14 16 POTENTIALSTESTS = \ 17 BindingModelUnitTest \ 15 18 CompoundPotentialUnitTest \ 16 19 PartialNucleiChargeFitterUnitTest \ … … 29 32 $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \ 30 33 $(BOOST_LIB) 34 35 BindingModelUnitTest_SOURCES = \ 36 ../Potentials/unittests/BindingModelUnitTest.cpp \ 37 ../Potentials/unittests/BindingModelUnitTest.hpp 38 BindingModelUnitTest_LDADD = \ 39 ${POTENTIALSLIBS} \ 40 ../libMolecuilderFragmentation.la \ 41 ../libMolecuilderFragmentation_getFromKeysetStub.la 31 42 32 43 CompoundPotentialUnitTest_SOURCES = \ 
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  
