本文整理汇总了C++中Alphabet::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ Alphabet::getName方法的具体用法?C++ Alphabet::getName怎么用?C++ Alphabet::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alphabet
的用法示例。
在下文中一共展示了Alphabet::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printHeader
void printHeader(const Alphabet& alphabet, const Weights& weights, Options::Mode mode) {
cout <<
"# " PROGRAM_NAME " " PROGRAM_VERSION "\n"
"# Copyright 2006 Informatics for Mass Spectrometry group\n"
"# at Bielefeld University\n"
"#\n"
"# http://BiBiServ.TechFak.Uni-Bielefeld.DE/decomp/\n"
"#\n"
"# alphabet (character, weight):\n";
for (Weights::size_type i = 0; i < weights.size(); ++i) {
cout
<< "#\t" << alphabet.getName(i) << "\t"
<< weights[i] << '\n';
}
cout << "#\n# Problem to solve: ";
switch (mode) {
case Options::GETNUMBER:
cout << "Get number of decompositions";
break;
case Options::FINDALL:
cout << "Find all decompositions";
break;
case Options::FINDONE:
cout << "Find one decomposition";
break;
case Options::ISDECOMPOSABLE:
cout << "Is decomposable";
break;
}
cout << "\n#\n";
}
示例2: printDecomposition
/** Prints one decomposition to stdout */
void printDecomposition(const Alphabet& alphabet, const decomposition_t& decomposition)
{
assert(alphabet.size() == decomposition.size());
bool first = true;
for (Alphabet::size_type i = 0; i < alphabet.size(); ++i) {
if (decomposition[i] > 0) {
if (!first) {
cout << " ";
} else {
first = false;
}
cout << alphabet.getName(i) << decomposition[i];
}
}
}