Ignore:
Timestamp:
Jun 7, 2015, 4:05:46 PM (4 years ago)
Author:
nmedfort
Message:

More multiplexing work. Reduced MWIS approximation cost.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/optimizers/pablo_automultiplexing.hpp

    r4598 r4599  
    99#include <boost/graph/edge_list.hpp>
    1010#include <boost/container/flat_map.hpp>
     11#include <boost/container/flat_set.hpp>
    1112#include <boost/numeric/ublas/matrix.hpp>
    1213#include <random>
     
    2425    using PathGraph = boost::adjacency_matrix<boost::undirectedS>;
    2526    using MultiplexSetGraph = boost::adjacency_list<boost::hash_setS, boost::vecS, boost::bidirectionalS>;
    26     using IndependentSetGraph = boost::adjacency_list<boost::hash_setS, boost::listS, boost::undirectedS, std::tuple<int, int, MultiplexSetGraph::vertex_descriptor>>;
    27     using ChosenSet = std::vector<MultiplexSetGraph::vertex_descriptor>;
     27    using IndependentSetGraph = boost::adjacency_matrix<boost::undirectedS, std::pair<int, int>>;
     28    using ChosenSet = boost::container::flat_set<MultiplexSetGraph::vertex_descriptor>;
    2829    using SubsetGraph = boost::adjacency_list<boost::hash_setS, boost::vecS, boost::bidirectionalS>;
    2930    using Advances = std::vector<Advance *>;
     
    4445    void createMultiplexSetGraph();
    4546    bool generateMultiplexSets(RNG & rng);   
    46     void addMultiplexSet(const IndependentSet & N, const IndependentSet & S);
    47     void addMultiplexSet(const IndependentSet & N, const int i, const IndependentSet & S, const int j);
     47    void addMultiplexSet(const IndependentSet & N, const IndependentSet & M);
     48    void addMultiplexSet(const IndependentSet & N, int i, const IndependentSet & M, int j, ChosenSet & S);
    4849    void approxMaxWeightIndependentSet(RNG & rng);
    4950    void applySubsetConstraints();
     
    5152    void topologicalSort(PabloBlock & entry) const;
    5253    inline AutoMultiplexing()
    53     : mPathGraph(0) {
     54    : mPathGraph(0)
     55    {
    5456    }
    5557private:
     
    7375    Advances                mAdvance;   
    7476    MultiplexSetGraph       mMultiplexSetGraph;
    75     ChosenSet               mCurrentCombination;
    7677};
    7778
Note: See TracChangeset for help on using the changeset viewer.