Salome HOME
For med file version, no more use of static macro but use dynamic lib for users using...
[tools/medcoupling.git] / src / MEDPartitioner / MEDPARTITIONER_Graph.cxx
index 62a273a6a1738643e3f21db967b74a482117ad4e..ef0914168def5f5df0c718ca96b3181cf3394cee 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 
 #include "MEDPARTITIONER_Graph.hxx"
 
+#include "MEDCouplingSkyLineArray.hxx"
+
 #include <set>
 
-MEDPARTITIONER::Graph::Graph(ParaMEDMEM::MEDCouplingSkyLineArray *array, int *edgeweight):_graph(array),_partition(0),_edge_weight(edgeweight),_cell_weight(0)
+MEDPARTITIONER::Graph::Graph(MEDCoupling::MEDCouplingSkyLineArray *array, int *edgeweight):_graph(array),_partition(0),_edge_weight(edgeweight),_cell_weight(0)
 {
 }
 
@@ -35,10 +37,20 @@ int MEDPARTITIONER::Graph::nbDomains() const
 {
   std::set<int> domains;
   if ( _partition )
-    if ( ParaMEDMEM::DataArrayInt* array = _partition->getValueArray() )
+    if ( MEDCoupling::DataArrayInt* array = _partition->getValueArray() )
     {
       for ( const int * dom = array->begin(); dom != array->end(); ++dom )
         domains.insert( *dom );
     }
   return domains.size();
 }
+
+const int *MEDPARTITIONER::Graph::getPart() const
+{
+  return _partition->getValue();
+}
+
+int MEDPARTITIONER::Graph::nbVertices() const
+{
+  return _graph->getNumberOf();
+}