Belos
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
src
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,
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
32
void
33
printStringArray
(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
}
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
BelosSolverFactory.hpp
Belos::Impl
Definition
BelosSolverFactory.cpp:14
Belos::Impl::upperCase
std::string upperCase(const std::string &s)
Return the upper-case version of s.
Definition
BelosSolverFactory.cpp:47
Belos::Impl::printStringArray
void printStringArray(std::ostream &out, const Teuchos::ArrayView< const std::string > &array)
Print the given array of strings, in YAML format, to out.
Definition
BelosSolverFactory.cpp:17
Belos
Definition
Belos_Details_EBelosSolverType.cpp:13
Generated for Belos by
1.17.0