-
Notifications
You must be signed in to change notification settings - Fork 122
/
FitTypes.h
128 lines (101 loc) · 3.36 KB
/
FitTypes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#include "ParamID.h"
#include "TemplateSubType.h"
#include <map>
#include <unordered_map>
namespace MantidQt {
namespace CustomInterfaces {
namespace Inelastic {
namespace IqtTypes {
enum class ExponentialType {
None,
OneExponential,
TwoExponentials,
};
enum class FitType { None, StretchExponential, TeixeiraWaterIqt };
enum class BackgroundType { None, Flat };
enum class TieIntensitiesType { False, True };
enum SubTypeIndex {
Exponential = 0,
Fit = 1,
Background = 2,
TieIntensities = 3,
};
struct ExponentialSubType : public TemplateSubTypeImpl<ExponentialType> {
std::string name() const override { return "Exponentials"; }
bool isType(const std::type_info &type) const override { return type == typeid(int); }
};
struct FitSubType : public TemplateSubTypeImpl<FitType> {
std::string name() const override { return "Fit Type"; }
};
struct BackgroundSubType : public TemplateSubTypeImpl<BackgroundType> {
std::string name() const override { return "Background"; }
};
struct TieIntensitiesSubType : public TemplateSubTypeImpl<TieIntensitiesType> {
std::string name() const override { return "Tie Intensities"; }
bool isType(const std::type_info &type) const override { return type == typeid(bool); }
};
} // namespace IqtTypes
namespace ConvTypes {
enum class LorentzianType {
None,
OneLorentzian,
TwoLorentzians,
};
enum class FitType {
None,
TeixeiraWater,
FickDiffusion,
ChudleyElliot,
HallRoss,
StretchedExpFT,
DiffSphere,
ElasticDiffSphere,
InelasticDiffSphere,
DiffRotDiscreteCircle,
ElasticDiffRotDiscreteCircle,
InelasticDiffRotDiscreteCircle,
IsoRotDiff,
ElasticIsoRotDiff,
InelasticIsoRotDiff,
};
enum class DeltaType { None, Delta };
enum class TempCorrectionType { None, Exponential };
enum class BackgroundType { None, Flat, Linear };
enum SubTypeIndex {
Lorentzian = 0,
Fit = 1,
Delta = 2,
TempCorrection = 3,
Background = 4,
};
extern std::map<FitType, bool> FitTypeQDepends;
extern std::unordered_map<std::string, FitType> FitTypeStringToEnum;
struct LorentzianSubType : public TemplateSubTypeImpl<LorentzianType> {
std::string name() const override { return "Lorentzians"; }
bool isType(const std::type_info &type) const override { return type == typeid(int); }
};
struct FitSubType : public TemplateSubTypeImpl<FitType> {
std::string name() const override { return "Fit Type"; }
};
struct DeltaSubType : public TemplateSubTypeImpl<DeltaType> {
std::string name() const override { return "Delta Function"; }
bool isType(const std::type_info &type) const override { return type == typeid(bool); }
};
struct TempSubType : public TemplateSubTypeImpl<TempCorrectionType> {
std::string name() const override { return "ConvTempCorrection"; }
bool isType(const std::type_info &type) const override { return type == typeid(bool); }
};
struct BackgroundSubType : public TemplateSubTypeImpl<BackgroundType> {
std::string name() const override { return "Background"; }
};
} // namespace ConvTypes
} // namespace Inelastic
} // namespace CustomInterfaces
} // namespace MantidQt