ROOT logo
ROOT » HIST » HIST » TSpline5

class TSpline5: public TSpline


TSpline

Base class for spline implementation containing the Draw/Paint
methods


Function Members (Methods)

public:
TSpline5()
TSpline5(const TSpline5&)
TSpline5(const TH1* h, const char* opt = 0, Double_t b1 = 0, Double_t e1 = 0, Double_t b2 = 0, Double_t e2 = 0)
TSpline5(const char* title, const TGraph* g, const char* opt = 0, Double_t b1 = 0, Double_t e1 = 0, Double_t b2 = 0, Double_t e2 = 0)
TSpline5(const char* title, Double_t* x, Double_t* y, Int_t n, const char* opt = 0, Double_t b1 = 0, Double_t e1 = 0, Double_t b2 = 0, Double_t e2 = 0)
TSpline5(const char* title, Double_t* x, const TF1* func, Int_t n, const char* opt = 0, Double_t b1 = 0, Double_t e1 = 0, Double_t b2 = 0, Double_t e2 = 0)
TSpline5(const char* title, Double_t xmin, Double_t xmax, Double_t* y, Int_t n, const char* opt = 0, Double_t b1 = 0, Double_t e1 = 0, Double_t b2 = 0, Double_t e2 = 0)
TSpline5(const char* title, Double_t xmin, Double_t xmax, const TF1* func, Int_t n, const char* opt = 0, Double_t b1 = 0, Double_t e1 = 0, Double_t b2 = 0, Double_t e2 = 0)
virtual~TSpline5()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")MENU
Double_tDerivative(Double_t x) const
Int_tTAttLine::DistancetoLine(Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2)
virtual Int_tTSpline::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTSpline::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual Double_tEval(Double_t x) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTSpline::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Int_tFindX(Double_t x) const
voidGetCoeff(Int_t i, Double_t& x, Double_t& y, Double_t& b, Double_t& c, Double_t& d, Double_t& e, Double_t& f)
virtual Double_tTSpline::GetDelta() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual Color_tTAttFill::GetFillColor() const
virtual Style_tTAttFill::GetFillStyle() const
TH1F*TSpline::GetHistogram() const
virtual const char*TObject::GetIconName() const
virtual voidGetKnot(Int_t i, Double_t& x, Double_t& y) const
virtual Color_tTAttLine::GetLineColor() const
virtual Style_tTAttLine::GetLineStyle() const
virtual Width_tTAttLine::GetLineWidth() const
virtual Color_tTAttMarker::GetMarkerColor() const
virtual Size_tTAttMarker::GetMarkerSize() const
virtual Style_tTAttMarker::GetMarkerStyle() const
virtual const char*TNamed::GetName() const
virtual Int_tTSpline::GetNp() const
virtual Int_tTSpline::GetNpx() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Double_tTSpline::GetXmax() const
virtual Double_tTSpline::GetXmin() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
virtual Bool_tTAttFill::IsTransparent() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual voidTAttLine::Modify()
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TSpline5&operator=(const TSpline5&)
virtual voidTSpline::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidTAttFill::ResetAttFill(Option_t* option = "")
virtual voidTAttLine::ResetAttLine(Option_t* option = "")
virtual voidTAttMarker::ResetAttMarker(Option_t* toption = "")
voidTObject::ResetBit(UInt_t f)
virtual voidSaveAs(const char* filename, Option_t* option = "") const
virtual voidTAttFill::SaveFillAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1001)
virtual voidTAttLine::SaveLineAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1, Int_t widdef = 1)
virtual voidTAttMarker::SaveMarkerAttributes(ostream& out, const char* name, Int_t coldef = 1, Int_t stydef = 1, Int_t sizdef = 1)
virtual voidSavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTAttFill::SetFillAttributes()MENU
virtual voidTAttFill::SetFillColor(Color_t fcolor)
virtual voidTAttFill::SetFillStyle(Style_t fstyle)
virtual voidTAttLine::SetLineAttributes()MENU
virtual voidTAttLine::SetLineColor(Color_t lcolor)
virtual voidTAttLine::SetLineStyle(Style_t lstyle)
virtual voidTAttLine::SetLineWidth(Width_t lwidth)
virtual voidTAttMarker::SetMarkerAttributes()MENU
virtual voidTAttMarker::SetMarkerColor(Color_t tcolor = 1)
virtual voidTAttMarker::SetMarkerSize(Size_t msize = 1)
virtual voidTAttMarker::SetMarkerStyle(Style_t mstyle = 1)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
voidTSpline::SetNpx(Int_t n)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidSetPoint(Int_t i, Double_t x, Double_t y)
virtual voidSetPointCoeff(Int_t i, Double_t b, Double_t c, Double_t d, Double_t e, Double_t f)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
static voidTest()
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
voidBoundaryConditions(const char* opt, Int_t& beg, Int_t& end, const char*& cb1, const char*& ce1, const char*& cb2, const char*& ce2)
virtual voidBuildCoeff()
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
voidSetBoundaries(Double_t b1, Double_t e1, Double_t b2, Double_t e2, const char* cb1, const char* ce1, const char* cb2, const char* ce2)

