Isorropia::Epetra::CostDescriber Class Reference

#include <Isorropia_EpetraCostDescriber.hpp>

Inheritance diagram for Isorropia::Epetra::CostDescriber:

Inheritance graph
[legend]
Collaboration diagram for Isorropia::Epetra::CostDescriber:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CostDescriber ()
 Constructor.
 ~CostDescriber ()
 Destructor.
void setVertexWeights (Teuchos::RCP< const Epetra_Vector > vwts)
 setVertexWeights is called by a process to supply the weight of each vertex that it owns in the matrix.
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 vertices.
void setHypergraphEdgeWeights (Teuchos::RCP< const Epetra_Vector > hgewts)
 setHypergraphEdgeWeights is called by processes in an application to supply weights for the hyperedges, which are represented by the columns of the matrix.
void setHypergraphEdgeWeights (int numHGedges, const int *hgGIDs, const float *hgEwgts)
 setHypergraphEdgeWeights is called by processes in an application to supply weights for the hyperedges, which are represented by the columns of the matrix.
void setHypergraphEdgeWeights (int numHGedges, const int *hgGIDs, const double *hgEwgts)
 setHypergraphEdgeWeights is called by processes in an application to supply weights for the hyperedges, which are represented by the columns of the matrix.

(A hyperedge can in general link more than one vertex.)

Matrices that represent hypergraphs are not in general square. There may be more or fewer hyperedges (columns) than vertices (rows).

Parameters:
hgewts an Epetra_Vector containing the weights for each hyperedge.
(Teuchos::RCP<const Epetra_Vector>
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 show_cd (std::ostream &) const
 Print out the contents of this CostDescriber.

Private Member Functions

void setParameters (const Teuchos::ParameterList &paramlist)
 Set parameters for the CostDescriber instance.

The contents of the input paramlist object are copied into an internal ParameterList attribute. Instances of this interface should not retain a reference to the input ParameterList after this method returns.

bool haveVertexWeights () const
 Query whether vertex weights have been supplied by the application.

Returns:
returns true if the application has supplied vertex weights with the CostDescriber, false otherwise

int getNumVertices () const
 Get the number of vertices for which this process supplied vertex weights.

Vertices typically correspond to matrix rows.

Returns:
returns the number of vertices on this process for which the CostDescriber has vertex weights

void getVertexWeights (int numVertices, int *global_ids, float *weights) const
 Get lists of the vertex ids and weights supplied by this process.

Parameters:
numVertices size of global_ids and weights arrays
global_ids pointer to an array of vertex global IDs, allocated by the caller.
weights pointer to an array of vertex weights, allocated by the caller.

bool haveGraphEdgeWeights () const
 Query whether graph edge weights have been supplied by the application.

Returns:
returns true if the application has supplied graph edge weights with the CostDescriber, false otherwise

int getNumGraphEdges (int vertex_global_id) const
 Get the number of graph edges for a specified vertex.

Graph edges typically correspond to matrix nonzeros.

Parameters:
vertex_global_id The global ID for the vertex (on this process) for which the number of edges is desired
Returns:
the number of graph edges supplied by this process for this vertex

int getGraphEdgeVertices (std::set< int > &gids) const
 Get the set of global IDs for the vertices that we have edge information for.
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.

Parameters:
vertex_global_id vertex global ID (on this process) for which edge information is requested
num_neighbors size for which neighbor_global_ids and weights had been preallocated
neighbor_global_ids buffer allocated by caller, on return will contain a list of neighbor vertex global IDs
weights buffer allocated by caller, on return will contain a weight for each edge indicated in neighbor_global_ids

bool haveHypergraphEdgeWeights () const
 Query whether hypergraph edge weights have been supplied by the application.

Returns:
returns true if the application has supplied hypergraph edge weights with the CostDescriber, false otherwise

int getNumHypergraphEdgeWeights () const
 Get the number of Hypergraph edges.

Hypergraph edges typically correspond to matrix columns.

Returns:
returns the number of hypergraph edge weights supplied by this process

void getHypergraphEdgeWeights (int numEdges, int *global_ids, float *weights) const
 Get the hypergraph edge weights that were supplied by this process.

Parameters:
numEdges size for which global_ids and weights had been preallocated
global_ids buffer allocated by caller, on return will contain a list of hyperedge global IDs
weights buffer allocated by caller, on return will contain a weight for each hyperedge indicated in global_ids

int getHypergraphEdgeWeights (std::map< int, float > &wgtMap) const
 Return the CostDescribers hypergraph edge weights as a map from hyperedge (column) global ID to weight.
int getVertexWeights (std::map< int, float > &wgtMap) const
 Get vertex weights in the form of a map from vertex global ID to vertex weight.
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).
bool haveGlobalVertexWeights () const
 haveGlobalVertexWeights returns true if any process in the application has supplied vertex weights, it returns false otherwise.
