Belos  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BelosSolverFactory.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 "BelosSolverFactory.hpp"
11 #include <locale>
12 
13 namespace Belos {
14 namespace Impl {
15 
16 void
17 printStringArray (std::ostream& out,
19 {
21 
22  out << "[";
23  for (iter_type iter = array.begin(); iter != array.end(); ++iter) {
24  out << "\"" << *iter << "\"";
25  if (iter + 1 != array.end()) {
26  out << ", ";
27  }
28  }
29  out << "]";
30 }
31 
32 void
33 printStringArray (std::ostream& out,
34  const std::vector<std::string>& array)
35 {
37  if (array.size () == 0) {
39  }
40  else {
41  av = Teuchos::ArrayView<const std::string> (&array[0], array.size ());
42  }
43  printStringArray (out, av);
44 }
45 
46 std::string
47 upperCase (const std::string& s)
48 {
49  typedef std::string::value_type char_t;
50  typedef std::ctype<char_t> facet_type;
51  const facet_type& facet = std::use_facet<facet_type> (std::locale ());
52 
53  const std::string::size_type len = s.size ();
54  std::string s_uc (s);
55  for (std::string::size_type k = 0; k < len; ++k) {
56  s_uc[k] = facet.toupper (s[k]);
57  }
58 
59  return s_uc;
60 }
61 
62 } // namespace Impl
63 } // namespace Belos
64 
65 
iterator begin() const
const_pointer const_iterator
size_type size() const
std::string upperCase(const std::string &s)
Return the upper-case version of s.
void printStringArray(std::ostream &out, const Teuchos::ArrayView< const std::string > &array)
Print the given array of strings, in YAML format, to out.
iterator end() const

Generated on Fri Nov 22 2024 09:23:06 for Belos by doxygen 1.8.5