本文整理汇总了C++中DataTable::setColumnNames方法的典型用法代码示例。如果您正苦于以下问题:C++ DataTable::setColumnNames方法的具体用法?C++ DataTable::setColumnNames怎么用?C++ DataTable::setColumnNames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataTable
的用法示例。
在下文中一共展示了DataTable::setColumnNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
ApplicationTools::displayError("Model " + TextTools::toString(nummodel) + " is not a Mixed Model.");
exit(-1);
}
const AbstractBiblioMixedSubstitutionModel* ptmp = dynamic_cast<const AbstractBiblioMixedSubstitutionModel*>(p0);
if (ptmp) {
p0 = ptmp->getMixedModel().clone();
if (nhOpt == "no")
model = p0;
else {
modelSet->replaceModel(nummodel-1, p0);
modelSet->isFullySetUpFor(*tree);
}
}
//////////////////////////////////////////////////
// Case of a MixtureOfSubstitutionModels
MixtureOfSubstitutionModels* pMSM = dynamic_cast<MixtureOfSubstitutionModels*>(p0);
if (pMSM)
{
vector<string> colNames;
colNames.push_back("Sites");
size_t nummod = pMSM->getNumberOfModels();
for (unsigned int i = 0; i < nummod; i++)
{
colNames.push_back(pMSM->getNModel(i)->getName());
}
DataTable* rates = new DataTable(nSites, colNames.size());
rates->setColumnNames(colNames);
for (unsigned int i = 0; i < nSites; i++)
{
const Site* currentSite = &sites->getSite(i);
int currentSitePosition = currentSite->getPosition();
(*rates)(i, "Sites") = string("[" + TextTools::toString(currentSitePosition) + "]");
}
Vdouble vprob = pMSM->getProbabilities();
for (unsigned int i = 0; i < nummod; i++)
{
string modname = pMSM->getNModel(i)->getName();
for (unsigned int j = 0; j < nummod; j++)
{
pMSM->setNProbability(j, (j == i) ? 1 : 0);
}
if (tl)
delete tl;
if (nhOpt == "no")
tl = new RHomogeneousMixedTreeLikelihood(*tree, *sites, model, rDist, true, false, true);
else
tl = new RNonHomogeneousMixedTreeLikelihood(*tree, *sites, modelSet, rDist, false, true);
tl->initialize();
logL = tl->getValue();
Vdouble Vd = tl->getLogLikelihoodForEachSite();
for (unsigned int j = 0; j < nSites; j++)
{
(*rates)(j, modname) = TextTools::toString(Vd[j]);