X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDPartitioner%2FMEDPARTITIONER_Graph.cxx;h=17df2fc01d8ef31d709b0f7cbfbd1d76dbf9e71c;hb=bb91878b3fb670041c09ea7aefce3132e157b126;hp=8ae65517b7524ad748fdc40befd474f2cb1e0121;hpb=1e36a6710aab710674e20fbd89f6a9a8f238c023;p=tools%2Fmedcoupling.git diff --git a/src/MEDPartitioner/MEDPARTITIONER_Graph.cxx b/src/MEDPartitioner/MEDPARTITIONER_Graph.cxx index 8ae65517b..17df2fc01 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_Graph.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_Graph.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D +// Copyright (C) 2007-2019 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 @@ -23,34 +23,44 @@ #include -MEDPARTITIONER::Graph::Graph(MEDCoupling::MEDCouplingSkyLineArray *array, int *edgeweight):_graph(array),_partition(0),_edge_weight(edgeweight),_cell_weight(0) +namespace MEDPARTITIONER { -} + Graph::Graph(): + _graph(0),_partition(0), + _edge_weight(0),_cell_weight(0) + { + } -MEDPARTITIONER::Graph::~Graph() -{ - delete _partition; - delete _graph; -} + Graph::Graph(MEDCoupling::MEDCouplingSkyLineArray *array, int *edgeweight): + _graph(array),_partition(0), + _edge_weight(edgeweight),_cell_weight(0) + { + } -int MEDPARTITIONER::Graph::nbDomains() const -{ - std::set domains; - if ( _partition ) - 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(); -} + Graph::~Graph() + { + } -int MEDPARTITIONER::Graph::nbVertices() const -{ - return _graph->getNumberOf(); -} + int Graph::nbDomains() const + { + std::set domains; + if ( _partition.isNotNull() ) + if ( MEDCoupling::DataArrayIdType* array = _partition->getValuesArray() ) + { + for ( const mcIdType * dom = array->begin(); dom != array->end(); ++dom ) + domains.insert( *dom ); + } + return (int)domains.size(); + } + + const mcIdType *Graph::getPart() const + { + return _partition->getValues(); + } + + mcIdType Graph::nbVertices() const + { + return _graph->getNumberOf(); + } + +};