SpECTRE
v2021.02.08
Documentation
Introduction
Releases
Installation
User Tutorials
Dev Guide
Code of Conduct
Contributing Guide
Code Reference
Topics
Namespaces
Files
Bibliography
View on GitHub
src
Options
StdComplex.hpp
1
// Distributed under the MIT License.
2
// See LICENSE.txt for details.
3
4
#pragma once
5
6
#include <
complex
>
7
#include <
utility
>
8
9
#include "
Options/Options.hpp
"
10
11
/// Parse complex numbers as pairs of doubles.
12
template
<>
13
struct
Options::create_from_yaml
<std::complex<double>> {
14
template
<
typename
Metavariables>
15
static
std::complex<double>
create(
const
Options::Option
& options) {
16
const
auto
pair_of_doubles = options.
parse_as
<
std::pair<double, double>
>();
17
return
std::complex<double>
(pair_of_doubles.first, pair_of_doubles.second);
18
}
19
};
utility
std::pair
Options.hpp
Options::Option
Definition:
Options.hpp:108
Options::create_from_yaml
Definition:
MinmodType.hpp:11
Options::Option::parse_as
T parse_as() const
Convert to an object of type T.
Definition:
ParseOptions.hpp:92
complex
© Copyright 2017 - 2021
SXS Collaboration
,
Distributed under the
MIT License