41 if (
os_) *
os_ <<
"testPredicate()\n";
47 LessThan_MZRT<Peakel> lt;
69 LessThan_MZRT<Feature> lt;
104 Simple(
double _mz = 0,
double _rtMin = 0,
double _rtMax = 0)
135 simpleField.insert(a);
136 simpleField.insert(b);
137 simpleField.insert(c);
138 simpleField.insert(d);
141 unit_assert(result.size()==2 && result[0]==c && result[1]==d);
144 unit_assert(result.size()==2 && result[0]==b && result[1]==d);
156 if (
os_) *
os_ <<
"testPeakelField()\n";
168 if (
os_) *
os_ << pf << endl;
172 PeakelField::const_iterator it = pf.begin();
177 (*it)->peaks.push_back(
Peak());
178 (*it)->peaks.clear();
188 if (
os_) *
os_ <<
"testPeakelField(): find()\n";
194 *
os_ <<
"find(): " << v.size() << endl;
195 for (vector<PeakelPtr>::const_iterator it=v.begin(); it!=v.end(); ++it)
196 *
os_ << **it << endl;
213 if (
os_) *
os_ <<
"testPeakelField(): remove()\n";
226 catch (exception& e) {
227 if (
os_) *
os_ <<
"Caught exception correctly: " << e.what() << endl;
248 cout <<
"MyPred: " << mz << endl;
255 if (
os_) *
os_ <<
"testFeatureField()\n";
260 a->mz=1; a->retentionTime=1;
263 b->mz=2; b->retentionTime=1;
266 c->mz=1; c->retentionTime=2;
272 if (
os_) *
os_ << ff << endl;
293int main(
int argc,
char* argv[])
299 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
void testPredicate_Feature()
int main(int argc, char *argv[])
shared_ptr< Simple > SimplePtr
void testConceptChecking()
boost::shared_ptr< Feature > FeaturePtr
boost::shared_ptr< Peakel > PeakelPtr
double retentionTimeMax() const
double retentionTimeMin() const
void operator()(double mz)
double retentionTimeMin() const
Simple(double _mz=0, double _rtMin=0, double _rtMax=0)
double retentionTimeMax() const
MZRTField is a std::set of boost::shared_ptrs, stored as a binary tree ordered by LessThan_MZRT.
std::vector< TPtr > find(double mz, MZTolerance mzTolerance, RTMatches matches) const
find all objects with a given m/z, within a given m/z tolerance, satisfying the 'matches' predicate
void remove(const TPtr &p)
remove an object via a shared reference, rather than an iterator into the set
represents some generic metadata about a peak detected in a signal
predicate always returns true
predicate returns true iff the object's retention time range contains the specified retention time
predicate returns true iff the object's retention time range is completely contained within the range...
struct for expressing m/z tolerance in either amu or ppm
struct for an eluted peak (PEAK ELution)
#define TEST_PROLOG(argc, argv)