ProteoWizard
Namespaces | Classes | Typedefs | Functions
pwiz::math::MatchedFilter Namespace Reference

Namespaces

namespace  details

Classes

struct  ProductSpace
struct  SampledData
struct  KernelTraitsBase
struct  KernelTraitsBase< Y(*)(X)>
struct  Correlation
struct  KernelTraits

Typedefs

typedef ProductSpace< double,
double > 
DxD
typedef ProductSpace< double,
std::complex< double > > 
DxCD

Functions

template<typename space_type >
std::ostream & operator<< (std::ostream &os, const SampledData< space_type > &data)
template<typename Kernel >
void checkKernelConcept ()
template<typename Y >
std::ostream & operator<< (std::ostream &os, const Correlation< Y > &c)
template<typename Kernel >
KernelTraits< Kernel >
::correlation_data_type 
computeCorrelationData (const typename KernelTraits< Kernel >::sampled_data_type &data, const Kernel &kernel, int sampleRadius, int subsampleFactor)

Typedef Documentation

typedef ProductSpace< double, double > pwiz::math::MatchedFilter::DxD

Definition at line 50 of file MatchedFilter.hpp.

typedef ProductSpace< double, std::complex<double> > pwiz::math::MatchedFilter::DxCD

Definition at line 51 of file MatchedFilter.hpp.


Function Documentation

template<typename space_type >
std::ostream& pwiz::math::MatchedFilter::operator<< ( std::ostream &  os,
const SampledData< space_type > &  data 
)

Definition at line 97 of file MatchedFilter.hpp.

References pwiz::math::MatchedFilter::SampledData< space_type >::samples.

{
os << "[" << data.domain.first << "," << data.domain.second << "] "
<< "(" << data.samples.size() << " samples)\n";
typename SampledData<space_type>::samples_type::const_iterator it=data.samples.begin();
for (unsigned int index=0; index!=data.samples.size(); ++index, ++it)
os << data.x(index) << "\t" << *it << std::endl;
return os;
}
template<typename Kernel >
void pwiz::math::MatchedFilter::checkKernelConcept ( )

Definition at line 150 of file MatchedFilter.hpp.

{
// force compile of KernelConcept::check()
void (KernelConcept<Kernel>::*dummy)() = &KernelConcept<Kernel>::check;
(void)dummy;
}
template<typename Y >
std::ostream& pwiz::math::MatchedFilter::operator<< ( std::ostream &  os,
const Correlation< Y > &  c 
)

Definition at line 174 of file MatchedFilter.hpp.

{
os << "<" << c.dot << ", " << c.e2 << ", " << c.angle() << ">";
return os;
}
template<typename Kernel >
KernelTraits<Kernel>::correlation_data_type pwiz::math::MatchedFilter::computeCorrelationData ( const typename KernelTraits< Kernel >::sampled_data_type &  data,
const Kernel &  kernel,
int  sampleRadius,
int  subsampleFactor 
)

Definition at line 287 of file MatchedFilter.hpp.

References pwiz::math::MatchedFilter::details::createFilters(), pwiz::math::MatchedFilter::SampledData< space_type >::domain, pwiz::math::MatchedFilter::SampledData< space_type >::dx(), and pwiz::math::MatchedFilter::SampledData< space_type >::samples.

Referenced by test_compute().

{
checkKernelConcept<Kernel>();
typedef typename KernelTraits<Kernel>::correlation_data_type result_type;
result_type result;
result.domain = data.domain;
if (data.samples.empty()) return result;
result.samples.resize((data.samples.size()-1) * subsampleFactor + 1);
typedef typename KernelTraits<Kernel>::filter_type filter_type;
std::vector<filter_type> filters = details::createFilters(kernel,
sampleRadius,
subsampleFactor,
data.dx());
typedef typename KernelTraits<Kernel>::samples_type samples_type;
unsigned int sampleIndex = sampleRadius;
for (typename samples_type::const_iterator itData = data.samples.begin() + sampleRadius;
itData + sampleRadius != data.samples.end(); ++itData, ++sampleIndex)
for (unsigned int filterIndex=0; filterIndex<filters.size(); ++filterIndex)
{
unsigned int index = sampleIndex * filters.size() + filterIndex;
if (index >= result.samples.size()) // only when sampleRadius==0, filterIndex>0
break;
details::computeCorrelation<Kernel>(itData-sampleRadius, itData+sampleRadius+1,
filters[filterIndex].begin(),
result.samples[index]);
}
return result;
}