11 #include <OpenMS/config.h>
29 double const left_neighbor_mz,
30 double const right_neighbor_mz,
32 double & max_peak_int,
33 double const threshold = 1e-6)
37 double lefthand = left_neighbor_mz;
38 double righthand = right_neighbor_mz;
40 bool lefthand_sign =
true;
41 double eps = std::numeric_limits<double>::epsilon();
46 double mid = (lefthand + righthand) / 2.0;
47 double midpoint_deriv_val = peak_spline.derivative(mid);
50 if (!(std::fabs(midpoint_deriv_val) > eps))
55 bool midpoint_sign = (midpoint_deriv_val < 0.0) ?
false :
true;
57 if (lefthand_sign ^ midpoint_sign)
66 while (righthand - lefthand > threshold);
68 max_peak_mz = (lefthand + righthand) / 2;
69 max_peak_int = peak_spline.eval(max_peak_mz);
void spline_bisection(const T &peak_spline, double const left_neighbor_mz, double const right_neighbor_mz, double &max_peak_mz, double &max_peak_int, double const threshold=1e-6)
Definition: SplineBisection.h:28
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19