OpenMS
BSpline2d.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: Stephan Aiche, Timo Sachsenberg $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <vector>
12 
13 #include <OpenMS/config.h>
14 #include <OpenMS/CONCEPT/Types.h>
16 #include <OpenMS/CONCEPT/Macros.h>
17 
18 // forward declaration of impl class BSpline
19 namespace eol_bspline
20 {
21 template <class T>
22 class BSpline;
23 }
24 
25 namespace OpenMS
26 {
30  class OPENMS_DLLAPI BSpline2d
31  {
32 public:
33 
34  // Note: Don't change boundary condition constants as these are passed through to the eol-bspline implementation.
36  {
38  BC_ZERO_ENDPOINTS = 0,
40  BC_ZERO_FIRST = 1,
42  BC_ZERO_SECOND = 2
43  };
44 
68  BSpline2d(const std::vector<double>& x, const std::vector<double>& y,
69  double wavelength = 0, BoundaryCondition boundary_condition = BC_ZERO_SECOND,
70  Size num_nodes = 0);
71 
75  virtual ~BSpline2d();
76 
84  bool solve(const std::vector<double>& y);
85 
90  double eval(const double x) const;
91 
96  double derivative(const double x) const;
97 
101  bool ok() const;
102 
106  static void debug(bool enable);
107 
108 private:
109 
110  // Pointer to actual implementation. Note: This class follows the PIMPL idiom hiding the actual
111  // B-spline implementation behind this pointer to avoid any dependency of the interface to the
112  // implementation. Thus, the eol splines are only required during compilation of OpenMS and
113  // not when linking against OpenMS.
115  };
116 
117 }
118 
b spline interpolation
Definition: BSpline2d.h:31
bool ok() const
double eval(const double x) const
double derivative(const double x) const
eol_bspline::BSpline< double > * spline_
Definition: BSpline2d.h:114
bool solve(const std::vector< double > &y)
virtual ~BSpline2d()
BSpline2d(const std::vector< double > &x, const std::vector< double > &y, double wavelength=0, BoundaryCondition boundary_condition=BC_ZERO_SECOND, Size num_nodes=0)
static void debug(bool enable)
BoundaryCondition
Definition: BSpline2d.h:36
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Definition: BSpline2d.h:20
Definition: BSpline2d.h:22