00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef IFPACK_METISREORDERING_H
00044 #define IFPACK_METISREORDERING_H
00045
00046 #include "Ifpack_ConfigDefs.h"
00047 #include "Ifpack_Reordering.h"
00048 #include "Epetra_RowMatrix.h"
00049 #include "Teuchos_ParameterList.hpp"
00050 #include "Teuchos_RefCountPtr.hpp"
00051
00052 class Epetra_Comm;
00053 class Ifpack_Graph;
00054 class Epetra_Map;
00055 class Epetra_BlockMap;
00056 class Epetra_Import;
00057
00059
00060 class Ifpack_METISReordering : public Ifpack_Reordering {
00061
00062 public:
00063
00065 Ifpack_METISReordering();
00066
00068 virtual ~Ifpack_METISReordering() {};
00069
00071 virtual int SetParameter(const string Name, const int Value)
00072 {
00073 if (Name == "partitioner: use symmetric graph")
00074 UseSymmetricGraph_ = (bool)Value;
00075 return(0);
00076 }
00077
00079 virtual int SetParameter(const string Name, const double Value)
00080 {
00081 return(0);
00082 };
00083
00085 virtual int SetParameters(Teuchos::ParameterList& List)
00086 {
00087 UseSymmetricGraph_ = List.get("partitioner: use symmetric graph",
00088 UseSymmetricGraph_);
00089
00090 return(0);
00091 }
00092
00094 virtual int Compute(const Ifpack_Graph& Graph);
00095
00097 virtual int Compute(const Epetra_RowMatrix& Matrix);
00098
00100 virtual bool IsComputed() const
00101 {
00102 return(IsComputed_);
00103 }
00104
00106 virtual int Reorder(const int i) const;
00107
00109 virtual int InvReorder(const int i) const;
00110
00112 virtual int P(const Epetra_MultiVector& Xorig,
00113 Epetra_MultiVector& X) const;
00114
00116 virtual int Pinv(const Epetra_MultiVector& Xorig,
00117 Epetra_MultiVector& X) const;
00118
00120 virtual ostream& Print(std::ostream& os) const;
00121
00122 private:
00124 bool UseSymmetricGraph_;
00126 int NumMyRows_;
00128 bool IsComputed_;
00130 std::vector<int> Reorder_;
00132 std::vector<int> InvReorder_;
00133
00134 };
00135
00136 #endif // IFPACK_METISREORDERING_H