Epetra_LinearProblem.h

Go to the documentation of this file.
00001 
00002 //@HEADER
00003 /*
00004 ************************************************************************
00005 
00006               Epetra: Linear Algebra Services Package 
00007                 Copyright (2001) Sandia Corporation
00008 
00009 Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00010 license for use of this work by or on behalf of the U.S. Government.
00011 
00012 This library is free software; you can redistribute it and/or modify
00013 it under the terms of the GNU Lesser General Public License as
00014 published by the Free Software Foundation; either version 2.1 of the
00015 License, or (at your option) any later version.
00016  
00017 This library is distributed in the hope that it will be useful, but
00018 WITHOUT ANY WARRANTY; without even the implied warranty of
00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020 Lesser General Public License for more details.
00021  
00022 You should have received a copy of the GNU Lesser General Public
00023 License along with this library; if not, write to the Free Software
00024 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00025 USA
00026 Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00027 
00028 ************************************************************************
00029 */
00030 //@HEADER
00031 
00032 #ifndef EPETRA_LINEARPROBLEM_H
00033 #define EPETRA_LINEARPROBLEM_H
00034 
00035 #include "Epetra_RowMatrix.h"
00036 #include "Epetra_Operator.h"
00037 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00038 enum ProblemDifficultyLevel {easy, moderate, hard, unsure};
00039 #endif
00040 
00042 
00050 class Epetra_LinearProblem {
00051     
00052   public:
00054 
00055 
00056 
00060   Epetra_LinearProblem(void);
00061 
00063 
00065   Epetra_LinearProblem(Epetra_RowMatrix * A, Epetra_MultiVector * X,
00066        Epetra_MultiVector * B);
00067 
00069 
00071   Epetra_LinearProblem(Epetra_Operator * A, Epetra_MultiVector * X,
00072                        Epetra_MultiVector * B);
00074 
00076   Epetra_LinearProblem(const Epetra_LinearProblem& Problem);
00077 
00079 
00081   virtual ~Epetra_LinearProblem(void);
00083   
00085 
00086 
00088 
00092   int CheckInput() const;
00094   
00096 
00097 
00098   void AssertSymmetric(){OperatorSymmetric_ = true;};
00099 #ifdef DOXYGEN_SHOULD_SKIP_THIS
00100   enum ProblemDifficultyLevel {easy, moderate, hard, unsure};
00101 #endif
00103 
00107   void SetPDL(ProblemDifficultyLevel PDL) {PDL_ = PDL;};
00108 
00110 
00112   void SetOperator(Epetra_RowMatrix * A)
00113     { A_ = A; Operator_ = A; }
00114 
00116 
00118   void SetOperator(Epetra_Operator * A)
00119     { A_ = dynamic_cast<Epetra_RowMatrix *>(A); Operator_ = A; }
00120 
00122 
00124   void SetLHS(Epetra_MultiVector * X) {X_ = X;}
00125 
00127 
00129   void SetRHS(Epetra_MultiVector * B) {B_ = B;}
00131   
00133 
00134 
00135 
00143   int LeftScale(const Epetra_Vector & D);
00144 
00146 
00155   int RightScale(const Epetra_Vector & D);
00157 
00159 
00160 
00161   Epetra_Operator * GetOperator() const {return(Operator_);};
00163   Epetra_RowMatrix * GetMatrix() const {return(A_);};
00165   Epetra_MultiVector * GetLHS() const {return(X_);};
00167   Epetra_MultiVector * GetRHS() const {return(B_);};
00169   ProblemDifficultyLevel GetPDL() const {return(PDL_);};
00171   bool IsOperatorSymmetric() const {return(OperatorSymmetric_);};
00173 
00174  private:
00175 
00176   Epetra_Operator * Operator_;
00177   Epetra_RowMatrix * A_;
00178   Epetra_MultiVector * X_;
00179   Epetra_MultiVector * B_;
00180 
00181   bool OperatorSymmetric_;
00182   ProblemDifficultyLevel PDL_;
00183   bool LeftScaled_;
00184   bool RightScaled_;
00185   Epetra_Vector * LeftScaleVector_;
00186   Epetra_Vector * RightScaleVector_;
00187   Epetra_LinearProblem & operator=(const Epetra_LinearProblem& Problem);
00188 };
00189 
00190 #endif /* EPETRA_LINEARPROBLEM_H */

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