1#ifndef LSST_GAUSS2D_FIT_TRANSFORMS_H
2#define LSST_GAUSS2D_FIT_TRANSFORMS_H
11#pragma GCC diagnostic push
12#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
20 const std::string_view& namespace_separator
21 = parameters::Object::CC_NAMESPACE_SEPARATOR)
const override {
22 return parameters::type_name_str<InverseTransform>(
false, namespace_separator) +
"()";
24 std::string str()
const override {
return parameters::type_name_str<InverseTransform>(
true) +
"()"; }
26 inline double derivative(
double x)
const override {
return 1 / (
x *
x); }
27 inline double forward(
double x)
const override {
return 1 /
x; }
28 inline double reverse(
double x)
const override {
return 1 /
x; }
32 static inline const double f_nu_0 = 3630.780547701002879554236770479;
36 const std::string_view& namespace_separator
37 = parameters::Object::CC_NAMESPACE_SEPARATOR)
const override {
38 return parameters::type_name_str<JanskyToABMagTransform>(
false, namespace_separator) +
"()";
41 return parameters::type_name_str<JanskyToABMagTransform>(
true) +
"()";
45 return -1.08573620475812959718098227313021197915 /
x;
47 inline double forward(
double x)
const override {
return -2.5 * log10(
x /
f_nu_0); }
48 inline double reverse(
double x)
const override {
return f_nu_0 * pow(10.0, -0.4 *
x); }
54 const std::string_view& namespace_separator
55 = parameters::Object::CC_NAMESPACE_SEPARATOR)
const override {
56 return parameters::type_name_str<NanojanskyToABMagTransform>(
false, namespace_separator) +
"()";
59 return parameters::type_name_str<NanojanskyToABMagTransform>(
true) +
"()";
70 const std::string_view& namespace_separator
71 = parameters::Object::CC_NAMESPACE_SEPARATOR)
const override {
72 return parameters::type_name_str<LogTransform>(
false, namespace_separator) +
"()";
74 std::string str()
const override {
return parameters::type_name_str<LogTransform>(
true) +
"()"; }
76 inline double derivative(
double x)
const override {
return 1 /
x; }
77 inline double forward(
double x)
const override {
return log(
x); }
78 inline double reverse(
double x)
const override {
return exp(
x); }
84 const std::string_view& namespace_separator
85 = parameters::Object::CC_NAMESPACE_SEPARATOR)
const override {
86 return parameters::type_name_str<Log10Transform>(
false, namespace_separator) +
"()";
88 std::string str()
const override {
return parameters::type_name_str<Log10Transform>(
true) +
"()"; }
91 return 0.434294481903251827651128918916605082294397 /
x;
93 inline double forward(
double x)
const override {
return log10(
x); }
94 inline double reverse(
double x)
const override {
return pow(10.,
x); }
100 const std::string_view& namespace_separator
101 = parameters::Object::CC_NAMESPACE_SEPARATOR)
const override {
102 return parameters::type_name_str<LogitTransform>(
false, namespace_separator) +
"()";
104 std::string str()
const override {
return parameters::type_name_str<LogitTransform>(
true) +
"()"; }
106 inline double derivative(
double x)
const override {
return 1 /
x + 1 / (1 -
x); }
107 inline double forward(
double x)
const override {
return log(
x / (1 -
x)); }
108 inline double reverse(
double x)
const override {
return 1 / (1 + exp(-
x)); }
121 const std::string_view& namespace_separator
122 = parameters::Object::CC_NAMESPACE_SEPARATOR)
const override {
123 return parameters::type_name_str<LogitLimitedTransform>(
false, namespace_separator) +
"("
124 + (name_keywords ?
"limits=" :
"") + _limits->repr(name_keywords, namespace_separator) +
", "
125 + (name_keywords ?
"factor=" :
"") +
std::to_string(_factor) +
")";
128 return parameters::type_name_str<LogitLimitedTransform>(
true) +
"(limits=" + _limits->str()
136 double forward(
double x)
const override;
137 double reverse(
double x)
const override;
155 inline void _set_range() { _range = _limits->get_max() - _limits->get_min(); }
160 static T transform_default{};
164#pragma GCC diagnostic pop
Range-based limits for parameter values.
parameters::Transform< double > Transform
std::shared_ptr< T > get_transform_default()