本文整理汇总了C++中ITableWorkspace_sptr::getRow方法的典型用法代码示例。如果您正苦于以下问题:C++ ITableWorkspace_sptr::getRow方法的具体用法?C++ ITableWorkspace_sptr::getRow怎么用?C++ ITableWorkspace_sptr::getRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITableWorkspace_sptr
的用法示例。
在下文中一共展示了ITableWorkspace_sptr::getRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseProfileTableWorkspace
/** Parse profile table workspace to a map (the new ...
*/
void SaveGSASInstrumentFile::parseProfileTableWorkspace(
ITableWorkspace_sptr ws,
map<unsigned int, map<string, double>> &profilemap) {
size_t numbanks = ws->columnCount() - 1;
size_t numparams = ws->rowCount();
vector<map<string, double>> vec_maptemp(numbanks);
vector<unsigned int> vecbankindex(numbanks);
// Check
vector<string> colnames = ws->getColumnNames();
if (colnames[0].compare("Name"))
throw runtime_error("The first column must be Name");
// Parse
for (size_t irow = 0; irow < numparams; ++irow) {
TableRow tmprow = ws->getRow(irow);
string parname;
tmprow >> parname;
if (parname.compare("BANK")) {
for (size_t icol = 0; icol < numbanks; ++icol) {
double tmpdbl;
tmprow >> tmpdbl;
vec_maptemp[icol].insert(make_pair(parname, tmpdbl));
}
} else {
for (size_t icol = 0; icol < numbanks; ++icol) {
double tmpint;
tmprow >> tmpint;
vecbankindex[icol] = static_cast<unsigned int>(tmpint);
}
}
}
示例2: while
int PoldiFitPeaks1D2::getBestChebyshevPolynomialDegree(
const Workspace2D_sptr &dataWorkspace, const RefinedRange_sptr &range) {
double chiSquareMin = 1e10;
int nMin = -1;
try {
int n = 0;
while ((n < 3)) {
IAlgorithm_sptr fit = getFitAlgorithm(dataWorkspace, range, n);
bool fitSuccess = fit->execute();
if (fitSuccess) {
ITableWorkspace_sptr fitCharacteristics =
fit->getProperty("OutputParameters");
TableRow row =
fitCharacteristics->getRow(fitCharacteristics->rowCount() - 1);
double chiSquare = row.Double(1);
if (fabs(chiSquare - 1) < fabs(chiSquareMin - 1)) {
chiSquareMin = chiSquare;
nMin = n;
}
}
++n;
}
} catch (std::runtime_error) {
nMin = -1;
}
if (nMin == -1) {
g_log.information() << "Range [" << range->getXStart() << " - "
<< range->getXEnd() << "] is excluded.";
} else {
g_log.information() << "Chi^2 for range [" << range->getXStart() << " - "
<< range->getXEnd() << "] is minimal at n = " << nMin
<< " with Chi^2 = " << chiSquareMin << std::endl;
}
return nMin;
}