Epetra Package Browser (Single Doxygen Collection) Development
Epetra_LinearProblem.h
Go to the documentation of this file.
00001 /*
00002 //@HEADER
00003 // ************************************************************************
00004 //
00005 //               Epetra: Linear Algebra Services Package
00006 //                 Copyright 2011 Sandia Corporation
00007 //
00008 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00009 // the U.S. Government retains certain rights in this software.
00010 //
00011 // Redistribution and use in source and binary forms, with or without
00012 // modification, are permitted provided that the following conditions are
00013 // met:
00014 //
00015 // 1. Redistributions of source code must retain the above copyright
00016 // notice, this list of conditions and the following disclaimer.
00017 //
00018 // 2. Redistributions in binary form must reproduce the above copyright
00019 // notice, this list of conditions and the following disclaimer in the
00020 // documentation and/or other materials provided with the distribution.
00021 //
00022 // 3. Neither the name of the Corporation nor the names of the
00023 // contributors may be used to endorse or promote products derived from
00024 // this software without specific prior written permission.
00025 //
00026 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00027 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00029 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00030 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00031 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00032 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00033 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00034 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00035 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00036 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 //
00038 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00039 //
00040 // ************************************************************************
00041 //@HEADER
00042 */
00043 
00044 #ifndef EPETRA_LINEARPROBLEM_H
00045 #define EPETRA_LINEARPROBLEM_H
00046 
00047 #include "Epetra_RowMatrix.h"
00048 #include "Epetra_Operator.h"
00049 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00050 enum ProblemDifficultyLevel {easy, moderate, hard, unsure};
00051 #endif
00052 
00054 
00062 class EPETRA_LIB_DLL_EXPORT Epetra_LinearProblem {
00063 
00064   public:
00066 
00067 
00068 
00072   Epetra_LinearProblem(void);
00073 
00075 
00077   Epetra_LinearProblem(Epetra_RowMatrix * A, Epetra_MultiVector * X,
00078        Epetra_MultiVector * B);
00079 
00081 
00083   Epetra_LinearProblem(Epetra_Operator * A, Epetra_MultiVector * X,
00084                        Epetra_MultiVector * B);
00086 
00088   Epetra_LinearProblem(const Epetra_LinearProblem& Problem);
00089 
00091 
00093   virtual ~Epetra_LinearProblem(void);
00095 
00097 
00098 
00100 
00104   int CheckInput() const;
00106 
00108 
00109 
00110   void AssertSymmetric(){OperatorSymmetric_ = true;};
00111 #ifdef DOXYGEN_SHOULD_SKIP_THIS
00112   enum ProblemDifficultyLevel {easy, moderate, hard, unsure};
00113 #endif
00114 
00115 
00119   void SetPDL(ProblemDifficultyLevel PDL) {PDL_ = PDL;};
00120 
00122 
00124   void SetOperator(Epetra_RowMatrix * A)
00125     { A_ = A; Operator_ = A; }
00126 
00128 
00130   void SetOperator(Epetra_Operator * A)
00131     { A_ = dynamic_cast<Epetra_RowMatrix *>(A); Operator_ = A; }
00132 
00134 
00136   void SetLHS(Epetra_MultiVector * X) {X_ = X;}
00137 
00139 
00141   void SetRHS(Epetra_MultiVector * B) {B_ = B;}
00143 
00145 
00146 
00147 
00155   int LeftScale(const Epetra_Vector & D);
00156 
00158 
00167   int RightScale(const Epetra_Vector & D);
00169 
00171 
00172 
00173   Epetra_Operator * GetOperator() const {return(Operator_);};
00175   Epetra_RowMatrix * GetMatrix() const {return(A_);};
00177   Epetra_MultiVector * GetLHS() const {return(X_);};
00179   Epetra_MultiVector * GetRHS() const {return(B_);};
00181   ProblemDifficultyLevel GetPDL() const {return(PDL_);};
00183   bool IsOperatorSymmetric() const {return(OperatorSymmetric_);};
00185 
00186  private:
00187 
00188   Epetra_Operator * Operator_;
00189   Epetra_RowMatrix * A_;
00190   Epetra_MultiVector * X_;
00191   Epetra_MultiVector * B_;
00192 
00193   bool OperatorSymmetric_;
00194   ProblemDifficultyLevel PDL_;
00195   bool LeftScaled_;
00196   bool RightScaled_;
00197   Epetra_Vector * LeftScaleVector_;
00198   Epetra_Vector * RightScaleVector_;
00199   Epetra_LinearProblem & operator=(const Epetra_LinearProblem& Problem);
00200 };
00201 
00202 #endif /* EPETRA_LINEARPROBLEM_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines