]> git.treefish.org Git - phys/latlib.git/commitdiff
Removed precalcless jack function.
authorAlexander Schmidt <alex@treefish.org>
Thu, 20 Feb 2014 23:01:52 +0000 (00:01 +0100)
committerAlexander Schmidt <alex@treefish.org>
Thu, 20 Feb 2014 23:01:52 +0000 (00:01 +0100)
obstat.hpp

index 57a3431e6faa36078ecad0935256a6b8bc3e45d7..6a2cf6e3c4a99a80ea31c00d91c1502e303de283 100644 (file)
@@ -17,7 +17,6 @@ public:
 
   int computeEasy(const int& ival=0) { return mean(&measurements, ival); }
 
-  int computeJack(restype (*func)(vector< vector <meastype> > *vals, void *para), void *para=NULL);
   int computeJack(void (*preMeasFunc)(vector< vector <meastype> > *allVals, vector <meastype> *preCalculated, void *para), 
                  restype (*measFunc)(vector <meastype> *preCalculated, vector <meastype> *excludedmeas, int nmeas, void *para), void *para=NULL);
 
@@ -83,44 +82,6 @@ int obstat<meastype,restype>::mean(vector< vector<meastype> > *meas, const int&
   return computations.size()-1;
 }
 
-template <typename meastype, typename restype>
-int obstat<meastype,restype>::computeJack(restype (*func)(vector< vector<meastype> > *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<meastype> >::iterator removedIt = measurements.begin(); removedIt != measurements.end(); ++removedIt, imeas++)
-    {
-      vector<meastype> 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<nmeas; imean++)
-    jackres.err += pow( manymeans[imean] - jackres.val, 2 );
-  jackres.err *= (double)(nmeas-1)/nmeas;
-  jackres.err = sqrt(jackres.err);
-
-  computations.push_back(jackres);
-
-  delete [] manymeans;
-
-  return computations.size()-1;
-}
-
 template <typename meastype, typename restype>
 int obstat<meastype,restype>::computeJack(void (*preMeasFunc)(vector< vector <meastype> > *allVals, vector<meastype> *preCalculated, void *para), 
                                          restype (*measFunc)(vector<meastype> *preCalculated, vector<meastype> *excludedmeas, int nmeas, void *para),