OGS
CreatePiecewiseLinearCurve.h
Go to the documentation of this file.
1
13
#pragma once
14
15
#include <memory>
16
#include <string>
17
#include <vector>
18
19
namespace
BaseLib
20
{
21
class
ConfigTree;
22
}
23
24
namespace
MathLib
25
{
26
struct
PiecewiseLinearCurveConfig
27
{
28
std::vector<double>
xs
;
29
std::vector<double>
ys
;
30
};
31
32
std::vector<double>
readDoublesFromBinaryFile
(
const
std::string& filename);
33
34
PiecewiseLinearCurveConfig
parsePiecewiseLinearCurveConfig
(
35
BaseLib::ConfigTree
const
& config);
36
39
template
<
typename
CurveType>
40
std::unique_ptr<CurveType>
createPiecewiseLinearCurve
(
41
BaseLib::ConfigTree
const
& config)
42
{
43
auto
[xs, ys] =
parsePiecewiseLinearCurveConfig
(config);
44
return
std::make_unique<CurveType>(std::move(xs), std::move(ys));
45
}
46
};
// namespace MathLib
BaseLib::ConfigTree
Definition
ConfigTree.h:107
BaseLib
Definition
TestDefinition.h:21
MathLib
Definition
CreateComponent.h:32
MathLib::readDoublesFromBinaryFile
std::vector< double > readDoublesFromBinaryFile(const std::string &filename)
MathLib::parsePiecewiseLinearCurveConfig
PiecewiseLinearCurveConfig parsePiecewiseLinearCurveConfig(BaseLib::ConfigTree const &config)
Definition
CreatePiecewiseLinearCurve.cpp:27
MathLib::createPiecewiseLinearCurve
std::unique_ptr< CurveType > createPiecewiseLinearCurve(BaseLib::ConfigTree const &config)
Definition
CreatePiecewiseLinearCurve.h:40
MathLib::PiecewiseLinearCurveConfig
Definition
CreatePiecewiseLinearCurve.h:27
MathLib::PiecewiseLinearCurveConfig::xs
std::vector< double > xs
Definition
CreatePiecewiseLinearCurve.h:28
MathLib::PiecewiseLinearCurveConfig::ys
std::vector< double > ys
Definition
CreatePiecewiseLinearCurve.h:29
MathLib
Curve
CreatePiecewiseLinearCurve.h
Generated by
1.12.0