Epetra Package Browser (Single Doxygen Collection)
Development
Toggle main menu visibility
Loading...
Searching...
No Matches
src
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
60
61
62
class
EPETRA_LIB_DLL_EXPORT
Epetra_LinearProblem
{
63
64
public
:
66
67
72
Epetra_LinearProblem
(
void
);
73
75
77
Epetra_LinearProblem
(
Epetra_RowMatrix
* A,
Epetra_MultiVector
* X,
78
Epetra_MultiVector
* B);
79
81
83
Epetra_LinearProblem
(
Epetra_Operator
* A,
Epetra_MultiVector
* X,
84
Epetra_MultiVector
* B);
86
88
Epetra_LinearProblem
(
const
Epetra_LinearProblem
& Problem);
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
115
119
void
SetPDL
(
ProblemDifficultyLevel
PDL) {
PDL_
= PDL;};
120
122
124
void
SetOperator
(
Epetra_RowMatrix
* A)
125
{
A_
= A;
Operator_
= A; }
126
128
130
void
SetOperator
(
Epetra_Operator
* A)
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
173
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_
;
189
Epetra_RowMatrix
*
A_
;
190
Epetra_MultiVector
*
X_
;
191
Epetra_MultiVector
*
B_
;
192
193
bool
OperatorSymmetric_
;
194
ProblemDifficultyLevel
PDL_
;
195
bool
LeftScaled_
;
196
bool
RightScaled_
;
197
Epetra_Vector
*
LeftScaleVector_
;
198
Epetra_Vector
*
RightScaleVector_
;
199
Epetra_LinearProblem
&
operator=
(
const
Epetra_LinearProblem
& Problem);
200
};
201
202
#endif
/* EPETRA_LINEARPROBLEM_H */
Epetra_Operator.h
Epetra_RowMatrix.h
Epetra_LinearProblem::SetOperator
void SetOperator(Epetra_Operator *A)
Set Operator A of linear problem AX = B using an Epetra_Operator.
Definition
Epetra_LinearProblem.h:130
Epetra_LinearProblem::GetRHS
Epetra_MultiVector * GetRHS() const
Get a pointer to the right-hand-side B.
Definition
Epetra_LinearProblem.h:179
Epetra_LinearProblem::GetPDL
ProblemDifficultyLevel GetPDL() const
Get problem difficulty level.
Definition
Epetra_LinearProblem.h:181
Epetra_LinearProblem::OperatorSymmetric_
bool OperatorSymmetric_
Definition
Epetra_LinearProblem.h:193
Epetra_LinearProblem::A_
Epetra_RowMatrix * A_
Definition
Epetra_LinearProblem.h:189
Epetra_LinearProblem::SetOperator
void SetOperator(Epetra_RowMatrix *A)
Set Operator A of linear problem AX = B using an Epetra_RowMatrix.
Definition
Epetra_LinearProblem.h:124
Epetra_LinearProblem::Operator_
Epetra_Operator * Operator_
Definition
Epetra_LinearProblem.h:188
Epetra_LinearProblem::LeftScaled_
bool LeftScaled_
Definition
Epetra_LinearProblem.h:195
Epetra_LinearProblem::operator=
Epetra_LinearProblem & operator=(const Epetra_LinearProblem &Problem)
Epetra_LinearProblem::CheckInput
int CheckInput() const
Check input parameters for existence and size consistency.
Definition
Epetra_LinearProblem.cpp:147
Epetra_LinearProblem::RightScaleVector_
Epetra_Vector * RightScaleVector_
Definition
Epetra_LinearProblem.h:198
Epetra_LinearProblem::ProblemDifficultyLevel
ProblemDifficultyLevel
Definition
Epetra_LinearProblem.h:112
Epetra_LinearProblem::hard
@ hard
Definition
Epetra_LinearProblem.h:112
Epetra_LinearProblem::unsure
@ unsure
Definition
Epetra_LinearProblem.h:112
Epetra_LinearProblem::moderate
@ moderate
Definition
Epetra_LinearProblem.h:112
Epetra_LinearProblem::easy
@ easy
Definition
Epetra_LinearProblem.h:112
Epetra_LinearProblem::SetRHS
void SetRHS(Epetra_MultiVector *B)
Set right-hand-side B of linear problem AX = B.
Definition
Epetra_LinearProblem.h:141
Epetra_LinearProblem::GetOperator
Epetra_Operator * GetOperator() const
Get a pointer to the operator A.
Definition
Epetra_LinearProblem.h:173
Epetra_LinearProblem::AssertSymmetric
void AssertSymmetric()
Definition
Epetra_LinearProblem.h:110
Epetra_LinearProblem::X_
Epetra_MultiVector * X_
Definition
Epetra_LinearProblem.h:190
Epetra_LinearProblem::IsOperatorSymmetric
bool IsOperatorSymmetric() const
Get operator symmetry bool.
Definition
Epetra_LinearProblem.h:183
Epetra_LinearProblem::GetMatrix
Epetra_RowMatrix * GetMatrix() const
Get a pointer to the matrix A.
Definition
Epetra_LinearProblem.h:175
Epetra_LinearProblem::SetPDL
void SetPDL(ProblemDifficultyLevel PDL)
Set problem difficulty level.
Definition
Epetra_LinearProblem.h:119
Epetra_LinearProblem::PDL_
ProblemDifficultyLevel PDL_
Definition
Epetra_LinearProblem.h:194
Epetra_LinearProblem::SetLHS
void SetLHS(Epetra_MultiVector *X)
Set left-hand-side X of linear problem AX = B.
Definition
Epetra_LinearProblem.h:136
Epetra_LinearProblem::B_
Epetra_MultiVector * B_
Definition
Epetra_LinearProblem.h:191
Epetra_LinearProblem::Epetra_LinearProblem
Epetra_LinearProblem(void)
Epetra_LinearProblem Default Constructor.
Definition
Epetra_LinearProblem.cpp:50
Epetra_LinearProblem::RightScaled_
bool RightScaled_
Definition
Epetra_LinearProblem.h:196
Epetra_LinearProblem::GetLHS
Epetra_MultiVector * GetLHS() const
Get a pointer to the left-hand-side X.
Definition
Epetra_LinearProblem.h:177
Epetra_LinearProblem::LeftScaleVector_
Epetra_Vector * LeftScaleVector_
Definition
Epetra_LinearProblem.h:197
Epetra_MultiVector
Epetra_MultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in p...
Definition
Epetra_MultiVector.h:184
Epetra_Operator
Epetra_Operator: A pure virtual class for using real-valued double-precision operators.
Definition
Epetra_Operator.h:60
Epetra_RowMatrix
Epetra_RowMatrix: A pure virtual class for using real-valued double-precision row matrices.
Definition
Epetra_RowMatrix.h:68
Epetra_Vector
Epetra_Vector: A class for constructing and using dense vectors on a parallel computer.
Definition
Epetra_Vector.h:142
Generated by
1.17.0