Epetra_InvOperator.h

Go to the documentation of this file.
00001 
00002 /*@HEADER
00003 // ***********************************************************************
00004 // 
00005 //        Epetra: Linear Algebra Services Package 
00006 //          Copyright (2001) 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 Michael A. Heroux (maherou@sandia.gov) 
00026 // 
00027 // ***********************************************************************
00028 //@HEADER
00029 */
00030 
00031 #ifndef EPETRA_INVOPERATOR_H
00032 #define EPETRA_INVOPERATOR_H
00033 
00034 class Epetra_MultiVector;
00035 class Epetra_BlockMap;
00036 class Epetra_Comm;
00037 #include <string>
00038 #include "Epetra_Operator.h"
00039 
00041 
00046 class Epetra_InvOperator: public virtual Epetra_Operator {
00047       
00048  public:
00049 
00051 
00052 
00053 
00056   Epetra_InvOperator(Epetra_Operator * operatorIn) {
00057     operator_ = operatorIn; 
00058     Label_ = "Inverse of " + string(operatorIn->Label());
00059     return;
00060   }
00062   virtual ~Epetra_InvOperator(){}
00064   
00066 
00067 
00069 
00078   int SetUseTranspose(bool UseTranspose){EPETRA_CHK_ERR(operator_->SetUseTranspose(UseTranspose)); return(0);}
00080   
00082 
00083 
00085 
00093   int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const {EPETRA_CHK_ERR(operator_->ApplyInverse(X,Y)); return(0);}
00094 
00096 
00104   int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const{EPETRA_CHK_ERR(operator_->Apply(X,Y)); return(0);}
00105   
00107   /* Returns the quantity \f$ \| A \|_\infty\f$ such that
00108      \f[\| A \|_\infty = \max_{1\lei\lem} \sum_{j=1}^n |a_{ij}| \f].
00109      
00110      \warning This method must not be called unless HasNormInf() returns true.
00111   */ 
00112   double NormInf() const {return(operator_->NormInf());}
00113   
00115 
00116 
00118   const char * Label() const {return(Label_.c_str());}
00119 
00121   Epetra_Operator * Operator() const {return(operator_);}
00122 
00123   
00125   bool UseTranspose() const {return(operator_->UseTranspose());}
00126   
00128   bool HasNormInf() const {return(operator_->HasNormInf());};
00129   
00131   const Epetra_Comm & Comm() const {return(operator_->Comm());}
00132   
00134   const Epetra_Map & OperatorDomainMap() const
00135   {
00136     if (!UseTranspose()) return(operator_->OperatorRangeMap());
00137     else return(operator_->OperatorDomainMap());
00138   }
00139   
00141   const Epetra_Map & OperatorRangeMap() const
00142   {
00143     if (!UseTranspose()) return(operator_->OperatorDomainMap());
00144     else return(operator_->OperatorRangeMap());
00145   }
00147   
00148  protected:
00149 
00150   Epetra_Operator * operator_;
00151   string Label_;
00152 };
00153 
00154 #endif /* EPETRA_INVOPERATOR_H */
00155 

Generated on Wed May 12 21:41:05 2010 for Epetra Package Browser (Single Doxygen Collection) by  doxygen 1.4.7