Ignore:
Timestamp:
Jun 21, 2018, 9:12:08 AM (7 years ago)
Author:
Frederik Heber <frederik.heber@…>
Children:
a951f3
Parents:
8d56a6
git-author:
Frederik Heber <frederik.heber@…> (09/26/17 22:30:01)
git-committer:
Frederik Heber <frederik.heber@…> (06/21/18 09:12:08)
Message:

Added Graph6Reader, extended BoostGraphCreator, added ChemicalSpaceEvaluatorAction.

  • TESTS: due to new option "graph6" containing a digit we needed to modify moltest_check.py to also scan for digits and not just letters.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/FunctionApproximation/Extractors.hpp

    r8d56a6 rd83d64  
    5151  typedef std::vector<ParticleType_t> ParticleTypes_t;
    5252
     53  typedef size_t level_t;
     54  typedef size_t node_t;
     55  typedef std::multimap< level_t, node_t > nodes_per_level_t;
     56  typedef std::set<node_t> nodes_t;
     57  typedef std::set<nodes_t> set_of_nodes_t;
     58  typedef boost::property_map < boost::adjacency_list <>, boost::vertex_index_t >::type index_map_t;
     59
     60  typedef boost::bimap<
     61      boost::bimaps::set_of< size_t >,
     62      boost::bimaps::multiset_of< Extractors::ParticleType_t >
     63  > type_index_lookup_t;
     64
     65  typedef std::set<node_t> set_type;
     66  typedef std::set<set_type> powerset_type;
     67
     68  typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::undirectedS,
     69      boost::no_property, boost::no_property > UndirectedGraph;
     70  typedef boost::subgraph< UndirectedGraph > UndirectedSubgraph;
     71
     72  typedef std::map< node_t, std::pair<Extractors::ParticleType_t, size_t> > node_FragmentNode_map_t;
     73
     74  typedef std::map< argument_t::indices_t, size_t> argument_placement_map_t;
     75
     76  typedef std::map<size_t, size_t> argindex_to_nodeindex_t;
     77
     78  /**
     79   * I have no idea why this is so complicated with BGL ...
     80   *
     81   * This is taken from the book "The Boost Graph Library: User Guide and Reference Manual, Portable Documents",
     82   * chapter "Basic Graph Algorithms", example on calculating the bacon number.
     83   */
     84  template <typename DistanceMap>
     85  class distance_recorder : public boost::default_bfs_visitor
     86  {
     87  public:
     88    distance_recorder(DistanceMap dist) : d(dist) {}
     89
     90    template <typename Edge, typename Graph>
     91    void tree_edge(Edge e, const Graph &g) const {
     92      typename boost::graph_traits<Graph>::vertex_descriptor u = source(e,g), v = target(e,g);
     93      d[v] = d[u] + 1;
     94    }
     95
     96  private:
     97    DistanceMap d;
     98  };
     99
     100  template <typename DistanceMap>
     101  distance_recorder<DistanceMap> record_distance(DistanceMap d)
     102  {
     103    return distance_recorder<DistanceMap>(d);
     104  }
     105
     106  HomologyGraph createHomologyGraphFromNodes(
     107      const nodes_t &nodes,
     108      const type_index_lookup_t &type_index_lookup,
     109      const UndirectedGraph &graph,
     110      const index_map_t &index_map
     111      );
     112
     113  void generateAllInducedConnectedSubgraphs(
     114      const size_t N,
     115      const level_t level,
     116      const nodes_t &nodes,
     117      set_of_nodes_t &set_of_nodes,
     118      const nodes_per_level_t &nodes_per_level,
     119      const UndirectedGraph &graph,
     120      const std::vector<size_t> &_distance,
     121      const index_map_t &index_map);
     122
    53123  /** Namespace for some internal helper functions.
    54124   *
Note: See TracChangeset for help on using the changeset viewer.