Epetra Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Epetra_LinearProblem.h
Go to the documentation of this file.
1 /*
2 //@HEADER
3 // ************************************************************************
4 //
5 // Epetra: Linear Algebra Services Package
6 // Copyright 2011 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
39 //
40 // ************************************************************************
41 //@HEADER
42 */
43 
44 #ifndef EPETRA_LINEARPROBLEM_H
45 #define EPETRA_LINEARPROBLEM_H
46 
47 #include "Epetra_RowMatrix.h"
48 #include "Epetra_Operator.h"
49 #ifndef DOXYGEN_SHOULD_SKIP_THIS
50 enum ProblemDifficultyLevel {easy, moderate, hard, unsure};
51 #endif
52 
54 
62 class EPETRA_LIB_DLL_EXPORT Epetra_LinearProblem {
63 
64  public:
66 
67 
73 
75 
79 
81 
84  Epetra_MultiVector * B);
86 
89 
91 
93  virtual ~Epetra_LinearProblem(void);
95 
97 
98 
100 
104  int CheckInput() const;
106 
108 
109 
110  void AssertSymmetric(){OperatorSymmetric_ = true;};
111 #ifdef DOXYGEN_SHOULD_SKIP_THIS
112  enum ProblemDifficultyLevel {easy, moderate, hard, unsure};
113 #endif
114 
119  void SetPDL(ProblemDifficultyLevel PDL) {PDL_ = PDL;};
120 
122 
125  { A_ = A; Operator_ = A; }
126 
128 
131  { A_ = dynamic_cast<Epetra_RowMatrix *>(A); Operator_ = A; }
132 
134 
136  void SetLHS(Epetra_MultiVector * X) {X_ = X;}
137 
139 
141  void SetRHS(Epetra_MultiVector * B) {B_ = B;}
143 
145 
146 
155  int LeftScale(const Epetra_Vector & D);
156 
158 
167  int RightScale(const Epetra_Vector & D);
169 
171 
172  Epetra_Operator * GetOperator() const {return(Operator_);};
175  Epetra_RowMatrix * GetMatrix() const {return(A_);};
177  Epetra_MultiVector * GetLHS() const {return(X_);};
179  Epetra_MultiVector * GetRHS() const {return(B_);};
181  ProblemDifficultyLevel GetPDL() const {return(PDL_);};
183  bool IsOperatorSymmetric() const {return(OperatorSymmetric_);};
185 
186  private:
187 
188  Epetra_Operator * Operator_;
192 
199  Epetra_LinearProblem & operator=(const Epetra_LinearProblem& Problem);
200 };
201 
202 #endif /* EPETRA_LINEARPROBLEM_H */
void SetOperator(Epetra_Operator *A)
Set Operator A of linear problem AX = B using an Epetra_Operator.
Epetra_MultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in p...
void SetLHS(Epetra_MultiVector *X)
Set left-hand-side X of linear problem AX = B.
void SetOperator(Epetra_RowMatrix *A)
Set Operator A of linear problem AX = B using an Epetra_RowMatrix.
Epetra_MultiVector * GetLHS() const
Get a pointer to the left-hand-side X.
Epetra_MultiVector * GetRHS() const
Get a pointer to the right-hand-side B.
Epetra_MultiVector * X_
Epetra_Vector: A class for constructing and using dense vectors on a parallel computer.
Epetra_MultiVector * B_
Epetra_Vector * RightScaleVector_
ProblemDifficultyLevel PDL_
void SetRHS(Epetra_MultiVector *B)
Set right-hand-side B of linear problem AX = B.
Epetra_RowMatrix * GetMatrix() const
Get a pointer to the matrix A.
Epetra_Vector * LeftScaleVector_
Epetra_Operator: A pure virtual class for using real-valued double-precision operators.
ProblemDifficultyLevel GetPDL() const
Get problem difficulty level.
Epetra_LinearProblem: The Epetra Linear Problem Class.
void SetPDL(ProblemDifficultyLevel PDL)
Set problem difficulty level.
Epetra_RowMatrix: A pure virtual class for using real-valued double-precision row matrices...