ProteoWizard
Public Types | Public Member Functions | Public Attributes | List of all members
pwiz::math::MatchedFilter::SampledData< space_type > Struct Template Reference

#include <MatchedFilter.hpp>

Public Types

typedef space_type::abscissa_type abscissa_type
 
typedef space_type::ordinate_type ordinate_type
 
typedef std::pair< abscissa_type, abscissa_typedomain_type
 
typedef std::vector< ordinate_typesamples_type
 

Public Member Functions

abscissa_type domainWidth () const
 
abscissa_type dx () const
 
abscissa_type x (typename samples_type::size_type index) const
 
samples_type::size_type sampleIndex (const abscissa_type &x) const
 
const ordinate_typesample (abscissa_type x) const
 

Public Attributes

domain_type domain
 
samples_type samples
 

Detailed Description

template<typename space_type>
struct pwiz::math::MatchedFilter::SampledData< space_type >

Definition at line 55 of file MatchedFilter.hpp.

Member Typedef Documentation

§ abscissa_type

template<typename space_type>
typedef space_type::abscissa_type pwiz::math::MatchedFilter::SampledData< space_type >::abscissa_type

Definition at line 57 of file MatchedFilter.hpp.

§ ordinate_type

template<typename space_type>
typedef space_type::ordinate_type pwiz::math::MatchedFilter::SampledData< space_type >::ordinate_type

Definition at line 58 of file MatchedFilter.hpp.

§ domain_type

template<typename space_type>
typedef std::pair<abscissa_type,abscissa_type> pwiz::math::MatchedFilter::SampledData< space_type >::domain_type

Definition at line 59 of file MatchedFilter.hpp.

§ samples_type

template<typename space_type>
typedef std::vector<ordinate_type> pwiz::math::MatchedFilter::SampledData< space_type >::samples_type

Definition at line 60 of file MatchedFilter.hpp.

Member Function Documentation

§ domainWidth()

template<typename space_type>
abscissa_type pwiz::math::MatchedFilter::SampledData< space_type >::domainWidth ( ) const
inline

Definition at line 65 of file MatchedFilter.hpp.

66  {
67  return domain.second - domain.first;
68  }

§ dx()

template<typename space_type>
abscissa_type pwiz::math::MatchedFilter::SampledData< space_type >::dx ( ) const
inline

Definition at line 70 of file MatchedFilter.hpp.

Referenced by pwiz::math::MatchedFilter::computeCorrelationData().

71  {
72  return samples.empty() ? 0 : domainWidth()/(samples.size()-1);
73  }

§ x()

template<typename space_type>
abscissa_type pwiz::math::MatchedFilter::SampledData< space_type >::x ( typename samples_type::size_type  index) const
inline

Definition at line 75 of file MatchedFilter.hpp.

76  {
77  return domain.first + domainWidth() * index / (samples.size()-1);
78  }

§ sampleIndex()

template<typename space_type>
samples_type::size_type pwiz::math::MatchedFilter::SampledData< space_type >::sampleIndex ( const abscissa_type x) const
inline

Definition at line 80 of file MatchedFilter.hpp.

81  {
82  typename samples_type::size_type sampleCount = samples.size();
83  int result = (int)round((sampleCount-1)*(x-domain.first)/domainWidth());
84  if (result < 0) result = 0;
85  if (result > (int)(sampleCount-1)) result = sampleCount-1;
86  return (typename samples_type::size_type)(result);
87  }
abscissa_type x(typename samples_type::size_type index) const

§ sample()

template<typename space_type>
const ordinate_type& pwiz::math::MatchedFilter::SampledData< space_type >::sample ( abscissa_type  x) const
inline

Definition at line 89 of file MatchedFilter.hpp.

90  {
91  return samples[sampleIndex(x)];
92  }
samples_type::size_type sampleIndex(const abscissa_type &x) const
abscissa_type x(typename samples_type::size_type index) const

Member Data Documentation

§ domain

template<typename space_type>
domain_type pwiz::math::MatchedFilter::SampledData< space_type >::domain

Definition at line 62 of file MatchedFilter.hpp.

Referenced by pwiz::math::MatchedFilter::computeCorrelationData().

§ samples

template<typename space_type>
samples_type pwiz::math::MatchedFilter::SampledData< space_type >::samples

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