eisdrt 1.0.x
types.h
1/* * libeisdrt - A library to calculate EIS Drts
2 * Copyright (C) 2023 Carl Klemm <carl@uvos.xyz>
3 *
4 * This file is part of libeisdrt.
5 *
6 * libeisdrt is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * libeisdrt is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with libeisdrt. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21#include <exception>
22#include <string>
23
35class drt_error: public std::exception
36{
37 std::string whatStr;
38public:
39 drt_error(const std::string& whatIn): whatStr(whatIn)
40 {}
41 virtual const char* what() const noexcept override
42 {
43 return whatStr.c_str();
44 }
45};
46
51{
53 double fx;
55};
56
58{
59 int maxIter;
60 double epsilon;
61 double step;
62 FitParameters(int maxIterI, double epsilonI = 1e-2, double stepI = 0.001): maxIter(maxIterI), epsilon(epsilonI), step(stepI){}
63};
64
This exception thrown if drt could not be calculated.
Definition types.h:36
This is used to return information on a fit.
Definition types.h:51
int iterations
how many iterations where used
Definition types.h:52
double fx
error function value remaining after fit
Definition types.h:53
bool compleated
true if fit completed successfully
Definition types.h:54
Definition types.h:58