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
19namespace BaseLib
20{
21class ConfigTree;
22}
23
24namespace MathLib
25{
27{
28 std::vector<double> xs;
29 std::vector<double> ys;
30};
31
32std::vector<double> readDoublesFromBinaryFile(const std::string& filename);
33
35 BaseLib::ConfigTree const& config);
36
39template <typename CurveType>
40std::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
std::vector< double > readDoublesFromBinaryFile(const std::string &filename)
PiecewiseLinearCurveConfig parsePiecewiseLinearCurveConfig(BaseLib::ConfigTree const &config)
std::unique_ptr< CurveType > createPiecewiseLinearCurve(BaseLib::ConfigTree const &config)