void setNumGlobalVertexWeights (int num)
 setNumGlobalVertexWeights may be used to set the count of the global number of vertex weights supplied to the CostDescriber
bool haveGlobalGraphEdgeWeights () const
 haveGlobalGraphEdgeWeights returns true if any process in the application has supplied graph edge weights, it returns false otherwise.
void setNumGlobalGraphEdgeWeights (int num)
 setNumGlobalGraphEdgeWeights may be used to set the count of the global number of graph edge weights supplied to the CostDescriber
bool haveGlobalHypergraphEdgeWeights () const
 haveGlobalHypergraphEdgeWeights returns true if any process in the application has supplied hyperedge weights, it returns false otherwise.
void setNumGlobalHypergraphEdgeWeights (int num)
 setNumGlobalHypergraphEdgeWeights may be used to set the count of the global number of hyperedge weights supplied to the CostDescriber
void allocate_hg_edge_weights_ (int n)
 Dynamically allocate storage for hypergraph edge weights.
void free_hg_edge_weights_ ()
 Free storage used by hypergraph edge 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.

Private Attributes

Teuchos::RCP< const Epetra_Vector > vertex_weights_
Teuchos::RCP< const Epetra_CrsMatrix > graph_edge_weights_
std::set< int > graph_self_edges_
Teuchos::ParameterList paramlist_
int * hg_edge_gids_
float * hg_edge_weights_
int num_hg_edge_weights_
int numGlobalVertexWeights_
int numGlobalGraphEdgeWeights_
int numGlobalHypergraphEdgeWeights_

Friends

class Isorropia::Operator
class Isorropia::Epetra::ZoltanLib::QueryObject
class Isorropia::Epetra::InternalPartitioner
class Isorropia::Epetra::ZoltanLibClass
std::ostream & operator<< (std::ostream &, const Isorropia::Epetra::CostDescriber &cd)
 Overloaded << operator for CostDescriber object.

Constructor & Destructor Documentation

Isorropia::Epetra::CostDescriber::CostDescriber (  ) 

Constructor.

Isorropia::Epetra::CostDescriber::~CostDescriber (  )  [virtual]

Destructor.

Reimplemented from Isorropia::CostDescriber.


Member Function Documentation

void Isorropia::Epetra::CostDescriber::setVertexWeights ( Teuchos::RCP< const Epetra_Vector >  vwts  ) 

setVertexWeights is called by a process to supply the weight of each vertex that it owns in the matrix.

Parameters:
vwgts vector of weights, one for each vertex

void Isorropia::Epetra::CostDescriber::setGraphEdgeWeights ( Teuchos::RCP< const Epetra_CrsMatrix >  gewts  ) 

setGraphEdgeWeights is called by a process to supply the weights for each of the edges of its vertices.

An edge corresponds to a non-zero in the row representing the vertex.

This method is called only when performing graph partitioning with a square symmetric matrix. For hypergraph partitioning call the equivalent hypergraph method.

