本文整理汇总了C++中OutputStream::setPrecision方法的典型用法代码示例。如果您正苦于以下问题:C++ OutputStream::setPrecision方法的具体用法?C++ OutputStream::setPrecision怎么用?C++ OutputStream::setPrecision使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputStream
的用法示例。
在下文中一共展示了OutputStream::setPrecision方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
NeighborJoining* nj = new NeighborJoining();
nj->outputPositiveLengths(true);
distMethod = nj;
}
else if(method == "bionj")
{
BioNJ* bionj = new BioNJ();
bionj->outputPositiveLengths(true);
distMethod = bionj;
}
else throw Exception("Unknown tree reconstruction method.");
string type = ApplicationTools::getStringParameter("optimization.method", bppdist.getParams(), "init");
ApplicationTools::displayResult("Model parameters estimation method", type);
if (type == "init") type = OptimizationTools::DISTANCEMETHOD_INIT;
else if (type == "pairwise") type = OptimizationTools::DISTANCEMETHOD_PAIRWISE;
else if (type == "iterations") type = OptimizationTools::DISTANCEMETHOD_ITERATIONS;
else throw Exception("Unknown parameter estimation procedure '" + type + "'.");
unsigned int optVerbose = ApplicationTools::getParameter<unsigned int>("optimization.verbose", bppdist.getParams(), 2);
string mhPath = ApplicationTools::getAFilePath("optimization.message_handler", bppdist.getParams(), false, false);
OutputStream* messenger =
(mhPath == "none") ? 0 :
(mhPath == "std") ? ApplicationTools::message :
new StlOutputStream(new ofstream(mhPath.c_str(), ios::out));
ApplicationTools::displayResult("Message handler", mhPath);
string prPath = ApplicationTools::getAFilePath("optimization.profiler", bppdist.getParams(), false, false);
OutputStream* profiler =
(prPath == "none") ? 0 :
(prPath == "std") ? ApplicationTools::message :
new StlOutputStream(new ofstream(prPath.c_str(), ios::out));
if(profiler) profiler->setPrecision(20);
ApplicationTools::displayResult("Profiler", prPath);
// Should I ignore some parameters?
ParameterList allParameters = model->getParameters();
allParameters.addParameters(rDist->getParameters());
ParameterList parametersToIgnore;
string paramListDesc = ApplicationTools::getStringParameter("optimization.ignore_parameter", bppdist.getParams(), "", "", true, false);
bool ignoreBrLen = false;
StringTokenizer st(paramListDesc, ",");
while (st.hasMoreToken())
{
try
{
string param = st.nextToken();
if (param == "BrLen")
ignoreBrLen = true;
else
{
if (allParameters.hasParameter(param))
{
Parameter* p = &allParameters.getParameter(param);
parametersToIgnore.addParameter(*p);
}
else ApplicationTools::displayWarning("Parameter '" + param + "' not found.");
}
}
catch (ParameterNotFoundException& pnfe)
{
ApplicationTools::displayError("Parameter '" + pnfe.getParameter() + "' not found, and so can't be ignored!");
}
}