Belos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
12 namespace Belos {
13 
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 
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
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
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.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
static ReturnType validatedReturnType(const ReturnType ret)
static int requireNonNegInt(const int k)
ReturnType
Whether the Belos solve converged for all linear systems.
Definition: BelosTypes.hpp:123