Belos
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
src
BelosInnerSolveResult.cpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Belos: Block Linear Solvers Package
4
//
5
// Copyright 2004-2016 NTESS and the Belos contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#include <
BelosInnerSolveResult.hpp
>
11
12
namespace
Belos
{
13
14
InnerSolveResult::
15
InnerSolveResult
(
const
ReturnType
theResult,
16
const
int
theNumRestartCycles,
17
const
int
theTotalNumIters,
18
const
std::map<std::string, double>& theExtraData) :
19
result_ (validatedReturnType (theResult)),
20
numRestartCycles_ (requireNonNegInt (theNumRestartCycles)),
21
totalNumIters_ (requireNonNegInt (theTotalNumIters)),
22
extraData_ (theExtraData)
23
{}
24
25
InnerSolveResult::
26
InnerSolveResult
(
const
ReturnType
theResult,
27
const
int
theNumRestartCycles,
28
const
int
theTotalNumIters) :
29
result_ (validatedReturnType (theResult)),
30
numRestartCycles_ (requireNonNegInt (theNumRestartCycles)),
31
totalNumIters_ (requireNonNegInt (theTotalNumIters))
32
{}
33
34
ReturnType
35
InnerSolveResult::validatedReturnType (
const
ReturnType
ret)
36
{
37
TEUCHOS_TEST_FOR_EXCEPTION(ret !=
Converged
|| ret !=
Unconverged
,
38
std::invalid_argument,
39
"Invalid ReturnType enum value "
<< ret <<
". "
40
"Valid values are Converged="
<<
Converged
<<
" and "
41
"Unconverged="
<<
Unconverged
<<
"."
);
42
return
ret;
43
}
44
45
int
46
InnerSolveResult::requireNonNegInt (
const
int
k)
47
{
48
TEUCHOS_TEST_FOR_EXCEPTION(k < 0, std::invalid_argument,
49
"The given integer argument k="
<< k
50
<<
" must be nonnegative."
);
51
return
k;
52
}
53
54
}
// namespace Belos
BelosInnerSolveResult.hpp
Belos::InnerSolveResult::InnerSolveResult
InnerSolveResult(const ReturnType theResult, const int theNumRestartCycles, const int theTotalNumIters, const std::map< std::string, double > &theExtraData)
Constructor.
Definition
BelosInnerSolveResult.cpp:15
Belos
Definition
Belos_Details_EBelosSolverType.cpp:13
Belos::ReturnType
ReturnType
Whether the Belos solve converged for all linear systems.
Definition
BelosTypes.hpp:123
Belos::Unconverged
@ Unconverged
Definition
BelosTypes.hpp:125
Belos::Converged
@ Converged
Definition
BelosTypes.hpp:124
Generated for Belos by
1.17.0