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 #if defined(Epetra_SHOW_DEPRECATED_WARNINGS)
48 #ifdef __GNUC__
49 #warning "The Epetra package is deprecated"
50 #endif
51 #endif
52 
53 
54 
55 #include "Epetra_RowMatrix.h"
56 #include "Epetra_Operator.h"
57 #ifndef DOXYGEN_SHOULD_SKIP_THIS
58 enum ProblemDifficultyLevel {easy, moderate, hard, unsure};
59 #endif
60 
62 
70 class EPETRA_LIB_DLL_EXPORT Epetra_LinearProblem {
71 
72  public:
74 
75 
81 
83 
87 
89 
92  Epetra_MultiVector * B);
94 
97 
99 
101  virtual ~Epetra_LinearProblem(void);
103 
105 
106 
108 
112  int CheckInput() const;
114 
116 
117 
118  void AssertSymmetric(){OperatorSymmetric_ = true;};
119 #ifdef DOXYGEN_SHOULD_SKIP_THIS
120  enum ProblemDifficultyLevel {easy, moderate, hard, unsure};
121 #endif
122 
127  void SetPDL(ProblemDifficultyLevel PDL) {PDL_ = PDL;};
128 
130 
133  { A_ = A; Operator_ = A; }
134 
136 
139  { A_ = dynamic_cast<Epetra_RowMatrix *>(A); Operator_ = A; }
140 
142 
144  void SetLHS(Epetra_MultiVector * X) {X_ = X;}
145 
147 
149  void SetRHS(Epetra_MultiVector * B) {B_ = B;}
151 
153 
154 
163  int LeftScale(const Epetra_Vector & D);
164 
166 
175  int RightScale(const Epetra_Vector & D);
177 
179 
180  Epetra_Operator * GetOperator() const {return(Operator_);};
183  Epetra_RowMatrix * GetMatrix() const {return(A_);};
185  Epetra_MultiVector * GetLHS() const {return(X_);};
187  Epetra_MultiVector * GetRHS() const {return(B_);};
189  ProblemDifficultyLevel GetPDL() const {return(PDL_);};
191  bool IsOperatorSymmetric() const {return(OperatorSymmetric_);};
193 
194  private:
195 
196  Epetra_Operator * Operator_;
200 
207  Epetra_LinearProblem & operator=(const Epetra_LinearProblem& Problem);
208 };
209 
210 #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...