eisgenerator 2.1.x
paralellseriel.h
1//SPDX-License-Identifier: LGPL-3.0-or-later
2/* * eisgenerator - a shared libary and application to generate EIS spectra
3 * Copyright (C) 2022-2024 Carl Philipp Klemm <carl@uvos.xyz>
4 *
5 * This file is part of eisgenerator.
6 *
7 * eisgenerator is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * eisgenerator is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with eisgenerator. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#pragma once
22#include <vector>
23#include <complex>
24#include "componant.h"
25
26namespace eis
27{
28
30{
31public:
32 virtual std::vector<fvalue> contributionRatio(fvalue omega) = 0;
33 std::vector<bool> contributes(fvalue omega, fvalue threshold = 0.01);
34};
35
36class Parallel: public ParallelSerial
37{
38public:
39 std::vector<Componant*> componants;
40
41 Parallel(std::vector<Componant*> componantsIn = std::vector<Componant*>());
42 Parallel(const Parallel& in);
43 void operator=(const Parallel& in);
44 ~Parallel();
45 virtual std::complex<fvalue> execute(fvalue omaga) override;
46 virtual char getComponantChar() const override;
47 virtual std::string getComponantString(bool currentValue = true, bool withCount = false) const override;
48 static constexpr char staticGetComponantChar(){return 'd';}
49 virtual std::string componantName() const override {return "Parallel";}
50 virtual bool compileable() override;
51 virtual std::string getCode(std::vector<std::string>& parameters) override;
52 virtual std::string getTorchScript(std::vector<std::string>& parameters) override;
53 virtual std::vector<fvalue> contributionRatio(fvalue omega) override;
54};
55
56class Serial: public ParallelSerial
57{
58public:
59 std::vector<Componant*> componants;
60
61 Serial(std::vector<Componant*> componantsIn = std::vector<Componant*>());
62 Serial(const Serial& in);
63 void operator=(const Serial& in);
64 ~Serial();
65 virtual std::complex<fvalue> execute(fvalue omaga) override;
66 virtual char getComponantChar() const override;
67 virtual std::string getComponantString(bool currentValue = true, bool withCount = false) const override;
68 static constexpr char staticGetComponantChar(){return 's';}
69 virtual std::string componantName() const override {return "Serial";}
70 virtual bool compileable() override;
71 virtual std::string getCode(std::vector<std::string>& parameters) override;
72 virtual std::string getTorchScript(std::vector<std::string>& parameters) override;
73 virtual std::vector<fvalue> contributionRatio(fvalue omega) override;
74};
75
76}
Definition componant.h:32
Definition paralellseriel.h:30
virtual std::string getComponantString(bool currentValue=true, bool withCount=false) const override
Gets this componant as a model string.
virtual std::string getComponantString(bool currentValue=true, bool withCount=false) const override
Gets this componant as a model string.
eisgenerator Copyright (C) 2021 Carl Klemm
Definition basicmath.h:26