41 if (
os_) *
os_ <<
"testPredicate()\n";
47 LessThan_MZRT<Peakel> lt;
69 LessThan_MZRT<Feature> lt;
84 double retentionTimeMin()
const;
85 double retentionTimeMax()
const;
104 Simple(
double _mz = 0,
double _rtMin = 0,
double _rtMax = 0)
106 retentionTime((_rtMin+_rtMax)/2),
107 rtMin(_rtMin), rtMax(_rtMax)
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;
293 int main(
int argc,
char* argv[])
299 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
double retentionTimeMax() const
predicate always returns true
MZRTField is a std::set of boost::shared_ptrs, stored as a binary tree ordered by LessThan_MZRT...
predicate returns true iff the object's retention time range contains the specified retention time ...
void testConceptChecking()
shared_ptr< Simple > SimplePtr
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 ...
boost::shared_ptr< Peakel > PeakelPtr
void remove(const TPtr &p)
remove an object via a shared reference, rather than an iterator into the set
double retentionTimeMin() const
boost::shared_ptr< Feature > FeaturePtr
represents some generic metadata about a peak detected in a signal
void operator()(double mz)
void testPredicate_Feature()
double mz(double neutralMass, int protonDelta, int electronDelta=0, int neutronDelta=0)
int main(int argc, char *argv[])
struct for an eluted peak (PEAK ELution)
struct for expressing m/z tolerance in either amu or ppm
#define TEST_PROLOG(argc, argv)
Simple(double _mz=0, double _rtMin=0, double _rtMax=0)
predicate returns true iff the object's retention time range is completely contained within the range...