Data Members

protected:
Double_tTSpline::fDeltaDistance between equidistant knots
Color_tTAttFill::fFillColorfill area color
Style_tTAttFill::fFillStylefill area style
TGraph*TSpline::fGraphGraph for drawing the knots
TH1F*TSpline::fHistogramTemporary histogram
Bool_tTSpline::fKstepTrue of equidistant knots
Color_tTAttLine::fLineColorline color
Style_tTAttLine::fLineStyleline style
Width_tTAttLine::fLineWidthline width
Color_tTAttMarker::fMarkerColorMarker color index
Size_tTAttMarker::fMarkerSizeMarker size
Style_tTAttMarker::fMarkerStyleMarker style
TStringTNamed::fNameobject identifier
Int_tTSpline::fNpNumber of knots
Int_tTSpline::fNpxNumber of points used for graphical representation
TSplinePoly5*fPoly[fNp] Array of polynomial terms
TStringTNamed::fTitleobject title
Double_tTSpline::fXmaxMaximum value of abscissa
Double_tTSpline::fXminMinimum value of abscissa

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TSpline5(const char *title, Double_t x[], Double_t y[], Int_t n, const char *opt, Double_t b1, Double_t e1, Double_t b2, Double_t e2)
 Quintic natural spline creator given an array of
 arbitrary knots in increasing abscissa order and
 possibly end point conditions
TSpline5(const char *title, Double_t xmin, Double_t xmax, Double_t y[], Int_t n, const char *opt, Double_t b1, Double_t e1, Double_t b2, Double_t e2)
 Quintic natural spline creator given an array of
 arbitrary function values on equidistant n abscissa
 values from xmin to xmax and possibly end point conditions
TSpline5(const char* title, Double_t* x, const TF1* func, Int_t n, const char* opt = 0, Double_t b1 = 0, Double_t e1 = 0, Double_t b2 = 0, Double_t e2 = 0)
 Quintic natural spline creator given an array of
 arbitrary abscissas in increasing order and a function
 to interpolate and possibly end point conditions
TSpline5(const char* title, Double_t xmin, Double_t xmax, const TF1* func, Int_t n, const char* opt = 0, Double_t b1 = 0, Double_t e1 = 0, Double_t b2 = 0, Double_t e2 = 0)
 Quintic natural spline creator given a function to be
 evaluated on n equidistand abscissa points between xmin
 and xmax and possibly end point conditions
TSpline5(const char* title, const TGraph* g, const char* opt = 0, Double_t b1 = 0, Double_t e1 = 0, Double_t b2 = 0, Double_t e2 = 0)
 Quintic natural spline creator given a TGraph with
 abscissa in increasing order and possibly end
 point conditions
TSpline5(const TH1* h, const char* opt = 0, Double_t b1 = 0, Double_t e1 = 0, Double_t b2 = 0, Double_t e2 = 0)
 Quintic natural spline creator given a TH1
TSpline5(const TSpline5& )
copy constructor
TSpline5& operator=(const TSpline5& )
assignment operator
void BoundaryConditions(const char* opt, Int_t& beg, Int_t& end, const char*& cb1, const char*& ce1, const char*& cb2, const char*& ce2)
 Check the boundary conditions and the
 amount of extra double knots needed
void SetBoundaries(Double_t b1, Double_t e1, Double_t b2, Double_t e2, const char* cb1, const char* ce1, const char* cb2, const char* ce2)
 Set the boundary conditions at double/triple knots
Int_t FindX(Double_t x) const
 Find X
Double_t Eval(Double_t x) const
 Eval this spline at x
Double_t Derivative(Double_t x) const
void SaveAs(const char* filename, Option_t* option = "") const
 write this spline as a C++ function that can be executed without ROOT
 the name of the function is the name of the file up to the "." if any
void SavePrimitive(ostream& out, Option_t* option = "")
 Save primitive as a C++ statement(s) on output stream out
void SetPoint(Int_t i, Double_t x, Double_t y)
set point number i.
void SetPointCoeff(Int_t i, Double_t b, Double_t c, Double_t d, Double_t e, Double_t f)
 set point coefficient number i
