Ignore:
Timestamp:
Oct 3, 2016, 11:13:52 AM (9 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Fix_FitPotential_needs_atomicnumbers
Children:
11bab4
Parents:
be20db
git-author:
Frederik Heber <heber@…> (10/03/16 11:13:49)
git-committer:
Frederik Heber <heber@…> (10/03/16 11:13:52)
Message:

Added getSubgraph() to all EmpiricalPotentials.

  • this encodes the specific bonding structure which this potential represents and which allows finding all(!) subgraphs within the fragment graph in the correct manner.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/FunctionApproximation/Extractors.cpp

    rbe20db r0b7036  
    4343#include <boost/bind.hpp>
    4444#include <boost/foreach.hpp>
     45#include <boost/graph/adjacency_list.hpp>
    4546
    4647#include "CodePatterns/Assert.hpp"
     
    195196    }
    196197    LOG(4, "DEBUG: Created unique types as keys " << UniqueTypes << ".");
     198
     199    /// turn fragment into graph from the known edges
     200    boost::adjacency_list<> fragmentgraph(_types.size());
     201    for(FunctionModel::arguments_t::const_iterator iter = args.begin();
     202        iter != args.end(); ++iter)
     203      boost::add_edge(iter->indices.first, iter->indices.second, fragmentgraph);
     204    boost::graph_traits < boost::adjacency_list <> >::vertex_iterator i, end;
     205    boost::graph_traits < boost::adjacency_list <> >::adjacency_iterator ai, a_end;
     206    boost::property_map < boost::adjacency_list <>, boost::vertex_index_t >::type
     207        index_map = boost::get(boost::vertex_index, fragmentgraph);
    197208
    198209    /// Finally, we use the unique key list to pick corresponding arguments from the map
Note: See TracChangeset for help on using the changeset viewer.