@@ -116,8 +116,53 @@ namespace OpenMS
116116 const double right_pos = 0.0
117117 ) const ;
118118
119+ /* *
120+ @brief The implementation of the gradient descent algorithm for the EMG peak model
121+
122+ @param[in] xs Positions
123+ @param[in] ys Intensities
124+ @param[out] best_h `h` (amplitude) parameter
125+ @param[out] best_mu `mu` (mean) parameter
126+ @param[out] best_sigma `sigma` (standard deviation) parameter
127+ @param[out] best_tau `tau` (exponent relaxation time) parameter
128+
129+ @return The number of iterations necessary to reach the best values for the parameters
130+ */
131+ UInt estimateEmgParameters (
132+ const std::vector<double >& xs,
133+ const std::vector<double >& ys,
134+ double & best_h,
135+ double & best_mu,
136+ double & best_sigma,
137+ double & best_tau
138+ ) const ;
139+
140+ /* *
141+ @brief Compute the EMG function on a set of points
142+
143+ If class parameter `compute_additional_points` is `"true"`, the algorithm
144+ will detect which side of the peak is cutoff and add points to it.
145+
146+ @param[in] xs Positions
147+ @param[in] h Amplitude
148+ @param[in] mu Mean
149+ @param[in] sigma Standard deviation
150+ @param[in] tau Exponent relaxation time
151+ @param[out] out_xs The output positions
152+ @param[out] out_ys The output intensities
153+ */
154+ void applyEstimatedParameters (
155+ const std::vector<double >& xs,
156+ const double h,
157+ const double mu,
158+ const double sigma,
159+ const double tau,
160+ std::vector<double >& out_xs,
161+ std::vector<double >& out_ys
162+ ) const ;
163+
119164protected:
120- void updateMembers_ ();
165+ void updateMembers_ () override ;
121166
122167 /* *
123168 @brief Given a peak, extract a training set to be used with the gradient descent algorithm
@@ -181,27 +226,6 @@ namespace OpenMS
181226 ) const ;
182227
183228private:
184- /* *
185- @brief The implementation of the gradient descent algorithm for the EMG peak model
186-
187- @param[in] xs Positions
188- @param[in] ys Intensities
189- @param[out] best_h `h` (amplitude) parameter
190- @param[out] best_mu `mu` (mean) parameter
191- @param[out] best_sigma `sigma` (standard deviation) parameter
192- @param[out] best_tau `tau` (exponent relaxation time) parameter
193-
194- @return The number of iterations necessary to reach the best values for the parameters
195- */
196- UInt emg_gradient_descent (
197- const std::vector<double >& xs,
198- const std::vector<double >& ys,
199- double & best_h,
200- double & best_mu,
201- double & best_sigma,
202- double & best_tau
203- ) const ;
204-
205229 /* *
206230 @brief Apply the iRprop+ algorithm for gradient descent
207231
@@ -376,30 +400,6 @@ namespace OpenMS
376400 const double tau
377401 ) const ;
378402
379- /* *
380- @brief Compute the EMG function on a set of points
381-
382- If class parameter `compute_additional_points` is `"true"`, the algorithm
383- will detect which side of the peak is cutoff and add points to it.
384-
385- @param[in] xs Positions
386- @param[in] h Amplitude
387- @param[in] mu Mean
388- @param[in] sigma Standard deviation
389- @param[in] tau Exponent relaxation time
390- @param[out] out_xs The output positions
391- @param[out] out_ys The output intensities
392- */
393- void emg_vector (
394- const std::vector<double >& xs,
395- const double h,
396- const double mu,
397- const double sigma,
398- const double tau,
399- std::vector<double >& out_xs,
400- std::vector<double >& out_ys
401- ) const ;
402-
403403 /* *
404404 @brief Compute the EMG function on a single point
405405
@@ -506,7 +506,7 @@ namespace OpenMS
506506 return emg_gd_.compute_z (x, mu, sigma, tau);
507507 }
508508
509- void emg_vector (
509+ void applyEstimatedParameters (
510510 const std::vector<double >& xs,
511511 const double h,
512512 const double mu,
@@ -516,7 +516,7 @@ namespace OpenMS
516516 std::vector<double >& out_ys
517517 ) const
518518 {
519- emg_gd_.emg_vector (xs, h, mu, sigma, tau, out_xs, out_ys);
519+ emg_gd_.applyEstimatedParameters (xs, h, mu, sigma, tau, out_xs, out_ys);
520520 }
521521
522522 double emg_point (
0 commit comments