Parameters:
gewts an Epetra_CrsMatrix supplied by the application, each non-zero represents a weight for an edge

void Isorropia::Epetra::CostDescriber::setHypergraphEdgeWeights ( Teuchos::RCP< const Epetra_Vector >  hgewts  ) 

setHypergraphEdgeWeights is called by processes in an application to supply weights for the hyperedges, which are represented by the columns of the matrix.

(A hyperedge can in general link more than one vertex.)

Matrices that represent hypergraphs are not in general square. There may be more or fewer hyperedges (columns) than vertices (rows).

Parameters:
hgewts an Epetra_Vector containing the weights for each hyperedge.

void Isorropia::Epetra::CostDescriber::setHypergraphEdgeWeights ( int  numHGedges,
const int *  hgGIDs,
const float *  hgEwgts 
)

setHypergraphEdgeWeights is called by processes in an application to supply weights for the hyperedges, which are represented by the columns of the matrix.

(A hyperedge can in general link more than one vertex.)

Matrices that represent hypergraphs are not in general square. There may be more or fewer hyperedges (columns) than vertices (rows).

More than one process can supply a weight for the same column. (So there is no concept of a process owning a hyperedge.) Zoltan combines these weights according to the setting of the PHG_EDGE_WEIGHT_OPERATION parameter.

Parameters:
numHGedges the length of the hgGIDs and heEwgts arrays
hgGIDs the global ID for each hyperedge this process will supply a weight for
hgEwgts the hyperedge weight corresponding to each hyperedge listed in hgGIDs

void Isorropia::Epetra::CostDescriber::setHypergraphEdgeWeights ( int  numHGedges,
const int *  hgGIDs,
const double *  hgEwgts 
)

setHypergraphEdgeWeights is called by processes in an application to supply weights for the hyperedges, which are represented by the columns of the matrix.

(A hyperedge can in general link more than one vertex.)

Matrices that represent hypergraphs are not in general square. There may be more or fewer hyperedges (columns) than vertices (rows).

