|
IFPACK Development
|
00001 /*@HEADER 00002 // *********************************************************************** 00003 // 00004 // Ifpack: Object-Oriented Algebraic Preconditioner Package 00005 // Copyright (2002) Sandia Corporation 00006 // 00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00008 // license for use of this work by or on behalf of the U.S. Government. 00009 // 00010 // This library is free software; you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as 00012 // published by the Free Software Foundation; either version 2.1 of the 00013 // License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00023 // USA 00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 00025 // 00026 // *********************************************************************** 00027 //@HEADER 00028 */ 00029 00030 #ifndef IFPACK_DROPFILTER_H 00031 #define IFPACK_DROPFILTER_H 00032 00033 #include "Ifpack_ConfigDefs.h" 00034 #include "Epetra_RowMatrix.h" 00035 #include "Teuchos_RefCountPtr.hpp" 00036 00037 class Epetra_Comm; 00038 class Epetra_Map; 00039 class Epetra_MultiVector; 00040 class Epetra_Import; 00041 class Epetra_BlockMap; 00042 00044 00068 class Ifpack_DropFilter : public virtual Epetra_RowMatrix { 00069 00070 public: 00072 Ifpack_DropFilter(const Teuchos::RefCountPtr<Epetra_RowMatrix>& Matrix, 00073 double DropTol); 00074 00076 virtual ~Ifpack_DropFilter() {}; 00077 00079 virtual inline int NumMyRowEntries(int MyRow, int & NumEntries) const 00080 { 00081 NumEntries = NumEntries_[MyRow]; 00082 return(0); 00083 } 00084 00086 virtual int MaxNumEntries() const 00087 { 00088 return(MaxNumEntries_); 00089 } 00090 00091 virtual int ExtractMyRowCopy(int MyRow, int Length, int & NumEntries, double *Values, int * Indices) const; 00092 00093 virtual int ExtractDiagonalCopy(Epetra_Vector & Diagonal) const; 00094 00095 virtual int Multiply(bool TransA, const Epetra_MultiVector& X, 00096 Epetra_MultiVector& Y) const; 00097 00098 virtual int Solve(bool Upper, bool Trans, bool UnitDiagonal, 00099 const Epetra_MultiVector& X, 00100 Epetra_MultiVector& Y) const; 00101 00102 virtual int Apply(const Epetra_MultiVector& X, 00103 Epetra_MultiVector& Y) const; 00104 00105 virtual int ApplyInverse(const Epetra_MultiVector& X, 00106 Epetra_MultiVector& Y) const; 00107 00108 virtual int InvRowSums(Epetra_Vector& x) const; 00109 00110 virtual int LeftScale(const Epetra_Vector& x) 00111 { 00112 return(A_->LeftScale(x)); 00113 } 00114 00115 virtual int InvColSums(Epetra_Vector& x) const; 00116 00117 virtual int RightScale(const Epetra_Vector& x) 00118 { 00119 return(A_->RightScale(x)); 00120 } 00121 00122 virtual bool Filled() const 00123 { 00124 return(A_->Filled()); 00125 } 00126 00127 virtual double NormInf() const 00128 { 00129 return(-1.0); 00130 } 00131 00132 virtual double NormOne() const 00133 { 00134 return(-1.0); 00135 } 00136 00137 virtual int NumGlobalNonzeros() const 00138 { 00139 return(NumNonzeros_); 00140 } 00141 00142 virtual int NumGlobalRows() const 00143 { 00144 return(NumRows_); 00145 } 00146 00147 virtual int NumGlobalCols() const 00148 { 00149 return(NumRows_); 00150 } 00151 00152 virtual int NumGlobalDiagonals() const 00153 { 00154 return(NumRows_); 00155 } 00156 00157 virtual int NumMyNonzeros() const 00158 { 00159 return(NumNonzeros_); 00160 } 00161 00162 virtual int NumMyRows() const 00163 { 00164 return(NumRows_); 00165 } 00166 00167 virtual int NumMyCols() const 00168 { 00169 return(NumRows_); 00170 } 00171 00172 virtual int NumMyDiagonals() const 00173 { 00174 return(NumRows_); 00175 } 00176 00177 virtual bool LowerTriangular() const 00178 { 00179 return(false); 00180 } 00181 00182 virtual bool UpperTriangular() const 00183 { 00184 return(false); 00185 } 00186 00187 virtual const Epetra_Map & RowMatrixRowMap() const 00188 { 00189 return(A_->RowMatrixRowMap()); 00190 } 00191 00192 virtual const Epetra_Map & RowMatrixColMap() const 00193 { 00194 return(A_->RowMatrixColMap()); 00195 } 00196 00197 virtual const Epetra_Import * RowMatrixImporter() const 00198 { 00199 return(A_->RowMatrixImporter()); 00200 } 00201 00202 int SetUseTranspose(bool UseTranspose) 00203 { 00204 return(A_->SetUseTranspose(UseTranspose)); 00205 } 00206 00207 bool UseTranspose() const 00208 { 00209 return(A_->UseTranspose()); 00210 } 00211 00212 bool HasNormInf() const 00213 { 00214 return(false); 00215 } 00216 00217 const Epetra_Comm & Comm() const 00218 { 00219 return(A_->Comm()); 00220 } 00221 00222 const Epetra_Map & OperatorDomainMap() const 00223 { 00224 return(A_->OperatorDomainMap()); 00225 } 00226 00227 const Epetra_Map & OperatorRangeMap() const 00228 { 00229 return(A_->OperatorRangeMap()); 00230 } 00231 00232 const Epetra_BlockMap& Map() const 00233 { 00234 return(A_->Map()); 00235 } 00236 00237 const char* Label() const{ 00238 return(Label_); 00239 } 00240 00241 private: 00242 00244 Teuchos::RefCountPtr<Epetra_RowMatrix> A_; 00246 double DropTol_; 00248 int MaxNumEntries_; 00249 int MaxNumEntriesA_; 00250 int NumRows_; 00251 00253 int NumNonzeros_; 00254 00256 mutable std::vector<int> Indices_; 00258 mutable std::vector<double> Values_; 00260 char Label_[80]; 00261 std::vector<int> NumEntries_; 00262 00263 }; 00264 00265 00266 #endif /* IFPACK_DROPFILTER_H */
1.7.4