ROL
Toggle main menu visibility
Loading...
Searching...
No Matches
src
step
krylov
ROL_Krylov.hpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Rapid Optimization Library (ROL) Package
4
//
5
// Copyright 2014 NTESS and the ROL contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#ifndef ROL_KRYLOV_H
11
#define ROL_KRYLOV_H
12
16
17
#include "
ROL_Vector.hpp
"
18
#include "
ROL_LinearOperator.hpp
"
19
#include "ROL_ParameterList.hpp"
20
21
namespace
ROL
{
22
23
template
<
class
Real>
24
class
Krylov
{
25
26
Real
absTol_
;
// Absolute residual tolerance
27
Real
relTol_
;
// Relative residual tolerance
28
unsigned
maxit_
;
// Maximum number of iterations
29
30
public
:
31
virtual
~Krylov
(
void
) {}
32
33
Krylov
( Real absTol = 1.e-4, Real relTol = 1.e-2,
unsigned
maxit = 100 )
34
:
absTol_
(absTol),
relTol_
(relTol),
maxit_
(maxit) {}
35
36
Krylov
( ROL::ParameterList &parlist ) {
37
ROL::ParameterList &krylovList = parlist.sublist(
"General"
).sublist(
"Krylov"
);
38
absTol_
= krylovList.get(
"Absolute Tolerance"
, 1.e-4);
39
relTol_
= krylovList.get(
"Relative Tolerance"
, 1.e-2);
40
maxit_
= krylovList.get(
"Iteration Limit"
, 100);
41
}
42
43
// Run Krylov Method
44
virtual
Real
run
(
Vector<Real>
&x,
LinearOperator<Real>
&A,
45
const
Vector<Real>
&b,
LinearOperator<Real>
&M,
46
int
&iter,
int
&flag ) = 0;
47
48
void
resetAbsoluteTolerance
(
const
Real absTol) {
49
absTol_
= absTol;
50
}
51
void
resetRelativeTolerance
(
const
Real relTol) {
52
relTol_
= relTol;
53
}
54
void
resetMaximumIteration
(
const
unsigned
maxit) {
55
maxit_
= maxit;
56
}
57
Real
getAbsoluteTolerance
(
void
)
const
{
58
return
absTol_
;
59
}
60
Real
getRelativeTolerance
(
void
)
const
{
61
return
relTol_
;
62
}
63
unsigned
getMaximumIteration
(
void
)
const
{
64
return
maxit_
;
65
}
66
};
67
68
}
69
70
#endif
ROL_LinearOperator.hpp
ROL_Vector.hpp
ROL::Krylov::getMaximumIteration
unsigned getMaximumIteration(void) const
Definition
ROL_Krylov.hpp:63
ROL::Krylov::maxit_
unsigned maxit_
Definition
ROL_Krylov.hpp:28
ROL::Krylov::Krylov
Krylov(ROL::ParameterList &parlist)
Definition
ROL_Krylov.hpp:36
ROL::Krylov::absTol_
Real absTol_
Definition
ROL_Krylov.hpp:26
ROL::Krylov::run
virtual Real run(Vector< Real > &x, LinearOperator< Real > &A, const Vector< Real > &b, LinearOperator< Real > &M, int &iter, int &flag)=0
ROL::Krylov::~Krylov
virtual ~Krylov(void)
Definition
ROL_Krylov.hpp:31
ROL::Krylov::resetMaximumIteration
void resetMaximumIteration(const unsigned maxit)
Definition
ROL_Krylov.hpp:54
ROL::Krylov::Krylov
Krylov(Real absTol=1.e-4, Real relTol=1.e-2, unsigned maxit=100)
Definition
ROL_Krylov.hpp:33
ROL::Krylov::getAbsoluteTolerance
Real getAbsoluteTolerance(void) const
Definition
ROL_Krylov.hpp:57
ROL::Krylov::resetRelativeTolerance
void resetRelativeTolerance(const Real relTol)
Definition
ROL_Krylov.hpp:51
ROL::Krylov::getRelativeTolerance
Real getRelativeTolerance(void) const
Definition
ROL_Krylov.hpp:60
ROL::Krylov::resetAbsoluteTolerance
void resetAbsoluteTolerance(const Real absTol)
Definition
ROL_Krylov.hpp:48
ROL::Krylov::relTol_
Real relTol_
Definition
ROL_Krylov.hpp:27
ROL::LinearOperator
Provides the interface to apply a linear operator.
Definition
ROL_LinearOperator.hpp:37
ROL::Vector
Defines the linear algebra or vector space interface.
Definition
ROL_Vector.hpp:51
ROL
Definition
ROL_ElementwiseVector.hpp:27
Generated by
1.17.0