From c6bc8c9af2fa15f921e55b41e555302bbc083e8d Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Tue, 13 Dec 2016 10:29:37 +0000 Subject: [PATCH 1/4] XYSampleData: variance matrix compute fix --- lib/XYSampleData.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/XYSampleData.cpp b/lib/XYSampleData.cpp index bd47452..ecb0811 100644 --- a/lib/XYSampleData.cpp +++ b/lib/XYSampleData.cpp @@ -253,6 +253,7 @@ void XYSampleData::setDataToSample(const Index s) const XYStatData & XYSampleData::getData(void) { setDataToSample(central); + computeVarMat(); return data_; } From d80b16052190cef470073494b618c7528f07af70 Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Tue, 13 Dec 2016 10:30:02 +0000 Subject: [PATCH 2/4] Math interpreter: added infinity as a constant --- lib/MathInterpreter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/MathInterpreter.cpp b/lib/MathInterpreter.cpp index 88997b2..192afe2 100644 --- a/lib/MathInterpreter.cpp +++ b/lib/MathInterpreter.cpp @@ -690,6 +690,7 @@ void MathInterpreter::compile(RunContext &context) if (root_) { context.addVariable("pi", Math::pi); + context.addVariable("inf", HUGE_VAL); ADD_STDMATH_FUNCS(context); root_->compile(program_, context); for (unsigned int i = 0; i < program_.size(); ++i) From 4576d73379b2df16400fe1294d14c8a07bdfd11c Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Tue, 13 Dec 2016 10:37:37 +0000 Subject: [PATCH 3/4] vector version of setUnidimData --- lib/XYSampleData.cpp | 14 ++++++++++++++ lib/XYSampleData.hpp | 14 ++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/lib/XYSampleData.cpp b/lib/XYSampleData.cpp index ecb0811..df53684 100644 --- a/lib/XYSampleData.cpp +++ b/lib/XYSampleData.cpp @@ -171,6 +171,20 @@ const DSample & XYSampleData::y(const Index k, const Index j) const return yData_[j].at(k); } +void XYSampleData::setUnidimData(const DMatSample &xData, + const vector &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) { checkXDim(i1); diff --git a/lib/XYSampleData.hpp b/lib/XYSampleData.hpp index fb16ae8..b5e87d1 100644 --- a/lib/XYSampleData.hpp +++ b/lib/XYSampleData.hpp @@ -80,6 +80,8 @@ public: const DMatSample & x(const Index k); DSample & y(const Index k, const Index j); const DSample & y(const Index k, const Index j) const; + void setUnidimData(const DMatSample &xData, + const std::vector &v); template void setUnidimData(const DMatSample &xData, const Ts & ...yDatas); @@ -141,17 +143,9 @@ void XYSampleData::setUnidimData(const DMatSample &xData, const Ts & ...yDatas) static_assert(static_or::value...>::value, "y data arguments are not compatible with DMatSample"); - std::vector yData{&yDatas...}; + std::vector v{&yDatas...}; - FOR_STAT_ARRAY(xData, s) - 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); - } - } + setUnidimData(xData, v); } template From 769dfd2e055c03c3d74a805a758e3252e4670b8b Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Wed, 11 Jan 2017 11:28:20 +0000 Subject: [PATCH 4/4] .gitignore update --- .gitignore | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 21fc367..d1be914 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ build/* build_debug/* sandbox/* -# Apple stuffs +# Apple stuff *.xcodeproj .DS_Store @@ -30,3 +30,8 @@ lib/eigen_files.mk # CI builds ci-scripts/local/* + +# CLion stuff +.idea/* +CMakeLists.txt +cmake-build-debug/*