40#ifndef _Isorropia_EpetraCostDescriber_hpp_
41#define _Isorropia_EpetraCostDescriber_hpp_
45#include <Teuchos_RCP.hpp>
46#include <Teuchos_ParameterList.hpp>
55class Epetra_CrsMatrix;
56class Epetra_RowMatrix;
57class Epetra_MultiVector;
216 void getCosts(std::map<int, float > &vertexWeights,
217 std::map<
int, std::map<int, float > > &graphEdgeWeights,
218 std::map<int, float > &hypergraphEdgeWeights)
const;
227 int compareBeforeAndAfterHypergraph(
const Epetra_RowMatrix &in_m,
const Epetra_RowMatrix &out_m,
228 const Epetra_Import &importer,
229 std::vector<double> &balance, std::vector<double> &cutn, std::vector<double> &cutl)
const;
231 int compareBeforeAndAfterGraph(
const Epetra_RowMatrix &in_m,
const Epetra_RowMatrix &out_m,
232 const Epetra_Import &importer,
233 std::vector<double> &balance, std::vector<int> &numCuts, std::vector<double> &cutWgt,
234 std::vector<double> &cutn, std::vector<double> &cutl)
const;
236 int compareBeforeAndAfterGraph(
const Epetra_CrsGraph &in_g,
const Epetra_CrsGraph &out_g,
237 const Epetra_Import &importer,
238 std::vector<double> &balance, std::vector<int> &numCuts, std::vector<double> &cutWgt,
239 std::vector<double> &cutn, std::vector<double> &cutl)
const;
241 int compareBeforeAndAfterImbalance(
const Epetra_MultiVector &mv,
const Epetra_Import &importer,
242 std::vector<double> &min, std::vector<double> &max, std::vector<double> &avg)
const;
250 const Epetra_CrsGraph *in_g,
const Epetra_CrsGraph *out_g,
251 const Epetra_Import &importer,
252 std::vector<double> &balance, std::vector<int> &numCuts, std::vector<double> &cutWgt,
253 std::vector<double> &cutn, std::vector<double> &cutl)
const;
268 int* global_ids,
float* weights)
const;
287 int* neighbor_global_ids,
288 float* weights)
const;
299 float* weights)
const;
395 int getEdges(
int vertexGID,
int len,
int *nborGID,
float *weights)
const;
Interface (abstract base class) for describing the weights or costs associated with the vertices and/...
Definition Isorropia_CostDescriber.hpp:61
Definition Isorropia_EpetraCostDescriber.hpp:128
void free_hg_edge_weights_()
Free storage used by hypergraph edge weights.
float * hg_edge_weights_
Definition Isorropia_EpetraCostDescriber.hpp:376
~CostDescriber()
Destructor.
void setHypergraphEdgeWeights(int numHGedges, const int *hgGIDs, const float *hgEwgts)
setHypergraphEdgeWeights is called by processes in an application to supply weights for the hyperedge...
Teuchos::RCP< const Epetra_Vector > vertex_weights_
Definition Isorropia_EpetraCostDescriber.hpp:369
void setVertexWeights(Teuchos::RCP< const Epetra_Vector > vwgts)
setVertexWeights is called by a process to supply the weight of each vertex (row) in the graph or hyp...
Teuchos::RCP< const Epetra_CrsMatrix > graph_edge_weights_
Definition Isorropia_EpetraCostDescriber.hpp:370
int getGraphEdgeWeights(int vertex_global_id, std::map< int, float > &wgtMap) const
getGraphEdgeWeights is called to obtain the graph edge weights for a given vertex (row).
int numGlobalVertexWeights_
Definition Isorropia_EpetraCostDescriber.hpp:379
void getVertexWeights(int numVertices, int *global_ids, float *weights) const
Get lists of the vertex ids and weights supplied by this process.
int _compareBeforeAndAfterGraph(const Epetra_RowMatrix *in_m, const Epetra_RowMatrix *out_m, const Epetra_CrsGraph *in_g, const Epetra_CrsGraph *out_g, const Epetra_Import &importer, std::vector< double > &balance, std::vector< int > &numCuts, std::vector< double > &cutWgt, std::vector< double > &cutn, std::vector< double > &cutl) const
bool haveHypergraphEdgeWeights() const
Query whether hypergraph edge weights have been supplied by the application.
int getVertexWeights(std::map< int, float > &wgtMap) const
Get vertex weights in the form of a map from vertex global ID to vertex weight.
bool haveGlobalGraphEdgeWeights() const
haveGlobalGraphEdgeWeights returns true if any process in the application has supplied graph edge wei...
bool haveGlobalVertexWeights() const
haveGlobalVertexWeights returns true if any process in the application has supplied vertex weights,...
void getHypergraphEdgeWeights(int numEdges, int *global_ids, float *weights) const
Get the hypergraph edge weights that were supplied by this process.
void setHypergraphEdgeWeights(int numHGedges, const int *hgGIDs, const double *hgEwgts)
setHypergraphEdgeWeights is called by processes in an application to supply weights for the hyperedge...
void show_cd(std::ostream &) const
Print out the contents of this CostDescriber.
void setNumGlobalHypergraphEdgeWeights(int num)
setNumGlobalHypergraphEdgeWeights may be used to set the count of the global number of hyperedge weig...
bool haveVertexWeights() const
Query whether vertex weights have been supplied by the application.
void setParameters(const Teuchos::ParameterList ¶mlist)
Set parameters for the CostDescriber instance.
void setGraphEdgeWeights(Teuchos::RCP< const Epetra_CrsMatrix > gewts)
setGraphEdgeWeights is called by a process to supply the weights for each of the edges of its vertice...
bool haveGlobalHypergraphEdgeWeights() const
haveGlobalHypergraphEdgeWeights returns true if any process in the application has supplied hyperedge...
CostDescriber()
Constructor.
friend std::ostream & operator<<(std::ostream &, const Isorropia::Epetra::CostDescriber &cd)
Overloaded << operator for CostDescriber object.
void _transformWeights(const Epetra_Import &importer)
bool haveGraphEdgeWeights() const
Query whether graph edge weights have been supplied by the application.
int getNumGraphEdges(int vertex_global_id) const
Get the number of graph edges for a specified vertex.
int * hg_edge_gids_
Definition Isorropia_EpetraCostDescriber.hpp:375
Teuchos::ParameterList paramlist_
Definition Isorropia_EpetraCostDescriber.hpp:373
void getGraphEdgeWeights(int vertex_global_id, int num_neighbors, int *neighbor_global_ids, float *weights) const
Get the graph edge weights for a specified vertex.
int getNumHypergraphEdgeWeights() const
Get the number of Hypergraph edges.
void setHypergraphEdgeWeights(Teuchos::RCP< const Epetra_Vector > hgewts)
setHypergraphEdgeWeights is called by processes in an application to supply weights for the hyperedge...
void setNumGlobalGraphEdgeWeights(int num)
setNumGlobalGraphEdgeWeights may be used to set the count of the global number of graph edge weights ...
int getHypergraphEdgeWeights(std::map< int, float > &wgtMap) const
Return the CostDescribers hypergraph edge weights as a map from hyperedge (column) global ID to weigh...
CostDescriber(const CostDescriber &costs)
Copy constructor.
int getGraphEdgeVertices(std::set< int > &gids) const
Get the set of global IDs for the vertices that we have edge information for.
std::set< int > graph_self_edges_
Definition Isorropia_EpetraCostDescriber.hpp:371
const Epetra_Vector & getVertexWeights()
Definition Isorropia_EpetraCostDescriber.hpp:317
void setNumGlobalVertexWeights(int num)
setNumGlobalVertexWeights may be used to set the count of the global number of vertex weights supplie...
int num_hg_edge_weights_
Definition Isorropia_EpetraCostDescriber.hpp:377
void getCosts(std::map< int, float > &vertexWeights, std::map< int, std::map< int, float > > &graphEdgeWeights, std::map< int, float > &hypergraphEdgeWeights) const
Get the contents of this CostDescriber.
void allocate_hg_edge_weights_(int n)
Dynamically allocate storage for hypergraph edge weights.
int numGlobalGraphEdgeWeights_
Definition Isorropia_EpetraCostDescriber.hpp:380
int numGlobalHypergraphEdgeWeights_
Definition Isorropia_EpetraCostDescriber.hpp:381
int getNumVertices() const
Get the number of vertices for which this process supplied vertex weights.
int getEdges(int vertexGID, int len, int *nborGID, float *weights) const
getEdges creates an array of the neighbors and edge weights for given vertex.
Definition Isorropia_EpetraZoltanLib.hpp:70
QueryObject is a class that contains the query functions required by the Zoltan library.
Definition QueryObject.hpp:82
Interface (abstract base class) for computing a new partitioning/coloring/ ordering and exploiting th...
Definition Isorropia_Operator.hpp:58
Isorropia is the namespace that contains general definitions that apply to all partitioners and that ...
Definition Isorropia_Epetra.hpp:60