ProteoWizard
SavitzkyGolaySmoother.hpp
Go to the documentation of this file.
1 //
2 // $Id$
3 //
4 //
5 // Original author: Matt Chambers <matt.chambers <a.t> vanderbilt.edu>
6 //
7 // Copyright 2008 Vanderbilt University - Nashville, TN 37232
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // Unless required by applicable law or agreed to in writing, software
16 // distributed under the License is distributed on an "AS IS" BASIS,
17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 // See the License for the specific language governing permissions and
19 // limitations under the License.
20 //
21 
22 
23 #ifndef _SAVITZKYGOLAYSMOOTHER_HPP_
24 #define _SAVITZKYGOLAYSMOOTHER_HPP_
25 
26 
27 #include "Smoother.hpp"
28 #include <vector>
29 #include <boost/shared_ptr.hpp>
30 
31 
32 namespace pwiz {
33 namespace analysis {
34 
35 
36 struct PWIZ_API_DECL SavitzkyGolaySmoother : public Smoother
37 {
38  SavitzkyGolaySmoother(int polynomialOrder, int windowSize);
40 
41  /// smooth y values to existing vectors using Savitzky-Golay algorithm;
42  /// preconditions:
43  /// - samples within the window must be (approximately) equally spaced
44  virtual void smooth(const std::vector<double>& x, const std::vector<double>& y,
45  std::vector<double>& xSmoothed, std::vector<double>& ySmoothed);
46 
47  /// smooth y values and copy back to the input vectors using Savitzky-Golay algorithm;
48  /// preconditions:
49  /// - samples within the window must be (approximately) equally spaced
50  virtual void smooth_copy(std::vector<double>& x, std::vector<double>& y);
51 
52  private:
53  struct Impl;
54  boost::shared_ptr<Impl> impl_;
55 };
56 
57 
58 } // namespace analysis
59 } // namespace pwiz
60 
61 #endif // _SAVITZKYGOLAYSMOOTHER_HPP_
pwiz::analysis::SavitzkyGolaySmoother::smooth_copy
virtual void smooth_copy(std::vector< double > &x, std::vector< double > &y)
smooth y values and copy back to the input vectors using Savitzky-Golay algorithm; preconditions:
pwiz::analysis::SavitzkyGolaySmoother::smooth
virtual void smooth(const std::vector< double > &x, const std::vector< double > &y, std::vector< double > &xSmoothed, std::vector< double > &ySmoothed)
smooth y values to existing vectors using Savitzky-Golay algorithm; preconditions:
pwiz
Definition: ChromatogramList_Filter.hpp:36
pwiz::analysis::SavitzkyGolaySmoother::impl_
boost::shared_ptr< Impl > impl_
Definition: SavitzkyGolaySmoother.hpp:53
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition: Export.hpp:32
y
KernelTraitsBase< Kernel >::space_type::ordinate_type y
Definition: MatchedFilter.hpp:143
pwiz::analysis::SavitzkyGolaySmoother::~SavitzkyGolaySmoother
~SavitzkyGolaySmoother()
Smoother.hpp
x
KernelTraitsBase< Kernel >::space_type::abscissa_type x
Definition: MatchedFilter.hpp:142
pwiz::analysis::SavitzkyGolaySmoother::SavitzkyGolaySmoother
SavitzkyGolaySmoother(int polynomialOrder, int windowSize)