56 for (
int i=1; i<=10; i++)
69 const double p1 = 1 - p0;
93 double abundance = pow(p0, n);
96 for (
int k=0;
k<=n;
k++)
99 abundance *= p1/p0*(n-
k)/(
k+1);
110 for (
int k=0;
k<=n;
k++)
123 for (
unsigned int i=0; i<test.size(); i++)
133 const double p0 = .9;
134 const double p1 = .09;
135 const double p2 = 1 - (p0 + p1);
137 const double m0 = 10;
138 const double m1 = 11;
139 const double m2 = 12.33;
175 const double p0 = .9;
176 const double p1 = .09;
177 const double p2 = .009;
178 const double p3 = 1 - (p0 + p1 + p2);
180 const double m0 = 10;
181 const double m1 = 11;
182 const double m2 = 12.33;
183 const double m3 = 13.13;
191 cout <<
"test4 distribution:\n" << md << endl;
199 cout <<
"2 atoms:\n" << test4_2 << endl;
207 cout << table << endl;
210 cout <<
"distribution: " << dist10 << endl;
214 int main(
int argc,
char* argv[])
220 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
221 if (
os_) *
os_ <<
"IsotopeTableTest\n" << setprecision(12);
bool hasGreaterAbundance(const MassAbundance &a, const MassAbundance &b)
MassDistribution distribution(int atomCount) const
PWIZ_API_DECL const Record & record(Type type)
returns the amino acid's Record by type
#define unit_assert_equal(x, y, epsilon)
bool hasLessMass(const MassAbundance &a, const MassAbundance &b)
Class representing a table of isotope distributions for collections of multiple atoms of a single ele...
void compare(const MassDistribution &test, const MassDistribution &good)
int main(int argc, char *argv[])
#define TEST_PROLOG(argc, argv)
struct for holding isotope information
std::vector< MassAbundance > MassDistribution
struct for holding isotope distribution