Changeset fc08c7


Ignore:
Timestamp:
Oct 3, 2016, 6:03:48 PM (8 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Fix_FitPotential_needs_atomicnumbers
Children:
6cfb22a
Parents:
fdd789
Message:

ATTEMPT: Tried to add all subgraph in graph finding to Extractors::reorderArg..().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/FunctionApproximation/Extractors.cpp

    rfdd789 rfc08c7  
    157157}
    158158
     159static std::vector<PotentialGraph>
     160findSubgraphsInPotentialGraph(const PotentialGraph &_graph, const PotentialGraph &_subgraph)
     161{
     162  std::vector<PotentialGraph> list_of_subgraphs;
     163
     164  return list_of_subgraphs;
     165}
     166
     167
    159168FunctionModel::list_of_arguments_t Extractors::reorderArgumentsByParticleTypes(
    160169    const FunctionModel::list_of_arguments_t &listargs,
     
    197206    LOG(4, "DEBUG: Created unique types as keys " << UniqueTypes << ".");
    198207
     208    /// take the (filtered) list of args and convert into graph
     209    PotentialGraph fragmentgraph;
     210    for(FunctionModel::arguments_t::const_iterator iter = args.begin();
     211        iter != args.end(); ++iter)
     212      fragmentgraph.add_edge( static_cast<const SubgraphEdge&>(*iter));
     213
     214    /// find all subgraphs to the given potential subgraph
     215    std::vector<PotentialGraph > list_of_subgraphs =
     216        findSubgraphsInPotentialGraph(fragmentgraph, _subgraph);
     217
     218    /// convert into tuples with each subgraph sorted by _types
     219
     220//    /// turn fragment into graph from the known edges
     221//    boost::adjacency_list<> fragmentgraph(_types.size());
     222//    boost::property_map < boost::adjacency_list <>, ParticleType_t > types_map;
     223//    typedef typename boost::graph_traits<Graph>::vertex_descriptor Vertex;
     224//    typedef typename boost::graph_traits<Graph>::edge_descriptor Edge;
     225//    for(FunctionModel::arguments_t::const_iterator iter = args.begin();
     226//        iter != args.end(); ++iter) {
     227//      std::pair<Edge, bool> inserter =
     228//          boost::add_edge(iter->indices.first, iter->indices.second, fragmentgraph);
     229//      ASSERT( inserter.second,
     230//          "Extractors::reorderArgumentsByParticleTypes() - cannot insert edge between "
     231//          +toString(iter->indices.first)+" and "+toString(iter->indices.second));
     232//      // add type to property map
     233//      Vertex u = boost::source(inserter.first,fragmentgraph);
     234//      boost::put(types_map, u, iter->types.first);
     235//      Vertex v = boost::source(inserter.first,fragmentgraph);
     236//      boost::put(types_map, v, iter->types.second);
     237//    }
     238//    // create property map with index
     239//    boost::property_map < boost::adjacency_list <>, boost::vertex_index_t >::type
     240//        index_map = boost::get(boost::vertex_index, fragmentgraph);
     241//
     242//    // use list of types to obtain all possible candidate graphs
     243//
     244//    // compare candidate graph with potential's subgraph
     245//
     246//    // ensure uniqueness of candidate graphs
     247//
     248//    // step through every vertex
     249//    boost::graph_traits < boost::adjacency_list <> >::vertex_iterator i, end;
     250//    for (boost::tie(i, end) = boost::vertices(fragmentgraph); i != end; ++i) {
     251//      // step through every adjacent vertex
     252//      boost::graph_traits < boost::adjacency_list <> >::adjacency_iterator ai, a_end;
     253//      boost::tie(ai, a_end) = boost::adjacent_vertices(*i, fragmentgraph);
     254//      for (; ai != a_end; ++ai) {
     255//        // look ahead at next vertex
     256//        if (boost::next(ai) != a_end) {}
     257//      }
     258//    }
    199259
    200260    /// Finally, we use the unique key list to pick corresponding arguments from the map
Note: See TracChangeset for help on using the changeset viewer.