Changeset 966ce7 for src


Ignore:
Timestamp:
Jul 12, 2017, 7:10:32 PM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Action_Thermostats, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, AutomationFragmentation_failures, Candidate_v1.6.1, ChemicalSpaceEvaluator, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Exclude_Hydrogens_annealWithBondGraph, Fix_Verbose_Codepatterns, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, Gui_displays_atomic_force_velocity, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, PythonUI_with_named_parameters, Recreated_GuiChecks, StoppableMakroAction, TremoloParser_IncreasedPrecision
Children:
e0b960
Parents:
e3ec8a8
git-author:
Frederik Heber <frederik.heber@…> (05/19/17 14:28:28)
git-committer:
Frederik Heber <frederik.heber@…> (07/12/17 19:10:32)
Message:

BreadthFirstSearchGatherer::getDistances() added.

Location:
src/Graph
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Graph/BreadthFirstSearchGatherer.cpp

    re3ec8a8 r966ce7  
    111111
    112112  // any node was discovered whose distances is less than num_vertices+1
     113  distance_map.clear();
    113114  const BoostGraphCreator::const_name_map_t name_map = boost::get(boost::vertex_name, BGgraph);
    114115  BoostGraphCreator::vertex_iter vp, vpend;
     
    117118    if (distances[v] != (num_vertices+1)) {
    118119      returnids.push_back( boost::get(name_map, v) );
     120      distance_map.insert( std::make_pair(boost::get(name_map, v), distances[v]) );
    119121    }
    120122  }
  • src/Graph/BreadthFirstSearchGatherer.hpp

    re3ec8a8 r966ce7  
    1515#endif
    1616
     17#include <map>
    1718#include <stddef.h>
    1819#include <vector>
     
    2728struct BreadthFirstSearchGatherer
    2829{
     30  //!> typedef for the distance map to the obtained atomic id set.
     31  typedef std::map<atomId_t, size_t> distance_map_t;
     32
    2933  /** Cstor of class BreadthFirstSearchGatherer.
    3034   *
     
    4347      const int &_max_distance = -1);
    4448
     49  /** Getter to the internal map of distances of each atomic id.
     50   *
     51   * \return ref to distance map
     52   */
     53  const distance_map_t& getDistances() const
     54  { return distance_map; }
     55
    4556private:
    46   //!> typedef for a vector with BFS discovery distances
     57  //!> typedef for a vector of BFS discovery distances
    4758  typedef std::vector<size_t> distances_t;
     59
     60  //!> BFS discovery distances for the returned atomic id set
     61  distance_map_t distance_map;
    4862
    4963  //!> graph to operate on
Note: See TracChangeset for help on using the changeset viewer.