utils.hpp 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /**
  2. * @file tests/boost_graph/partitioning/utils.hpp
  3. * @author The PARADEVS Development Team
  4. * See the AUTHORS or Authors.txt file
  5. */
  6. /*
  7. * PARADEVS - the multimodeling and simulation environment
  8. * This file is a part of the PARADEVS environment
  9. *
  10. * Copyright (C) 2013 ULCO http://www.univ-litoral.fr
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation, either version 3 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. */
  25. #ifndef TESTS_BOOST_GRAPH_PARTITIONING_UTILS_H
  26. #define TESTS_BOOST_GRAPH_PARTITIONING_UTILS_H 1
  27. #include <tests/boost_graph/partitioning/defs.hpp>
  28. namespace paradevs { namespace tests { namespace boost_graph {
  29. void Global_Neigh_community(UnorientedGraph *g,
  30. const EntiersEntiers &Partition,
  31. Entiers *community, int vertex, int comm_in);
  32. OrientedGraphs Graph_Partition(const EntiersEntiers &Partition,
  33. OrientedGraph *go,
  34. UnorientedGraph *g,
  35. OutputEdgeList &outputedgelist,
  36. InputEdgeList &inputedgelist,
  37. Connections &connections);
  38. void List_edge_partie(Entiers *Partie, OrientedGraph *go, Edges &edge_partie,
  39. OutputEdges &outputedgespartie);
  40. void construire_graph(UnorientedGraph *g, OrientedGraph *graph);
  41. double Modif_Cut_one_cluster(Entiers &cluster, UnorientedGraph &g, double &vol);
  42. std::vector<double> modif_cut_tmp(UnorientedGraph *g, EntiersEntiers &Partition,
  43. std::vector<std::vector<double> > tabe_cut,
  44. int vertexs,
  45. int comm_in, Entiers community, double cut,
  46. std::string name);
  47. double Calcul_poids(Entiers *partie, UnorientedGraph *g);
  48. bool Est_connexe(UnorientedGraph *g, EntiersEntiers Partition, Entiers &part);
  49. void Affinage_equilibrage_charge(UnorientedGraph *g, EntiersEntiers &Partition);
  50. Entiers Neigh_community(UnorientedGraph *g, EntiersEntiers &Partition,
  51. int vertex, int comm_in);
  52. void Modif_fonction_Gain_Cut(EntiersEntiers &Partition,UnorientedGraph *g,
  53. Entiers &community, int val, double &cut,
  54. std::string name);
  55. void Affinage_recherche_locale(UnorientedGraph *g, EntiersEntiers &Partition,
  56. double &cut, std::string name);
  57. void projection(EntiersEntiers &Partition,ListEntiersEntiers::iterator lit);
  58. bool contraction_HEM(UnorientedGraph *g, Base_Graph &baseg,
  59. ListEntiersEntiers &liste_corr, int val_reduc,
  60. int &val_cpt);
  61. bool contraction_Random_Maching(UnorientedGraph *g, Base_Graph &baseg,
  62. ListEntiersEntiers &liste_corr, int val_reduc,
  63. int &val_cpt);
  64. Entiers Liste_adjacence(UnorientedGraph &g, int vertexs,
  65. const Entiers &random_vertices);
  66. int rand_fini(int a, int b);
  67. int recherche_val2(const std::vector<float> &tab,float val);
  68. int recherche_val_double(const std::vector<double> &tab,double val);
  69. int recherche_val(const std::vector<int> &tab,int val);
  70. int dichotomie(const Entiers &tab,int i);
  71. void suprim_val(Entiers &tab,int i);
  72. bool In_tab(const Entiers &tab, int val);
  73. bool In_tab_dichotomie(const Entiers &tab, int val);
  74. double Cut_cluster(const EntiersEntiers &tab_cluster,UnorientedGraph &g,
  75. std::string name);
  76. void Modif_fonction_Gain_Cut(EntiersEntiers &Partition,UnorientedGraph *g,
  77. int community_out,int community_in,int val,
  78. double &cut);
  79. void Liste_Voisin(const Entiers &P,Entiers &tab,const UnorientedGraph &g);
  80. int Cout_coupe(Entiers P,int val, UnorientedGraph &g);
  81. double Cout_coupe_pond(Entiers P,int val, UnorientedGraph &g);
  82. int In_community_dichotomie(const EntiersEntiers &part, int val);
  83. double Degree(UnorientedGraph &g , int node);
  84. double Cluster_Degree(UnorientedGraph &g , const Entiers &cluster);
  85. void make_unoriented_graph(const OrientedGraph& og, UnorientedGraph& uog);
  86. void adjacence_ggp(int vertex, Entiers &sommets_adj, UnorientedGraph *g);
  87. float modif_Cout_coupe(const Entiers &P, int val, float cut, UnorientedGraph *g);
  88. } } } // namespace paradevs tests boost_graph
  89. #endif