From: Alex Schmidt Date: Thu, 26 Jan 2012 18:55:33 +0000 (+0100) Subject: ... X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/commitdiff_plain/9f6e969663a4126813ae8a37d87acdb698ef8e62 ... --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cdc8bbb --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +CMakeCache.txt +CMakeFiles +cmake_install.cmake +Makefile diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..7ef5aae --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,3 @@ +project(latlib) + +add_library(obs obs.cpp) \ No newline at end of file diff --git a/obs.cpp b/obs.cpp new file mode 100644 index 0000000..f9a7dbf --- /dev/null +++ b/obs.cpp @@ -0,0 +1,165 @@ +#include "obs.h" + +#include + +using namespace std; + +namespace obs +{ + vector mymeas; + + double addMeas(int id, double val) + { + meas tmpmeas; + tmpmeas.id = id; + tmpmeas.val.push_back(val); + mymeas.push_back(tmpmeas); + return val; + } + + double* addMeas(int id, double *val, int valsize) + { + meas tmpmeas; + tmpmeas.id = id; + for( int ival=0; ival vals)) + { + int nmeas = 0; + vector mymeans; + int vecsize = mymeas.size(); + obsa jackobs; + + jackobs.mean = 0; + + for (int ijack=0; ijack < nmeas || nmeas == 0; ijack++) + { + + nmeas = 0; + vector myvals; + + for (int i=0; i > vals)) + { + int nmeas = 0; + vector mymeans; + int vecsize = mymeas.size(); + obsa jackobs; + + jackobs.mean = 0; + + for (int ijack=0; ijack < nmeas || nmeas == 0; ijack++) + { + + nmeas = 0; + vector< vector > myvals; + + for (int i=0; i + +using namespace std; + +namespace obs +{ + struct obsa + { + double mean; + double err; + }; + + struct meas + { + int id; + vector val; + }; + + double addMeas(int id, double val); + double* addMeas(int id, double *val, int valsize); + + obsa jackObs(int id, double (*func)(vector< vector > vals)); + obsa normObs(int id); + + void reset(); +} + +#endif diff --git a/test b/test deleted file mode 100644 index e69de29..0000000