2#include "matpack_math.h"
39 const Numeric G =
T0 /
T[i];
40 const Numeric GX = std::pow(G, p[2]);
41 f[i] = (p[0] + p[1] * (G - 1)) * GX -
Y[i];
48 const Numeric G =
T0 /
T[i];
49 const Numeric GX = std::pow(G, p[2]);
51 J(i, 1) = (G - 1) * GX;
52 J(i, 2) = (p[0] + p[1] * (G - 1)) * GX * std::log(G);
58 const Numeric mean_y =
mean(
Y);
60 out << mean_y, -0.01*mean_y, mean_y < 0 ? -
EXP0 :
EXP0;
66 const Numeric G =
T0 /
T[i];
67 const Numeric GX1 = std::pow(G, p[1]);
68 const Numeric GX3 = std::pow(G, p[3]);
69 f[i] = p[0] * GX1 + p[2] * GX3 -
Y[i];
76 const Numeric G =
T0 /
T[i];
77 const Numeric lG = std::log(G);
78 const Numeric GX1 = std::pow(G, p[1]);
79 const Numeric GX3 = std::pow(G, p[3]);
81 J(i, 1) = p[0] * GX1 * lG;
83 J(i, 3) = p[2] * GX3 * lG;
89 const Numeric mean_y =
mean(
Y);
91 out << mean_y, mean_y < 0 ? -
EXP0 :
EXP0, -0.01*mean_y, mean_y < 0 ?
EXP0 : -
EXP0;
TimeStep mean(const ArrayOfTimeStep &dt)
Returns the mean time step.
InputType x0() const
start values helper function, operator()(...) must be not too bad
int df(const InputType &p, JacobianType &J) const
const Numeric T0
Reference temperature.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > InputType
const Numeric EXP0
Reference start exponent.
static constexpr int m_inputs
int operator()(const InputType &p, ValueType &f) const
const ConstVectorView & T
Temperature grid.
const ConstVectorView & Y
Spectroscopic values at grid.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > ValueType
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > JacobianType
const ConstVectorView & X
Temperature grid.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > InputType
int df(const InputType &p, JacobianType &J) const
int operator()(const InputType &p, ValueType &f) const
const ConstVectorView & Y
Spectroscopic values at grid.
InputType x0() const
start values helper function, operator()(...) must be not too bad
const Numeric EXP0
Reference start exponent.
const ConstVectorView & T
Temperature grid.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > InputType
static constexpr int m_inputs
const Numeric T0
Reference temperature.
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > ValueType
InputType x0() const
start values helper function, operator()(...) must be not too bad
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > JacobianType
const ConstVectorView & Y
Spectroscopic values at grid.
int operator()(const InputType &p, ValueType &f) const
int df(const InputType &p, JacobianType &J) const