Parameters:
hgewts an Epetra_Vector containing the weights for each hyperedge.
(Teuchos::RCP<const Epetra_Vector>

void Isorropia::Epetra::CostDescriber::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.

Parameters:
vertexWeights is set to a mapping from vertex global IDs to their weights
graphEdgeWeights is a mapping from vertex global IDs to a map from neighboring IDs to edge weights
hypergraphEdgeWeights is a mapping from hyperedge (column) global IDs to hyperedge weights

void Isorropia::Epetra::CostDescriber::show_cd ( std::ostream &   )  const

Print out the contents of this CostDescriber.

void Isorropia::Epetra::CostDescriber::setParameters ( const Teuchos::ParameterList &  paramlist  )  [private, virtual]

Set parameters for the CostDescriber instance.

The contents of the input paramlist object are copied into an internal ParameterList attribute. Instances of this interface should not retain a reference to the input ParameterList after this method returns.

Implements Isorropia::CostDescriber.

bool Isorropia::Epetra::CostDescriber::haveVertexWeights (  )  const [private, virtual]

Query whether vertex weights have been supplied by the application.

Returns:
returns true if the application has supplied vertex weights with the CostDescriber, false otherwise

Implements Isorropia::CostDescriber.

int Isorropia::Epetra::CostDescriber::getNumVertices (  )  const [private, virtual]

Get the number of vertices for which this process supplied vertex weights.

Vertices typically correspond to matrix rows.

Returns:
returns the number of vertices on this process for which the CostDescriber has vertex weights

Implements Isorropia::CostDescriber.

void Isorropia::Epetra::CostDescriber::getVertexWeights ( int  numVertices,
int *  global_ids,
float *  weights 
) const [private, virtual]

Get lists of the vertex ids and weights supplied by this process.

Parameters:
numVertices size of global_ids and weights arrays
global_ids pointer to an array of vertex global IDs, allocated by the caller.
weights pointer to an array of vertex weights, allocated by the caller.

Implements Isorropia::CostDescriber.

bool Isorropia::Epetra::CostDescriber::haveGraphEdgeWeights (  )  const [private, virtual]

Query whether graph edge weights have been supplied by the application.

Returns:
returns true if the application has supplied graph edge weights with the CostDescriber, false otherwise

Implements Isorropia::CostDescriber.

int Isorropia::Epetra::CostDescriber::getNumGraphEdges ( int  vertex_global_id  )  const [private, virtual]

Get the number of graph edges for a specified vertex.

Graph edges typically correspond to matrix nonzeros.

Parameters:
vertex_global_id The global ID for the vertex (on this process) for which the number of edges is desired
Returns:
the number of graph edges supplied by this process for this vertex

Implements Isorropia::CostDescriber.

int Isorropia::Epetra::CostDescriber::getGraphEdgeVertices ( std::set< int > &  gids  )  const [private]

Get the set of global IDs for the vertices that we have edge information for.

Parameters:
gids will be set to the global IDs of the vertices for which neighbor and edge weight information have been provided

void Isorropia::Epetra::CostDescriber::getGraphEdgeWeights ( int  vertex_global_id,
int  num_neighbors,
int *  neighbor_global_ids,
float *  weights 
) const [private, virtual]

Get the graph edge weights for a specified vertex.

Parameters:
vertex_global_id vertex global ID (on this process) for which edge information is requested
num_neighbors size for which neighbor_global_ids and weights had been preallocated
neighbor_global_ids buffer allocated by caller, on return will contain a list of neighbor vertex global IDs
weights buffer allocated by caller, on return will contain a weight for each edge indicated in neighbor_global_ids

Implements Isorropia::CostDescriber.

bool Isorropia::Epetra::CostDescriber::haveHypergraphEdgeWeights (  )  const [private, virtual]

Query whether hypergraph edge weights have been supplied by the application.

Returns:
returns true if the application has supplied hypergraph edge weights with the CostDescriber, false otherwise

Implements Isorropia::CostDescriber.

int Isorropia::Epetra::CostDescriber::getNumHypergraphEdgeWeights (  )  const [private, virtual]

Get the number of Hypergraph edges.

Hypergraph edges typically correspond to matrix columns.

Returns:
returns the number of hypergraph edge weights supplied by this process

Implements Isorropia::CostDescriber.

void Isorropia::Epetra::CostDescriber::getHypergraphEdgeWeights ( int  numEdges,
int *  global_ids,
float *  weights 
) const [private, virtual]

Get the hypergraph edge weights that were supplied by this process.

Parameters:
numEdges size for which global_ids and weights had been preallocated
global_ids buffer allocated by caller, on return will contain a list of hyperedge global IDs
weights buffer allocated by caller, on return will contain a weight for each hyperedge indicated in global_ids

Implements Isorropia::CostDescriber.

int Isorropia::Epetra::CostDescriber::getHypergraphEdgeWeights ( std::map< int, float > &  wgtMap  )  const [private]

Return the CostDescribers hypergraph edge weights as a map from hyperedge (column) global ID to weight.

will be set to a map from hyperedge global ID to hyperedge weight

int Isorropia::Epetra::CostDescriber::getVertexWeights ( std::map< int, float > &  wgtMap  )  const [private]

Get vertex weights in the form of a map from vertex global ID to vertex weight.

Parameters:
wgtMap a map supplied by the caller, the vertex weights will be added to this map
Returns:
the size of wgtMap

int Isorropia::Epetra::CostDescriber::getGraphEdgeWeights ( int  vertex_global_id,
std::map< int, float > &  wgtMap 
) const [private]

getGraphEdgeWeights is called to obtain the graph edge weights for a given vertex (row).

Parameters:
vertex_global_id the global ID of the vertex the caller wants edge weights for
wgtMap a map from the global ID of each vertex neighbor to the weight of the edge formed by the vertex and this neighbor
Returns:
the count of the neighbors of vertex_global_id

bool Isorropia::Epetra::CostDescriber::haveGlobalVertexWeights (  )  const [private]

haveGlobalVertexWeights returns true if any process in the application has supplied vertex weights, it returns false otherwise.

void Isorropia::Epetra::CostDescriber::setNumGlobalVertexWeights ( int  num  )  [private]

setNumGlobalVertexWeights may be used to set the count of the global number of vertex weights supplied to the CostDescriber

bool Isorropia::Epetra::CostDescriber::haveGlobalGraphEdgeWeights (  )  const [private]

haveGlobalGraphEdgeWeights returns true if any process in the application has supplied graph edge weights, it returns false otherwise.

void Isorropia::Epetra::CostDescriber::setNumGlobalGraphEdgeWeights ( int  num  )  [private]

setNumGlobalGraphEdgeWeights may be used to set the count of the global number of graph edge weights supplied to the CostDescriber

bool Isorropia::Epetra::CostDescriber::haveGlobalHypergraphEdgeWeights (  )  const [private]

haveGlobalHypergraphEdgeWeights returns true if any process in the application has supplied hyperedge weights, it returns false otherwise.

void Isorropia::Epetra::CostDescriber::setNumGlobalHypergraphEdgeWeights ( int  num  )  [private]

setNumGlobalHypergraphEdgeWeights may be used to set the count of the global number of hyperedge weights supplied to the CostDescriber

void Isorropia::Epetra::CostDescriber::allocate_hg_edge_weights_ ( int  n  )  [private]

Dynamically allocate storage for hypergraph edge weights.

void Isorropia::Epetra::CostDescriber::free_hg_edge_weights_ (  )  [private]

Free storage used by hypergraph edge weights.

int Isorropia::Epetra::CostDescriber::getEdges ( int  vertexGID,
int  len,
int *  nborGID,
float *  weights 
) const [private]

getEdges creates an array of the neighbors and edge weights for given vertex.

Self edges are not included.

Parameters:
vertexGID the global ID of the vertex (must be one owned by calling process)
length of preallocated nborGID and weights arrays
nborGID on return contains the global ID of each vertex neighboring vertexGID, allocated by caller
weights on return contains the weight for each edge formed by the vertices in nborGID
Returns:
the number of neighbors in nborGID is returned


Friends And Related Function Documentation

friend class Isorropia::Operator [friend]

friend class Isorropia::Epetra::ZoltanLib::QueryObject [friend]

friend class Isorropia::Epetra::InternalPartitioner [friend]

friend class Isorropia::Epetra::ZoltanLibClass [friend]

std::ostream& operator<< ( std::ostream &  ,
const Isorropia::Epetra::CostDescriber cd 
) [friend]

Overloaded << operator for CostDescriber object.


Member Data Documentation

Teuchos::RCP<const Epetra_Vector> Isorropia::Epetra::CostDescriber::vertex_weights_ [private]

Teuchos::RCP<const Epetra_CrsMatrix> Isorropia::Epetra::CostDescriber::graph_edge_weights_ [private]

std::set<int> Isorropia::Epetra::CostDescriber::graph_self_edges_ [private]

Teuchos::ParameterList Isorropia::Epetra::CostDescriber::paramlist_ [private]

int* Isorropia::Epetra::CostDescriber::hg_edge_gids_ [private]

float* Isorropia::Epetra::CostDescriber::hg_edge_weights_ [private]

int Isorropia::Epetra::CostDescriber::num_hg_edge_weights_ [private]

int Isorropia::Epetra::CostDescriber::numGlobalVertexWeights_ [private]

int Isorropia::Epetra::CostDescriber::numGlobalGraphEdgeWeights_ [private]

int Isorropia::Epetra::CostDescriber::numGlobalHypergraphEdgeWeights_ [private]


The documentation for this class was generated from the following file: