ForceAnnealing_oldresults
        IndependentFragmentGrids_IntegrationTest
      
      
        
          | Last change
 on this file since 41eed2 was             6e5907, checked in by Frederik Heber <frederik.heber@…>, 8 years ago | 
        
          | 
Extracted extraction (subset of) nodes from BoostGraph into BreadthFirstSearchGatherer.
 also added helper namespace BoostGraphHelpers.
we now treat the vertex indices and vertex names properly. Before that they
had to coincide. Now, the name is the atomic id associated with the node
and the index is the boost::graph internal index.
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            1.0 KB | 
      
      
| Line |  | 
|---|
| 1 | /* | 
|---|
| 2 | * BreadthFirstSearchGatherer.hpp | 
|---|
| 3 | * | 
|---|
| 4 | *  Created on: May 17, 2017 | 
|---|
| 5 | *      Author: heber | 
|---|
| 6 | */ | 
|---|
| 7 |  | 
|---|
| 8 |  | 
|---|
| 9 | #ifndef GRAPH_BREADTHFIRSTSEARCHGATHERER_HPP_ | 
|---|
| 10 | #define GRAPH_BREADTHFIRSTSEARCHGATHERER_HPP_ | 
|---|
| 11 |  | 
|---|
| 12 | // include config.h | 
|---|
| 13 | #ifdef HAVE_CONFIG_H | 
|---|
| 14 | #include <config.h> | 
|---|
| 15 | #endif | 
|---|
| 16 |  | 
|---|
| 17 | #include <stddef.h> | 
|---|
| 18 | #include <vector> | 
|---|
| 19 |  | 
|---|
| 20 | #include "types.hpp" | 
|---|
| 21 |  | 
|---|
| 22 | struct BoostGraphCreator; | 
|---|
| 23 |  | 
|---|
| 24 | /** This struct performs a BFS on a given boost::graph and finds | 
|---|
| 25 | * all nodes, i.e. atoms, up to a given limit. | 
|---|
| 26 | */ | 
|---|
| 27 | struct BreadthFirstSearchGatherer | 
|---|
| 28 | { | 
|---|
| 29 | /** Cstor of class BreadthFirstSearchGatherer. | 
|---|
| 30 | * | 
|---|
| 31 | * \param _graph graph to work on | 
|---|
| 32 | */ | 
|---|
| 33 | BreadthFirstSearchGatherer(BoostGraphCreator &_graph); | 
|---|
| 34 |  | 
|---|
| 35 | /** Discovers all nodes from the given \a _discoverfrom and returns | 
|---|
| 36 | * the vector of ids. | 
|---|
| 37 | */ | 
|---|
| 38 | std::vector<atomId_t> operator()(const atomId_t &_discoverfrom); | 
|---|
| 39 |  | 
|---|
| 40 | private: | 
|---|
| 41 | //!> typedef for a vector with BFS discovery distances | 
|---|
| 42 | typedef std::vector<size_t> distances_t; | 
|---|
| 43 |  | 
|---|
| 44 | //!> graph to operate on | 
|---|
| 45 | BoostGraphCreator &BGcreator; | 
|---|
| 46 | }; | 
|---|
| 47 |  | 
|---|
| 48 |  | 
|---|
| 49 | #endif /* GRAPH_BREADTHFIRSTSEARCHGATHERER_HPP_ */ | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.