Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members

Isorropia_EpetraCostDescriber.hpp

00001 //@HEADER
00002 /*
00003 ************************************************************************
00004 
00005               Isorropia: Partitioning and Load Balancing Package
00006                 Copyright (2006) Sandia Corporation
00007 
00008 Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00009 license for use of this work by or on behalf of the U.S. Government.
00010 
00011 This library is free software; you can redistribute it and/or modify
00012 it under the terms of the GNU Lesser General Public License as
00013 published by the Free Software Foundation; either version 2.1 of the
00014 License, or (at your option) any later version.
00015 
00016 This library is distributed in the hope that it will be useful, but
00017 WITHOUT ANY WARRANTY; without even the implied warranty of
00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019 Lesser General Public License for more details.
00020 
00021 You should have received a copy of the GNU Lesser General Public
00022 License along with this library; if not, write to the Free Software
00023 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00024 USA
00025 Questions? Contact Alan Williams (william@sandia.gov)
00026                 or Erik Boman    (egboman@sandia.gov)
00027 
00028 ************************************************************************
00029 */
00030 //@HEADER
00031 
00032 #ifndef _Isorropia_EpetraCostDescriber_hpp_
00033 #define _Isorropia_EpetraCostDescriber_hpp_
00034 
00035 #include <Isorropia_configdefs.hpp>
00036 #include <Teuchos_RefCountPtr.hpp>
00037 #include <Teuchos_ParameterList.hpp>
00038 
00039 #include <Isorropia_CostDescriber.hpp>
00040 
00041 #ifdef HAVE_EPETRA
00042 class Epetra_Vector;
00043 class Epetra_CrsMatrix;
00044 
00048 namespace Isorropia {
00049 
00053 namespace Epetra {
00054 
00057 class CostDescriber : public Isorropia::CostDescriber {
00058 public:
00060   CostDescriber();
00061 
00063   virtual ~CostDescriber();
00064 
00070   void setParameters(const Teuchos::ParameterList& paramlist);
00071 
00074   void setVertexWeights(Teuchos::RefCountPtr<Epetra_Vector> vwts);
00075 
00078   void setGraphEdgeWeights(Teuchos::RefCountPtr<Epetra_CrsMatrix> gewts);
00079 
00082   void setHypergraphEdgeWeights(Teuchos::RefCountPtr<Epetra_Vector> hgewts);
00083 
00088   bool haveVertexWeights() const;
00089 
00093   int getNumVertices() const;
00094 
00097   void getVertexWeights(int numVertices,
00098                                 int* global_ids,
00099                                 float* weights) const;
00100 
00105   bool haveGraphEdgeWeights() const;
00106 
00110   int getNumGraphEdges(int vertex_global_id) const;
00111 
00114   void getGraphEdgeWeights(int vertex_global_id,
00115                                    int num_neighbors,
00116                                    int* neighbor_global_ids,
00117                                    float* weights) const;
00118 
00123   bool haveHypergraphEdgeWeights() const;
00124 
00128   int getNumHypergraphEdges() const;
00129 
00132   void getHypergraphEdgeWeights(int numEdges,
00133                                         int* global_ids,
00134                                         float* weights) const;
00135 
00136 private:
00137   Teuchos::RefCountPtr<Epetra_Vector> vertex_weights_;
00138   Teuchos::RefCountPtr<Epetra_CrsMatrix> graph_edge_weights_;
00139   Teuchos::RefCountPtr<Epetra_Vector> hypergraph_edge_weights_;
00140   Teuchos::ParameterList paramlist_;
00141 };//class CostDescriber
00142 
00143 }//namespace Epetra
00144 }//namespace Isorropia
00145 
00146 #endif //HAVE_EPETRA
00147 
00148 #endif
00149