Belos Version of the Day
Loading...
Searching...
No Matches
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
11
12namespace Belos {
13
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
27 const int theNumRestartCycles,
28 const int theTotalNumIters) :
29 result_ (validatedReturnType (theResult)),
30 numRestartCycles_ (requireNonNegInt (theNumRestartCycles)),
31 totalNumIters_ (requireNonNegInt (theTotalNumIters))
32 {}
33
35 InnerSolveResult::validatedReturnType (const ReturnType ret)
36 {
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
InnerSolveResult(const ReturnType theResult, const int theNumRestartCycles, const int theTotalNumIters, const std::map< std::string, double > &theExtraData)
Constructor.
Alternative run-time polymorphic interface for operators.
ReturnType
Whether the Belos solve converged for all linear systems.
@ Unconverged

Generated for Belos by doxygen 1.9.8