27 #ifndef math_fit_array2FitGaussian1D_hpp
28 #define math_fit_array2FitGaussian1D_hpp
30 #include "../../mxError.hpp"
44 template<
typename realT>
75 realT G0( realT * p );
87 realT x0( realT * p );
93 realT sigma( realT * p );
95 void sigma( realT * p,
103 template<
typename realT>
112 if(G0) m_G0_idx = -1;
113 else m_G0_idx = idx++;
116 else m_G_idx = idx++;
118 if(x0) m_x0_idx = -1;
119 else m_x0_idx = idx++;
121 if(
sigma) m_sigma_idx = -1;
122 else m_sigma_idx = idx++;
127 template<
typename realT>
140 template<
typename realT>
141 void array2FitGaussian1D<realT>::G0( realT * p,
155 template<
typename realT>
156 realT array2FitGaussian1D<realT>::G( realT * p )
168 template<
typename realT>
169 void array2FitGaussian1D<realT>::G( realT * p,
183 template<
typename realT>
184 realT array2FitGaussian1D<realT>::x0( realT * p )
196 template<
typename realT>
197 void array2FitGaussian1D<realT>::x0( realT * p,
211 template<
typename realT>
212 realT array2FitGaussian1D<realT>::sigma( realT * p )
214 if( m_sigma_idx < 0 )
220 return p[m_sigma_idx];
224 template<
typename realT>
225 void array2FitGaussian1D<realT>::sigma( realT * p,
229 if( m_sigma_idx < 0 )
235 p[m_sigma_idx] = nsigma;
239 template<
typename realT>
240 int array2FitGaussian1D<realT>::nparams()
constexpr units::realT G()
Newton's Gravitational Constant.
constexpr units::realT sigma()
Stefan-Boltzmann Constant.
Wrapper for a native array to pass to levmarInterface, with !D Gaussian details.
size_t m_nx
X dimension of the array.
realT * m_mask
Pointer to the (optional) mask array. Any 0 pixels are excluded from the fit.
realT * m_coords
Pointer to the array of x values (optional)
realT * m_data
///< Pointer to the array of y values
void setFixed(bool G0, bool G, bool x0, bool sigma)
Set whether each parameter is fixed.