ProteoWizard
Public Member Functions | Static Public Member Functions | Private Attributes
pwiz::analysis::SavitzkyGolaySmoother< T > Struct Template Reference

#include <SavitzkyGolaySmoother.hpp>

Inheritance diagram for pwiz::analysis::SavitzkyGolaySmoother< T >:
pwiz::analysis::Smoother

List of all members.

Public Member Functions

 SavitzkyGolaySmoother (int polynomialOrder, int windowSize)
 ~SavitzkyGolaySmoother ()
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:
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:
- Public Member Functions inherited from pwiz::analysis::Smoother
virtual ~Smoother ()

Static Public Member Functions

static std::vector< T > smooth_copy (const std::vector< T > &data)

Private Attributes

boost::shared_ptr< Impl > impl_

Detailed Description

template<typename T>
struct pwiz::analysis::SavitzkyGolaySmoother< T >

Definition at line 37 of file SavitzkyGolaySmoother.hpp.


Constructor & Destructor Documentation

template<typename T >
pwiz::analysis::SavitzkyGolaySmoother< T >::SavitzkyGolaySmoother ( int  polynomialOrder,
int  windowSize 
)

Member Function Documentation

template<typename T >
static std::vector<T> pwiz::analysis::SavitzkyGolaySmoother< T >::smooth_copy ( const std::vector< T > &  data)
inlinestatic

Definition at line 40 of file SavitzkyGolaySmoother.hpp.

{
if (data.size() < 9)
return data;
typename std::vector<T>::const_iterator start;
typename std::vector<T> smoothedData(data.begin(), data.begin()+4);
for (start = data.begin();
(start+8) != data.end();
++start)
{
T sum = 59 * *(start+4) + 54 * (*(start+3) + *(start+5)) +
39 * (*(start+2) + *(start+6)) + 14 * (*(start+1) + *(start+7)) -
21 * (*start + *(start+8));
smoothedData.push_back(sum / 231);
}
smoothedData.insert(smoothedData.end(), data.end()-4, data.end());
return smoothedData;
}
template<typename T >
virtual void pwiz::analysis::SavitzkyGolaySmoother< T >::smooth ( const std::vector< double > &  x,
const std::vector< double > &  y,
std::vector< double > &  xSmoothed,
std::vector< double > &  ySmoothed 
)
virtual

smooth y values to existing vectors using Savitzky-Golay algorithm; preconditions:

  • samples within the window must be (approximately) equally spaced

Implements pwiz::analysis::Smoother.

template<typename T >
virtual void pwiz::analysis::SavitzkyGolaySmoother< T >::smooth_copy ( std::vector< double > &  x,
std::vector< double > &  y 
)
virtual

smooth y values and copy back to the input vectors using Savitzky-Golay algorithm; preconditions:

  • samples within the window must be (approximately) equally spaced

Implements pwiz::analysis::Smoother.


Member Data Documentation

template<typename T >
boost::shared_ptr<Impl> pwiz::analysis::SavitzkyGolaySmoother< T >::impl_
private

Definition at line 53 of file SavitzkyGolaySmoother.hpp.


The documentation for this struct was generated from the following files: