]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
CLEAN-UP 2
authorageay <ageay>
Tue, 13 Mar 2012 15:18:56 +0000 (15:18 +0000)
committerageay <ageay>
Tue, 13 Mar 2012 15:18:56 +0000 (15:18 +0000)
src/MEDPartitioner/MEDPARTITIONER_Graph.cxx
src/MEDPartitioner/MEDPARTITIONER_Graph.hxx
src/MEDPartitioner/MEDPARTITIONER_MetisGraph.cxx
src/MEDPartitioner/MEDPARTITIONER_ScotchGraph.cxx

index b94e531b2652a8d80b4eadd019cb38ef5883bd48..c6d67b0577be1795907fb30d17e7fbfe06fb996c 100644 (file)
 
 #include "MEDPARTITIONER_Graph.hxx"
 
-using namespace MEDPARTITIONER;
-
-Graph::Graph(MEDPARTITIONER::SkyLineArray* array, int* edgeweight):_graph(array),_partition(0),_edgeweight(edgeweight),_cellweight(0)
+MEDPARTITIONER::Graph::Graph(MEDPARTITIONER::SkyLineArray *array, int *edgeweight):_graph(array),_partition(0),_edge_weight(edgeweight),_cell_weight(0)
 {
 }
 
-//================================================================================
-/*!
- * \brief Destructor
- */
-//================================================================================
-
-Graph::~Graph()
+MEDPARTITIONER::Graph::~Graph()
 {
-  if (_partition)
-    {
-      delete _partition;
-      _partition=0;
-    }
-  if (_graph)
-    {
-      delete _graph;
-      _graph=0;
-    }
+  delete _partition;
+  delete _graph;
 }
-
index 2aa4f81fd8ce73457b29da0dabb4dc41bfd0c139..d36fb0c64546f9c86b07a86a0a08f2fdf281588d 100644 (file)
@@ -33,32 +33,30 @@ namespace MEDPARTITIONER
   public:
     typedef enum {METIS,SCOTCH} splitter_type;
 
-    Graph()
-    {
-    }
+    Graph() { }
     //creates a graph from a SKYLINEARRAY
     Graph(MEDPARTITIONER::SkyLineArray* graph, int* edgeweight=0);
     virtual ~Graph();
 
-    void setEdgesWeights(int* edgeweight){_edgeweight=edgeweight;}
-    void setVerticesWeights(int* cellweight){_cellweight=cellweight;}
+    void setEdgesWeights(int *edgeweight) { _edge_weight=edgeweight; }
+    void setVerticesWeights(int *cellweight) { _cell_weight=cellweight; }
     
     //computes partitioning of the graph
-    virtual void partGraph(int ndomain, const std::string&, ParaDomainSelectorsel=0) = 0;
+    virtual void partGraph(int ndomain, const std::string&, ParaDomainSelector *sel=0) = 0;
     
     //returns the partitioning
-    const int* getPart() const {return _partition->getValue();}
+    const int *getPart() const { return _partition->getValue(); }
     
     //returns the number of graph vertices (which can correspond to the cells in the mesh!)
-    int nbVertices() const {return _graph->getNumberOf();}
+    int nbVertices() const { return _graph->getNumberOf(); }
     
-    const MEDPARTITIONER::SkyLineArray* getGraph() const {return _graph;}
+    const SkyLineArray *getGraph() const { return _graph; }
 
   protected:
-    MEDPARTITIONER::SkyLineArray* _graph;
-    MEDPARTITIONER::SkyLineArray* _partition;
-    int* _edgeweight;  
-    int* _cellweight;
+    SkyLineArray* _graph;
+    SkyLineArray* _partition;
+    int* _edge_weight;  
+    int* _cell_weight;
   };
 }
 #endif
index 96b8464a3e5b6dd92d5346d37d72d36130625c6f..fe07e8ad4bc37d6cf0b68763fb13eb896d9ae764 100644 (file)
@@ -69,9 +69,9 @@ void METISGraph::partGraph(int ndomain,
   int * xadj=const_cast<int*>(_graph->getIndex());
   int * adjncy=const_cast<int*>(_graph->getValue());
   //constraints
-  int * vwgt=_cellweight;
-  int * adjwgt=_edgeweight;
-  int wgtflag=(_edgeweight!=0)?1:0+(_cellweight!=0)?2:0;
+  int * vwgt=_cell_weight;
+  int * adjwgt=_edge_weight;
+  int wgtflag=(_edge_weight!=0)?1:0+(_cell_weight!=0)?2:0;
   //base 0 or 1
   int base=0;
   //ndomain
index b8f0a443c58bbcb5cb9208c263b952074e29a7b3..bdeef3275705d6fe5191ca113c394c7f7f9ea453 100644 (file)
@@ -70,11 +70,11 @@ void SCOTCHGraph::partGraph(int ndomain, const std::string& options_string, Para
                     n, // nb of graph nodes
                     xadj,
                     0,
-                    _cellweight, //graph vertices loads
+                    _cell_weight, //graph vertices loads
                     0,
                     xadj[n], // number of edges
                     adjncy,
-                    _edgeweight);
+                    _edge_weight);
 
   SCOTCH_Strat scotch_strategy;           
   SCOTCH_stratInit(&scotch_strategy);