X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STAT%2FTKDInterpolator.h;h=8970a9d3ca0eecc83a42106f610613d280536d76;hb=4f96d70701e5d13aafe1b18baa057a0436e0eafe;hp=24212d2274879db2b07817a4dda7c6f67a8c173d;hpb=f2040a8f0b5f586938869122d0b8f019cc91ba09;p=u%2Fmrichter%2FAliRoot.git diff --git a/STAT/TKDInterpolator.h b/STAT/TKDInterpolator.h index 24212d22748..8970a9d3ca0 100644 --- a/STAT/TKDInterpolator.h +++ b/STAT/TKDInterpolator.h @@ -1,51 +1,31 @@ #ifndef ROOT_TKDInterpolator #define ROOT_TKDInterpolator -#ifndef ROOT_TKDTree -#include "TKDTree.h" +#ifndef ROOT_TKDInterpolatorBase +#include "TKDInterpolatorBase.h" #endif -class TTree; -class TLinearFitter; -class TKDInterpolator : public TKDTreeIF +class TKDInterpolator : public TKDInterpolatorBase { public: TKDInterpolator(); - TKDInterpolator(TTree *t, const Char_t *var, const Char_t *cut = 0, UInt_t bsize = 100); - TKDInterpolator(Int_t npoints, Int_t ndim, UInt_t bsize, Float_t **data); + TKDInterpolator(Int_t ndim, Int_t npoints=0); ~TKDInterpolator(); - - inline Bool_t GetEstimate(Int_t node, Float_t *coord, Float_t &val, Float_t &error) const ; - Double_t Eval(Float_t *point); - void DrawNodes(Int_t depth = -1, Int_t ax1 = 0, Int_t ax2 = 1); - void DrawNode(Int_t node, Int_t ax1 = 0, Int_t ax2 = 1); -private: - void Build(); - -protected: - Int_t fNTNodes; //Number of evaluation data points - Float_t **fRefPoints; //[fNDim][fNTNodes] - Float_t *fRefValues; //[fNTNodes] + void AddNode(const TKDNodeInfo &ref); + void Build(Int_t ndim) {TKDInterpolatorBase::Build(ndim);} + void Build(Int_t npoints, Int_t ndim); + Int_t GetNodeIndex(const Float_t *p); + Bool_t SetNode(Int_t i, const TKDNodeInfo &ref); private: - Int_t fDepth; //! depth of the KD Tree structure used - Double_t *fTmpPoint; //! temporary storage for one data point - TKDTreeIF *fKDhelper; //! kNN finder - TLinearFitter *fFitter; //! linear fitter + TKDInterpolator(const TKDInterpolator &); + TKDInterpolator& operator=(const TKDInterpolator &); - ClassDef(TKDInterpolator, 1) // data interpolator based on KD tree +private: + + ClassDef(TKDInterpolator, 1) // LOWESS data interpolator }; -//__________________________________________________________________ -Bool_t TKDInterpolator::GetEstimate(Int_t node, Float_t *coord, Float_t &val, Float_t &error) const -{ - if(node < 0 || node > GetNTerminalNodes()) return kFALSE; - - for(int idim=0; idim