1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2024-09-19 21:25:36 +01:00

error check fix

This commit is contained in:
Antonin Portelli 2024-06-19 17:22:29 +09:00
parent c3cf22532e
commit f4dff86ce6

View File

@ -184,7 +184,7 @@ void XYStatData::setXError(const Index i, const DVec &err)
void XYStatData::setYError(const Index j, const DVec &err)
{
checkXDim(j);
checkYDim(j);
checkErrVec(err, yyVar_(j, j));
yyVar_(j, j).diagonal() = err.cwiseProduct(err);
scheduleFitVarMatInit();
@ -251,6 +251,62 @@ DMat XYStatData::getTable(const Index i, const Index j) const
return table;
}
DMat XYStatData::getTable(const Index i, const Index j, CoordFilter &coordFilter) const
{
checkXDim(i);
checkYDim(j);
DMat table(getYSize(j), 4);
Index row = 0;
for (auto &p: yData_[j])
{
Index k = p.first;
auto c = dataCoord(k);
if (coordFilter(c))
{
Index r = c[i];
table(row, 0) = x(k)(i);
table(row, 2) = p.second;
table(row, 1) = xxVar_(i, i).diagonal().cwiseSqrt()(r);
table(row, 3) = yyVar_(j, j).diagonal().cwiseSqrt()(row);
row++;
}
}
table.conservativeResize(row, 4);
return table;
}
DMat XYStatData::getTable(const Index i, const Index j, PointFilter &ptFilter) const
{
checkXDim(i);
checkYDim(j);
DMat table(getYSize(j), 4);
Index row = 0;
for (auto &p: yData_[j])
{
Index k = p.first;
auto c = dataCoord(k);
if (ptFilter(x(k)))
{
Index r = c[i];
table(row, 0) = x(k)(i);
table(row, 2) = p.second;
table(row, 1) = xxVar_(i, i).diagonal().cwiseSqrt()(r);
table(row, 3) = yyVar_(j, j).diagonal().cwiseSqrt()(row);
row++;
}
}
table.conservativeResize(row, 4);
return table;
}
// get total fit variance matrix ///////////////////////////////////////////////
const DMat & XYStatData::getFitVarMat(void)
{