Isorropia_EpetraLibrary.hpp

Go to the documentation of this file.
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 
00026 ************************************************************************
00027 */
00028 //@HEADER
00029 
00030 #ifndef _Isorropia_EpetraLibrary_hpp_
00031 #define _Isorropia_EpetraLibrary_hpp_
00032 
00033 #include <Isorropia_ConfigDefs.hpp>
00034 #include <Teuchos_RCP.hpp>
00035 #include <Teuchos_ParameterList.hpp>
00036 
00037 #include <Isorropia_EpetraCostDescriber.hpp>
00038 
00039 #ifdef HAVE_EPETRA
00040 class Epetra_Map;
00041 class Epetra_BlockMap;
00042 class Epetra_Import;
00043 class Epetra_Vector;
00044 class Epetra_MultiVector;
00045 class Epetra_CrsGraph;
00046 class Epetra_CrsMatrix;
00047 class Epetra_RowMatrix;
00048 class Epetra_LinearProblem;
00049 
00050 namespace Isorropia {
00051 
00052 namespace Epetra {
00053   class CostDescriber;
00054 
00060 class Library {
00061 public:
00062 
00063   Library(Teuchos::RCP<const Epetra_CrsGraph> input_graph);
00064   Library(Teuchos::RCP<const Epetra_CrsGraph> input_graph,
00065     Teuchos::RCP<CostDescriber> costs);
00066   Library(Teuchos::RCP<const Epetra_RowMatrix> input_matrix);
00067   Library(Teuchos::RCP<const Epetra_RowMatrix> input_matrix,
00068     Teuchos::RCP<CostDescriber> costs);
00069 
00070   virtual ~Library();
00071 
00072   void setInput(Teuchos::RCP<const Epetra_CrsGraph> input_graph);
00073   void setInput(Teuchos::RCP<const Epetra_CrsGraph> input_graph,
00074     Teuchos::RCP<CostDescriber> costs);
00075   void setInput(Teuchos::RCP<const Epetra_RowMatrix> input_matrix);
00076   void setInput(Teuchos::RCP<const Epetra_RowMatrix> input_matrix,
00077     Teuchos::RCP<CostDescriber> costs);
00078 
00079   virtual int
00080   repartition(Teuchos::ParameterList& paramlist,
00081         std::vector<int>& myNewElements,
00082         int& exportsSize,
00083         std::vector<int>& imports) = 0;
00084 //        std::map<int,int>& exports,
00085 //        std::map<int,int>& imports) = 0;
00086 
00087   virtual int
00088   color(Teuchos::ParameterList& paramlist,
00089   std::vector<int>& myNewElements) = 0 ;
00090 
00091   virtual int
00092   order(Teuchos::ParameterList& paramlist,
00093   std::vector<int>& myNewElements) = 0 ;
00094 
00095   void setInputType(std::string inputType) {
00096     inputType_ = inputType;
00097   }
00098 
00099 protected:
00100   std::string inputType_;
00101 
00102   Teuchos::RCP<const Epetra_BlockMap> input_map_;
00103   Teuchos::RCP<const Epetra_CrsGraph> input_graph_;
00104   Teuchos::RCP<const Epetra_RowMatrix> input_matrix_;
00105   Teuchos::RCP<Isorropia::Epetra::CostDescriber> costs_;
00106   Teuchos::RCP<Epetra_Vector> weights_;
00107 
00108   virtual int precompute();
00109   virtual int postcompute() = 0;
00110 
00111 };//class Library
00112 
00113 }//namespace Epetra
00114 }//namespace Isorropia
00115 
00116 #endif //HAVE_EPETRA
00117 
00118 #endif
00119