X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/33ee1f81e21dbb384b48c8083aff790ca313558e..e9c0e0b98886738917300348a522759c25d4a9c7:/obstat.hpp diff --git a/obstat.hpp b/obstat.hpp index 57a3431..6a2cf6e 100644 --- a/obstat.hpp +++ b/obstat.hpp @@ -17,7 +17,6 @@ public: int computeEasy(const int& ival=0) { return mean(&measurements, ival); } - int computeJack(restype (*func)(vector< vector > *vals, void *para), void *para=NULL); int computeJack(void (*preMeasFunc)(vector< vector > *allVals, vector *preCalculated, void *para), restype (*measFunc)(vector *preCalculated, vector *excludedmeas, int nmeas, void *para), void *para=NULL); @@ -83,44 +82,6 @@ int obstat::mean(vector< vector > *meas, const int& return computations.size()-1; } -template -int obstat::computeJack(restype (*func)(vector< vector > *vals, void *para), void *para) -{ - int nmeas=measurements.size(); - restype *manymeans = new restype[nmeas]; - result jackres; - - jackres.val = 0; - jackres.err = 0; - - int imeas=0; - for(typename vector< vector >::iterator removedIt = measurements.begin(); removedIt != measurements.end(); ++removedIt, imeas++) - { - vector removed = *removedIt; - - *removedIt = measurements.back(); - measurements.pop_back(); - - manymeans[imeas] = func(&measurements, para); - jackres.val += manymeans[imeas]; - - measurements.push_back( *removedIt ); - *removedIt = removed; - } - jackres.val /= nmeas; - - for(int imean=0; imean int obstat::computeJack(void (*preMeasFunc)(vector< vector > *allVals, vector *preCalculated, void *para), restype (*measFunc)(vector *preCalculated, vector *excludedmeas, int nmeas, void *para),