本文整理汇总了C++中DataReader::columnExist方法的典型用法代码示例。如果您正苦于以下问题:C++ DataReader::columnExist方法的具体用法?C++ DataReader::columnExist怎么用?C++ DataReader::columnExist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataReader
的用法示例。
在下文中一共展示了DataReader::columnExist方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readData
void Engine::readData()
{
DataReader dr;
dr.readFile(m_programSettings->getEngineSettings().datafile);
if(!dr.good())
{
throw Engine::Exception("File " + m_programSettings->getEngineSettings().datafile +
" has not been read or has no a header");
}
if(dr.columnExist("[intensity]"))
{
dr.getColumn(m_exp_intens_vals, "[intensity]");
}
else
{
throw Engine::Exception("Column \"[intensity]\" has not been found in " +
m_programSettings->getEngineSettings().datafile);
}
if (dr.columnExist("[qx]"))
{
//get points without any transformation
dr.getColumn(m_qx_vals, "[qx]");
}
else
{
throw Engine::Exception("Column \"[qx]\" has not been found in "+
m_programSettings->getEngineSettings().datafile);
}
if (dr.columnExist("[qz]"))
{
//get points without any transformation
dr.getColumn(m_qz_vals, "[qz]");
}
else
{
throw Engine::Exception("Column \"[qz]\" has not been found in "+
m_programSettings->getEngineSettings().datafile);
}
/*allocate arguments and residuals*/
for(size_t i = 0; i < m_exp_intens_vals.size(); ++i)
{
m_DataPoints.push_back(
NonlinearFit::DataPoint(new ANACalculatorCoplanarTripleArgument(m_qx_vals[i], m_qz_vals[i]),
m_exp_intens_vals[i]));
}
m_ini_intens_vals.resize(m_exp_intens_vals.size(), 0.0);
m_fin_intens_vals.resize(m_exp_intens_vals.size(), 0.0);
std::cout << "Nb data residuals:\t" << m_DataPoints.size() << std::endl;
}