37 #include <OpenMS/config.h>
55 double const left_neighbor_mz,
56 double const right_neighbor_mz,
58 double & max_peak_int,
59 double const threshold = 1e-6)
63 double lefthand = left_neighbor_mz;
64 double righthand = right_neighbor_mz;
66 bool lefthand_sign =
true;
67 double eps = std::numeric_limits<double>::epsilon();
72 double mid = (lefthand + righthand) / 2.0;
73 double midpoint_deriv_val = peak_spline.derivative(mid);
76 if (!(std::fabs(midpoint_deriv_val) > eps))
81 bool midpoint_sign = (midpoint_deriv_val < 0.0) ?
false :
true;
83 if (lefthand_sign ^ midpoint_sign)
92 while (righthand - lefthand > threshold);
94 max_peak_mz = (lefthand + righthand) / 2;
95 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:54
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47