/** \defgroup partitioning_ptr_grp Isorropia Partitioning and Load Balancing Methods with Pointers
\brief Here we describe the partitioning interface that uses Pointers
\section partitionPtrIntro Partitioning and Load-balancing with Pointers
One interface to the partitioning in Isorropia is to pass a pointer to the Epetra object to the Isorropia partitioner.
This interface is not as safe as the RCP interface, and you need to be careful not to delete the Epetra object when
the pointer is still being used inside the partitioner.
The following example demonstrates how to partition a matrix with hypergraph partitioning
using the pointer interface.
-
\verbatim
// loadMatrix() allocates and reads in an Epetra_CrsMatrix from a file
const Epetra_CrsMatrix *A = loadMatrix(filename);
Teuchos::ParameterList params;
params.set("PARTITIONING_METHOD", "HYPERGRAPH");
params.set("BALANCE OBJECTIVE","NONZEROS");
params.set("IMBALANCE TOL","1.03");
Isorropia::Epetra::Partitioner partitioner(A,params,false);
partitioner.partition();
\endverbatim
After partitioning the matrix, the Isorropia::Epetra::Redistributor may be
used to return a new matrix that contains the data of the original matrix/graph/etc.
but redistributed based on a partition. The pointer interface to the
redistributor accepts a pointer to an Isorropia::Epetra::Partitioner object and
and sets a pointer to the newly allocated matrix/graph/etc. Below we demonstrate how the
redistributor works with the pointer interface.
-
\verbatim
// loadMatrix() allocates and reads in an Epetra_RowMatrix from a file
Epetra_CrsMatrix *A; = loadMatrix(filename);
Epetra_CrsMatrix *newMatrix;
Teuchos::ParameterList params;
params.set("IMBALANCE TOL","1.03");
params.set("BALANCE OBJECTIVE","NONZEROS");
params.set("PARTITIONING_METHOD", "HYPERGRAPH");
Isorropia::Epetra::Partitioner *partitioner = new Isorropia::Epetra::Partitioner(A, params,false);
partitioner->partition();
Isorropia::Epetra::Redistributor rd(partitioner);
rd.redistribute(*rowmatrix,newMatrix,true);
\endverbatim
Additional information and functionality for partitioning, in general, is documented here:
\ingroup partitioning_grp
*/