.. _program_listing_file_src_partition_coarsen.h: Program Listing for File coarsen.h ================================== |exhale_lsh| :ref:`Return to documentation for file ` (``src/partition/coarsen.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef COARSEN_H #define COARSEN_H #include "defs.h" #include "evaluator.h" #include "tools.h" using namespace std; enum class CoarsenOrder { RANDOM, DEGREE, SIZE, TIMING, DEFAULT }; struct ContractedHyperedgeInformation { int he = -1; unsigned long long hash = 42ULL; size_t size = std::numeric_limits:: max(); bool valid = false; }; class MultilevelCoarsener { private: const fpga &fpgas; int fpga_num; int index; int multilevel_id = 0; bool has_fix; bool has_region; bool has_io; bool force_topo; bool has_timing; int large_net_threshold; int beta; double coarsening_ratio; int coarsen_method = 1; int enable_weight_penalty = 0; int thr_coarsen_vertice; int seed = 0; int thread; VectorXi resources_in_one_FPGA; CoarsenOrder coarsen_order = CoarsenOrder::SIZE; kahypar::SparseMap score_map; kahypar::SparseMap matched_score_map; vector tmp_nets; vector tmp_incident_nodes; vector> hyperedge_cluster_id_vec_maps; // float timing_exp_factor; // float net_timing_factor_coarse; // shared_ptr evaluator = nullptr; void calTimingPathForGroup( const vector &timing_paths, const vector &map, const vector &hyperedge_cluster_id_vec, graph &coarse, vector &timing_paths_c, vector> &ins_paths_c, flat_hash_map>> &net_insPin_set_c); void computeGroupGraph(const graph &finest, int index, const vector &group_map, graph &coarse); void candidatePropagation(); set intersection(const set &set1, const set &set2); void coarsening(int l); void contraction(int l); void parallelContraction(int l); public: int level; vector isolated_nodes; vector graphs; vector> maps; vector> map2origins; int buildGroupedGraph(const graph &finest, int group_count, const vector &group_map, graph &grouped); void deduplicateHyperedges(graph &finest); void setCoarsenOrder(int s); void setMultilevelId(int id); int getMultilevelId() const; int COCP_coarsen(const graph &finest, vector> &candidate_parts, int thr_ilp); MultilevelCoarsener(const graph &finest, const fpga &fpgas, const PartitionConstraintConfig &constraints, const CoarsenConfig &config, int thread); void multilevelCoarsening(const graph &finest); }; #endif