Belos Version of the Day
Loading...
Searching...
No Matches
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
11#include <locale>
12
13namespace Belos {
14namespace Impl {
15
16void
17printStringArray (std::ostream& out,
18 const Teuchos::ArrayView<const std::string>& array)
19{
20 typedef Teuchos::ArrayView<std::string>::const_iterator iter_type;
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
32void
33printStringArray (std::ostream& out,
34 const std::vector<std::string>& array)
35{
36 Teuchos::ArrayView<const std::string> av;
37 if (array.size () == 0) {
38 av = Teuchos::ArrayView<const std::string> (NULL, 0);
39 }
40 else {
41 av = Teuchos::ArrayView<const std::string> (&array[0], array.size ());
42 }
44}
45
46std::string
47upperCase (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
Alternative run-time polymorphic interface for operators.
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.

Generated for Belos by doxygen 1.9.8