void BuildCoeff()
     algorithm 600, collected algorithms from acm.
     algorithm appeared in acm-trans. math. software, vol.9, no. 2,
     jun., 1983, p. 258-259.

     TSpline5 computes the coefficients of a quintic natural quintic spli
     s(x) with knots x(i) interpolating there to given function values:
               s(x(i)) = y(i)  for i = 1,2, ..., n.
     in each interval (x(i),x(i+1)) the spline function s(xx) is a
     polynomial of fifth degree:
     s(xx) = ((((f(i)*p+e(i))*p+d(i))*p+c(i))*p+b(i))*p+y(i)    (*)
           = ((((-f(i)*q+e(i+1))*q-d(i+1))*q+c(i+1))*q-b(i+1))*q+y(i+1)
     where  p = xx - x(i)  and  q = x(i+1) - xx.
     (note the first subscript in the second expression.)
     the different polynomials are pieced together so that s(x) and
     its derivatives up to s"" are continuous.

        input:

     n          number of data points, (at least three, i.e. n > 2)
     x(1:n)     the strictly increasing or decreasing sequence of
                knots.  the spacing must be such that the fifth power
                of x(i+1) - x(i) can be formed without overflow or
                underflow of exponents.
     y(1:n)     the prescribed function values at the knots.

        output:

     b,c,d,e,f  the computed spline coefficients as in (*).
         (1:n)  specifically
                b(i) = s'(x(i)), c(i) = s"(x(i))/2, d(i) = s"'(x(i))/6,
                e(i) = s""(x(i))/24,  f(i) = s""'(x(i))/120.
                f(n) is neither used nor altered.  the five arrays
                b,c,d,e,f must always be distinct.

        option:

     it is possible to specify values for the first and second
     derivatives of the spline function at arbitrarily many knots.
     this is done by relaxing the requirement that the sequence of
     knots be strictly increasing or decreasing.  specifically:

     if x(j) = x(j+1) then s(x(j)) = y(j) and s'(x(j)) = y(j+1),
     if x(j) = x(j+1) = x(j+2) then in addition s"(x(j)) = y(j+2).

     note that s""(x) is discontinuous at a double knot and, in
     addition, s"'(x) is discontinuous at a triple knot.  the
     subroutine assigns y(i) to y(i+1) in these cases and also to
     y(i+2) at a triple knot.  the representation (*) remains
     valid in each open interval (x(i),x(i+1)).  at a double knot,
     x(j) = x(j+1), the output coefficients have the following values:
       y(j) = s(x(j))          = y(j+1)
       b(j) = s'(x(j))         = b(j+1)
       c(j) = s"(x(j))/2       = c(j+1)
       d(j) = s"'(x(j))/6      = d(j+1)
       e(j) = s""(x(j)-0)/24     e(j+1) = s""(x(j)+0)/24
       f(j) = s""'(x(j)-0)/120   f(j+1) = s""'(x(j)+0)/120
     at a triple knot, x(j) = x(j+1) = x(j+2), the output
     coefficients have the following values:
       y(j) = s(x(j))         = y(j+1)    = y(j+2)
       b(j) = s'(x(j))        = b(j+1)    = b(j+2)
       c(j) = s"(x(j))/2      = c(j+1)    = c(j+2)
       d(j) = s"'((x(j)-0)/6    d(j+1) = 0  d(j+2) = s"'(x(j)+0)/6
       e(j) = s""(x(j)-0)/24    e(j+1) = 0  e(j+2) = s""(x(j)+0)/24
       f(j) = s""'(x(j)-0)/120  f(j+1) = 0  f(j+2) = s""'(x(j)+0)/120
void Test()
 Test method for TSpline5


   n          number of data points.
   m          2*m-1 is order of spline.
                 m = 3 always for quintic spline.
   nn,nm1,mm,
   mm1,i,k,
   j,jj       temporary integer variables.
   z,p        temporary double precision variables.
   x[n]       the sequence of knots.
   y[n]       the prescribed function values at the knots.
   a[200][6]  two dimensional array whose columns are
                 the computed spline coefficients
   diff[5]    maximum values of differences of values and
                 derivatives to right and left of knots.
   com[5]     maximum values of coefficients.


   test of TSpline5 with nonequidistant knots and
      equidistant knots follows.
void Streamer(TBuffer& b)
 Stream an object of class TSpline5.
void GetKnot(Int_t i, Double_t& x, Double_t& y) const
void GetCoeff(Int_t i, Double_t &x, Double_t &y, Double_t &b, Double_t &c, Double_t &d)
TSpline5()
{}
virtual ~TSpline5()
{if (fPoly) delete [] fPoly;}