1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2024-11-12 17:35:35 +00:00

Merge branch 'develop' into feature/fit-phys

This commit is contained in:
Antonin Portelli 2017-01-11 11:28:31 +00:00
commit de509714b4
3 changed files with 25 additions and 11 deletions

7
.gitignore vendored
View File

@ -3,7 +3,7 @@ build/*
build_debug/* build_debug/*
sandbox/* sandbox/*
# Apple stuffs # Apple stuff
*.xcodeproj *.xcodeproj
.DS_Store .DS_Store
@ -30,3 +30,8 @@ lib/eigen_files.mk
# CI builds # CI builds
ci-scripts/local/* ci-scripts/local/*
# CLion stuff
.idea/*
CMakeLists.txt
cmake-build-debug/*

View File

@ -171,6 +171,20 @@ const DSample & XYSampleData::y(const Index k, const Index j) const
return yData_[j].at(k); return yData_[j].at(k);
} }
void XYSampleData::setUnidimData(const DMatSample &xData,
const vector<const DMatSample *> &v)
{
FOR_STAT_ARRAY(xData, s)
FOR_VEC(xData[central], r)
{
x(r, 0)[s] = xData[s](r);
for (unsigned int j = 0; j < v.size(); ++j)
{
y(r, j)[s] = (*(v[j]))[s](r);
}
}
}
const DMat & XYSampleData::getXXVar(const Index i1, const Index i2) const DMat & XYSampleData::getXXVar(const Index i1, const Index i2)
{ {
checkXDim(i1); checkXDim(i1);
@ -253,6 +267,7 @@ void XYSampleData::setDataToSample(const Index s)
const XYStatData & XYSampleData::getData(void) const XYStatData & XYSampleData::getData(void)
{ {
setDataToSample(central); setDataToSample(central);
computeVarMat();
return data_; return data_;
} }

View File

@ -80,6 +80,8 @@ public:
const DMatSample & x(const Index k); const DMatSample & x(const Index k);
DSample & y(const Index k, const Index j); DSample & y(const Index k, const Index j);
const DSample & y(const Index k, const Index j) const; const DSample & y(const Index k, const Index j) const;
void setUnidimData(const DMatSample &xData,
const std::vector<const DMatSample *> &v);
template <typename... Ts> template <typename... Ts>
void setUnidimData(const DMatSample &xData, void setUnidimData(const DMatSample &xData,
const Ts & ...yDatas); const Ts & ...yDatas);
@ -141,17 +143,9 @@ void XYSampleData::setUnidimData(const DMatSample &xData, const Ts & ...yDatas)
static_assert(static_or<std::is_assignable<DMatSample, Ts>::value...>::value, static_assert(static_or<std::is_assignable<DMatSample, Ts>::value...>::value,
"y data arguments are not compatible with DMatSample"); "y data arguments are not compatible with DMatSample");
std::vector<const DMatSample *> yData{&yDatas...}; std::vector<const DMatSample *> v{&yDatas...};
FOR_STAT_ARRAY(xData, s) setUnidimData(xData, v);
FOR_VEC(xData[central], r)
{
x(r, 0)[s] = xData[s](r);
for (unsigned int j = 0; j < yData.size(); ++j)
{
y(r, j)[s] = (*(yData[j]))[s](r);
}
}
} }
template <typename... Ts> template <typename... Ts>