48#include "Epetra_Comm.h"
49#include "Epetra_BlockMap.h"
50#include "Epetra_Map.h"
51#include "Teuchos_ParameterList.hpp"
53static const std::string
PrintMsg_ =
"(Ifpack_OvPartitioner) ";
112 cout <<
PrintMsg_ <<
"Number of global parts = "
157 std::vector<int> sizes;
164 for (
int i = 0 ; i <
NumMyRows() ; ++i) {
166 cerr <<
"ERROR: Partition[" << i <<
"] = "<<
Partition_[i]
168 cerr <<
"(file = " << __FILE__ <<
", line = "
169 << __LINE__ <<
")" << endl;
181 Parts_[i].resize(sizes[i]);
188 for (
int i = 0 ; i <
NumMyRows() ; ++i) {
190 int count = sizes[part];
201 std::vector<std::vector<int> > tmp;
209 std::vector<int> Indices;
210 Indices.resize(MaxNumEntries_tmp);
214 for (
int i = 0; i < (int)
Parts_[part].size() ; ++i) {
216 int LRID =
Parts_[part][i];
219 NumIndices, &Indices[0]);
222 for (
int j = 0 ; j < NumIndices ; ++j) {
225 int col = Indices[j];
230 std::vector<int>::iterator
231 where =
find(tmp[part].begin(), tmp[part].end(), col);
233 if (where == tmp[part].end()) {
234 tmp[part].push_back(col);
242 Parts_[i].resize(tmp[i].size());
243 for (
int j = 0 ; j < (int)tmp[i].size() ; ++j)
265#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
296 os <<
"================================================================================" << endl;
297 os <<
"Ifpack_OverlappingPartitioner" << endl;
303 os <<
"================================================================================" << endl;
#define IFPACK_CHK_ERR(ifpack_err)
static const std::string PrintMsg_
adjacency_list< vecS, vecS, undirectedS, no_property, property< edge_weight_t, double > > Graph
static bool find(Parser_dh p, char *option, OptionsNode **ptr)
virtual int NumProc() const=0
Ifpack_Graph: a pure virtual class that defines graphs for IFPACK.
virtual long long NumGlobalRows64() const =0
virtual int NumGlobalRows() const =0
Returns the number of global rows.
virtual int ExtractMyRowCopy(int MyRow, int LenOfIndices, int &NumIndices, int *Indices) const =0
Extracts a copy of input local row.
virtual const Epetra_Comm & Comm() const =0
Returns the communicator object of the graph.
virtual long long NumGlobalCols64() const =0
virtual int NumMyNonzeros() const =0
Returns the number of local nonzero entries.
virtual bool Filled() const =0
Returns true is graph is filled.
virtual int NumMyRows() const =0
Returns the number of local rows.
virtual int MaxMyNumEntries() const =0
Returns the maximun number of entries for row.
std::vector< std::vector< int > > Parts_
Parts_[i][j] is the ID of the j-th row contained in the (overlapping)
int NumGlobalRows() const
Returns the number of global rows.
int NumLocalParts() const
Returns the number of computed local partitions.
long long NumGlobalRows64() const
int OverlappingLevel_
Overlapping level.
Ifpack_OverlappingPartitioner(const Ifpack_Graph *Graph)
Constructor.
int NumMyNonzeros() const
Returns the number of local nonzero elements.
int NumLocalParts_
Number of local subgraphs.
int NumMyRows() const
Returns the number of local rows.
int MaxNumEntries() const
Returns the max number of local entries in a row.
virtual std::ostream & Print(std::ostream &os) const
Prints basic information on iostream. This function is used by operator<<.
virtual ~Ifpack_OverlappingPartitioner()
Destructor.
std::vector< int > Partition_
Partition_[i] contains the ID of non-overlapping part it belongs to.
virtual int SetPartitionParameters(Teuchos::ParameterList &List)=0
Sets all the parameters for the partitioner.
bool verbose_
If true, information are reported on cout.
virtual int Compute()
Computes the partitions. Returns 0 if successful.
bool IsComputed_
If true, the graph has been successfully partitioned.
virtual int SetParameters(Teuchos::ParameterList &List)
Sets all the parameters for the partitioner.
virtual int ComputeOverlappingPartitions()
Computes the partitions. Returns 0 if successful.
const Epetra_Comm & Comm() const
Returns the communicator object of Graph.
const Ifpack_Graph * Graph_
Reference to the graph to be partitioned.
virtual int ComputePartitions()=0
Computes the partitions. Returns 0 if successful.