Ifpack_Amesos.h

00001 #ifndef IFPACK_AMESOS_H
00002 #define IFPACK_AMESOS_H
00003 
00004 #include "Ifpack_ConfigDefs.h"
00005 #if defined(HAVE_IFPACK_AMESOS) && defined(HAVE_IFPACK_TEUCHOS)
00006 
00007 #include "Ifpack_Preconditioner.h"
00008 #include "Epetra_Operator.h"
00009 #include "Teuchos_ParameterList.hpp"
00010 class Epetra_Map;
00011 class Epetra_Time;
00012 class Epetra_Comm;
00013 class Amesos_BaseSolver;
00014 class Epetra_LinearProblem;
00015 class Epetra_RowMatrix;
00016 
00018 
00039 class Ifpack_Amesos : public Ifpack_Preconditioner {
00040       
00041 public:
00042 
00044 
00046   Ifpack_Amesos(Epetra_RowMatrix* Matrix);
00047 
00049   Ifpack_Amesos(const Ifpack_Amesos& rhs);
00050 
00052   Ifpack_Amesos& operator=(const Ifpack_Amesos& rhs);
00053 
00055 
00056   virtual ~Ifpack_Amesos();
00057 
00059 
00061 
00063 
00073   virtual int SetUseTranspose(bool UseTranspose);
00075   
00077 
00079 
00087     virtual int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00088 
00090 
00101     virtual int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
00102 
00104     virtual double NormInf() const;
00106   
00108 
00110     virtual const char * Label() const;
00111 
00113     virtual bool UseTranspose() const;
00114 
00116     virtual bool HasNormInf() const;
00117 
00119     virtual const Epetra_Comm & Comm() const;
00120 
00122     virtual const Epetra_Map & OperatorDomainMap() const;
00123 
00125     virtual const Epetra_Map & OperatorRangeMap() const;
00126 
00128 
00130  
00132   virtual bool IsInitialized() const
00133   {
00134     return(IsInitialized_);
00135   }
00136 
00138 
00141   virtual int Initialize();
00142 
00144   virtual bool IsComputed() const
00145   {
00146     return(IsComputed_);
00147   }
00148 
00150 
00153   virtual int Compute();
00154 
00156 
00163   virtual int SetParameters(Teuchos::ParameterList& List);
00164 
00166 
00168 
00170   virtual const Epetra_RowMatrix& Matrix() const
00171   {
00172     return(*Matrix_);
00173   }
00174 
00176   virtual double Condest(const Ifpack_CondestType CT = Ifpack_Cheap,
00177                          const int MaxIters = 1550,
00178                          const double Tol = 1e-9,
00179              Epetra_RowMatrix* Matrix= 0);
00180   
00182   virtual double Condest() const
00183   {
00184     return(Condest_);
00185   }
00186 
00188   virtual int NumInitialize() const
00189   {
00190     return(NumInitialize_);
00191   }
00192 
00194   virtual int NumCompute() const
00195   {
00196     return(NumCompute_);
00197   }
00198 
00200   virtual int NumApplyInverse() const
00201   {
00202     return(NumApplyInverse_);
00203   }
00204 
00206   virtual double InitializeTime() const
00207   {
00208     return(InitializeTime_);
00209   }
00210 
00212   virtual double ComputeTime() const
00213   {
00214     return(ComputeTime_);
00215   }
00216 
00218   virtual double ApplyInverseTime() const
00219   {
00220     return(ApplyInverseTime_);
00221   }
00222 
00224   virtual double InitializeFlops() const
00225   {
00226     return(0.0);
00227   }
00228 
00230   virtual double ComputeFlops() const
00231   {
00232     return(ComputeFlops_);
00233   }
00234 
00236   virtual double ApplyInverseFlops() const
00237   {
00238     return(ApplyInverseFlops_);
00239   }
00240 
00241   // Returns a constant reference to the internally stored 
00242   virtual const Teuchos::ParameterList& List() const 
00243   {
00244     return(List_);
00245   }
00246 
00248   virtual std::ostream& Print(std::ostream& os) const;
00249 
00251 
00252 protected:
00253   
00255 
00257   inline void SetLabel(const char* Label) 
00258   {
00259     Label_ = Label;
00260   }
00261 
00263   inline void SetIsInitialized(const bool IsInitialized)
00264   {
00265     IsInitialized_ = IsInitialized;
00266   }
00267 
00269   inline void SetIsComputed(const int IsComputed)
00270   {
00271     IsComputed_ = IsComputed;
00272   }
00273 
00275   inline void SetNumInitialize(const int NumInitialize)
00276   {
00277     NumInitialize_ = NumInitialize;
00278   }
00279 
00281   inline void SetNumCompute(const int NumCompute)
00282   {
00283     NumCompute_ = NumCompute;
00284   }
00285 
00287   inline void SetNumApplyInverse(const int NumApplyInverse)
00288   {
00289     NumApplyInverse_ = NumApplyInverse;
00290   }
00291 
00293   inline void SetInitializeTime(const double InitializeTime)
00294   {
00295     InitializeTime_ = InitializeTime;
00296   }
00297 
00299   inline void SetComputeTime(const double ComputeTime)
00300   {
00301     ComputeTime_ = ComputeTime;
00302   }
00303 
00305   inline void SetApplyInverseTime(const double ApplyInverseTime)
00306   {
00307     ApplyInverseTime_ = ApplyInverseTime;
00308   }
00309 
00311   inline void SetComputeFlops(const double ComputeFlops)
00312   {
00313     ComputeFlops_ = ComputeFlops;
00314   }
00315 
00317   inline void SetApplyInverseFlops(const double ApplyInverseFlops)
00318   {
00319     ApplyInverseFlops_ = ApplyInverseFlops;
00320   }
00321 
00323   inline void SetList(const Teuchos::ParameterList& List)
00324   {
00325     List_ = List;
00326   }
00328   
00329 private:
00330 
00332   const Epetra_RowMatrix* Matrix_;
00333 
00335   Amesos_BaseSolver* Solver_;
00337   Epetra_LinearProblem* Problem_;
00339   Teuchos::ParameterList List_;
00340 
00342   string Label_;
00344   bool IsInitialized_;
00346   bool IsComputed_;
00348   bool UseTranspose_;
00349 
00351   int NumInitialize_;
00353   int NumCompute_;
00355   mutable int NumApplyInverse_;
00356 
00358   double InitializeTime_;
00360   double ComputeTime_;
00362   mutable double ApplyInverseTime_;
00364   Epetra_Time* Time_;
00365 
00367   double ComputeFlops_;
00369   double ApplyInverseFlops_;
00370 
00372   double Condest_;
00373 };
00374 
00375 #endif // HAVE_IFPACK_AMESOS && HAVE_IFPAC_TEUCHOS
00376 #endif // IFPACK_AMESOS_H

Generated on Thu Sep 18 12:37:07 2008 for IFPACK by doxygen 1.3.9.1