41 const double noiseFactor = 666;
42 const unsigned int detectionRadius = 13;
43 auto_ptr<PeakDetectorNaive> pd = PeakDetectorNaive::create(noiseFactor, detectionRadius);
74 if (
os_) copy(fd.
data().begin(), fd.
data().end(), ostream_iterator<FrequencyDatum>(*
os_,
"\n"));
80 const double noiseFactor = 1;
82 auto_ptr<PeakDetectorNaive> pdn1 = PeakDetectorNaive::create(noiseFactor, 1);
86 auto_ptr<PeakDetectorNaive> pdn2 = PeakDetectorNaive::create(noiseFactor, 2);
87 pdn2->findPeaks(fd, pd.
scans[1]);
90 auto_ptr<PeakDetectorNaive> pdn3 = PeakDetectorNaive::create(noiseFactor, 3);
91 pdn3->findPeaks(fd, pd.
scans[2]);
96 *os_ <<
"pd:\n" << pd << endl;
98 for (
unsigned int i=0; i<pd.
scans.size(); i++)
100 *os_ <<
"scan " << i <<
":\n";
101 *os_ << pd.
scans[i] << endl;
114 int main(
int argc,
char* argv[])
120 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
121 if (
os_) *
os_ <<
"PeakDetectorNaiveTest\n";
Class for binary storage of complex frequency data.
virtual unsigned int detectionRadius() const =0
const unsigned int dataSize_
void analyze()
recache statistics calculations after any direct data changes via non-const data() ...
virtual void findPeaks(const pwiz::data::FrequencyData &fd, pwiz::data::peakdata::Scan &result) const =0
Find the peaks in the frequency data, filling in Scan structure.
const container & data() const
const access to underlying data
virtual double noiseFactor() const =0
std::vector< Scan > scans
int main(int argc, char *argv[])
SampleDatum< double, std::complex< double > > FrequencyDatum
#define TEST_PROLOG(argc, argv)