OpenMS
BSpline2d.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- 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>
15 #include <OpenMS/CONCEPT/Types.h>
17 #include <OpenMS/CONCEPT/Macros.h>
18 
19 // forward declaration of impl class BSpline
20 namespace eol_bspline
21 {
22 template <class T>
23 class BSpline;
24 }
25 
26 namespace OpenMS
27 {
31  class OPENMS_DLLAPI BSpline2d
32  {
33 public:
34 
35  // Note: Don't change boundary condition constants as these are passed through to the eol-bspline implementation.
37  {
39  BC_ZERO_ENDPOINTS = 0,
41  BC_ZERO_FIRST = 1,
43  BC_ZERO_SECOND = 2
44  };
45 
69  BSpline2d(const std::vector<double>& x, const std::vector<double>& y,
70  double wavelength = 0, BoundaryCondition boundary_condition = BC_ZERO_SECOND,
71  Size num_nodes = 0);
72 
76  virtual ~BSpline2d();
77 
85  bool solve(const std::vector<double>& y);
86 
91  double eval(const double x) const;
92 
97  double derivative(const double x) const;
98 
102  bool ok() const;
103 
107  static void debug(bool enable);
108 
109 private:
110 
111  // Pointer to actual implementation. Note: This class follows the PIMPL idiom hiding the actual
112  // B-spline implementation behind this pointer to avoid any dependency of the interface to the
113  // implementation. Thus, the eol splines are only required during compilation of OpenMS and
114  // not when linking against OpenMS.
116  };
117 
118 }
119 
b spline interpolation
Definition: BSpline2d.h:32
bool ok() const
double eval(const double x) const
double derivative(const double x) const
eol_bspline::BSpline< double > * spline_
Definition: BSpline2d.h:115
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:37
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
Definition: BSpline2d.h:21
Definition: BSpline2d.h:23