From 8ef69a48437abe5a58c8c0504196fb7701c8ae77 Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Wed, 30 Mar 2016 15:19:11 +0100 Subject: [PATCH] more code cleaning --- examples/exFit.cpp | 2 +- examples/exFit.old.cpp | 54 ------------------------------------------ 2 files changed, 1 insertion(+), 55 deletions(-) delete mode 100644 examples/exFit.old.cpp diff --git a/examples/exFit.cpp b/examples/exFit.cpp index 2c36333..0ff29d0 100644 --- a/examples/exFit.cpp +++ b/examples/exFit.cpp @@ -9,7 +9,7 @@ using namespace std; using namespace Latan; -const Index nPoint1 = 5, nPoint2 = 5; +const Index nPoint1 = 10, nPoint2 = 10; const double xErr = .1, yErr = .1; const double exactPar[2] = {0.5,5.}; const double dx1 = 10.0/static_cast(nPoint1); diff --git a/examples/exFit.old.cpp b/examples/exFit.old.cpp deleted file mode 100644 index a888eb2..0000000 --- a/examples/exFit.old.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace Latan; - -const Index nPoint = 20; -const double exactPar[2] = {0.5,5.0}, dx = 10.0/static_cast(nPoint); - -int main(void) -{ - // generate fake data - XYStatData data(nPoint, 1, 1); - RandGen rg; - double x_k, y_k; - DoubleModel f = compile("return p_1*exp(-x_0*p_0);", 1, 2); - - for (Index k = 0; k < nPoint; ++k) - { - x_k = k*dx; - y_k = f(&x_k, exactPar) + rg.gaussian(0.0, 0.1); - cout << x_k << " " << y_k << " " << 0.1 << endl; - data.x(0, k) = x_k; - data.y(0, k) = y_k; - } - data.yyVar(0, 0).diagonal() = DMat::Constant(nPoint, 1, 0.1*0.1); - data.assumeXExact(0); - - // fit - DVec init = DVec::Constant(2, 0.5); - FitResult p; - MinuitMinimizer minimizer; - - data.fitAllPoints(); - p = data.fit(minimizer, init, f); - - cout << "a= " << p(0) << " b= " << p(1); - cout << " chi^2/ndof= " << p.getChi2PerDof(); - cout << " p-value= " << p.getPValue() <