Stratimikos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stratimikos_LinearSolverBuilder.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stratimikos: Thyra-based strategies for linear solvers
4 //
5 // Copyright 2006 NTESS and the Stratimikos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
11 
12 #ifdef HAVE_STRATIMIKOS_EXPLICIT_INSTANTIATION
13 
16 
17 namespace Stratimikos {
18 
20 
21 int LinearSolverBuilderHelpers::existingNameIndex(
22  const Teuchos::ArrayView<std::string> namesArray, const std::string &name)
23 {
25  const iter_t iter_begin = namesArray.begin(), iter_end = namesArray.end();
26  const iter_t iter = std::find(iter_begin, iter_end, name);
27  if (iter != iter_end) {
28  return (iter - iter_begin);
29  }
30  return -1;
31 }
32 
33 } // namespace Stratimikos
34 
35 #endif // HAVE_STRATIMIKOS_EXPLICIT_INSTANTIATION
#define TEUCHOS_MACRO_TEMPLATE_INSTANT_SCALAR_TYPES(MACRONAME)
#define STRATIMIKOS_LINEARSOLVERBUILDER_INSTANT(SCALAR)
const_pointer const_iterator
int existingNameIndex(const Teuchos::ArrayView< std::string > namesArray, const std::string &name)
Return the index of a name in an array of names.