135 pmin =
gPad->PadtoX(
gPad->GetUxmin());
136 pmax =
gPad->PadtoX(
gPad->GetUxmax());
140 if (
xmax < pmin)
return;
141 if (
xmin > pmax)
return;
165 for (i=0;i<=
fNpx;i++) {
166 xbins[i] =
gPad->PadtoX(xlogmin+ i*dlogx);
177 for (i=1;i<=
fNpx;i++) {
195 char *o = (
char *) opt.
Data();
227void TSpline::Streamer(
TBuffer &R__b)
237 TNamed::Streamer(R__b);
238 TAttLine::Streamer(R__b);
239 TAttFill::Streamer(R__b);
240 TAttMarker::Streamer(R__b);
358 fValBeg(valbeg), fValEnd(valend), fBegCond(0), fEndCond(0)
368 for (
Int_t i=0; i<
n; ++i) {
387 fValBeg(valbeg), fValEnd(valend),
388 fBegCond(0), fEndCond(0)
398 for (
Int_t i=0; i<
n; ++i) {
416 fValBeg(valbeg), fValEnd(valend),
417 fBegCond(0), fEndCond(0)
427 for (
Int_t i=0; i<
n; ++i) {
443 const TF1 *func,
Int_t n,
const char *opt,
446 fValBeg(valbeg), fValEnd(valend),
447 fBegCond(0), fEndCond(0)
460 for (
Int_t i=0; i<
n; ++i) {
476 const TGraph *
g,
const char *opt,
479 fValBeg(valbeg), fValEnd(valend),
480 fBegCond(0), fEndCond(0)
492 g->GetPoint(i,xx,yy);
509 fValBeg(valbeg), fValEnd(valend),
510 fBegCond(0), fEndCond(0)
521 fPoly[i].
X()=
h->GetXaxis()->GetBinCenter(i+1);
522 fPoly[i].
Y()=
h->GetBinContent(i+1);
537 fValBeg(sp3.fValBeg),
538 fValEnd(sp3.fValEnd),
539 fBegCond(sp3.fBegCond),
540 fEndCond(sp3.fEndCond)
572 const char *b1 = strstr(opt,
"b1");
573 const char *e1 = strstr(opt,
"e1");
574 const char *b2 = strstr(opt,
"b2");
575 const char *e2 = strstr(opt,
"e2");
577 Error(
"SetCond",
"Cannot specify first and second derivative at first point");
579 Error(
"SetCond",
"Cannot specify first and second derivative at last point");
619 printf(
"1 TEST OF TSpline3 WITH NONEQUIDISTANT KNOTS\n");
634 printf(
"\n-N = %3d M =%2d\n",
n,
m);
636 for (i = 0; i <
n; ++i)
637 spline->
GetCoeff(i,hx,
a[i],
a[i+200],
a[i+400],
a[i+600]);
639 for (i = 0; i < mm1; ++i) diff[i] = com[i] = 0;
640 for (k = 0; k <
n; ++k) {
641 for (i = 0; i <
mm; ++i)
c[i] =
a[k+i*200];
642 printf(
" ---------------------------------------%3d --------------------------------------------\n",k+1);
643 printf(
"%12.8f\n",
x[k]);
645 printf(
"%16.8f\n",
c[0]);
647 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
649 for (i = 0; i < mm1; ++i)
650 if ((z=
TMath::Abs(
a[k+i*200])) > com[i]) com[i] = z;
652 for (i = 1; i <
mm; ++i)
653 for (jj = i; jj <
mm; ++jj) {
655 c[j-2] =
c[j-1]*z+
c[j-2];
657 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
659 for (i = 0; i < mm1; ++i)
660 if (!(k >=
n-2 && i != 0))
662 > diff[i]) diff[i] = z;
665 printf(
" MAXIMUM ABSOLUTE VALUES OF DIFFERENCES \n");
666 for (i = 0; i < mm1; ++i) printf(
"%18.9E",diff[i]);
668 printf(
" MAXIMUM ABSOLUTE VALUES OF COEFFICIENTS \n");
671 for (i = 0; i < mm1; ++i) printf(
"%16.8f",com[i]);
674 for (
n = 10;
n <= 100;
n += 10) {
678 for (i = 0; i < nm1; i += 2) {
688 printf(
"\n-N = %3d M =%2d\n",
n,
m);
690 for (i = 0; i <
n; ++i)
693 for (i = 0; i < mm1; ++i)
694 diff[i] = com[i] = 0;
695 for (k = 0; k <
n; ++k) {
696 for (i = 0; i <
mm; ++i)
699 printf(
" ---------------------------------------%3d --------------------------------------------\n",k+1);
700 printf(
"%12.8f\n",
x[k]);
701 if (k ==
n-1) printf(
"%16.8f\n",
c[0]);
705 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
708 for (i = 0; i < mm1; ++i)
712 for (i = 1; i <
mm; ++i)
713 for (jj = i; jj <
mm; ++jj) {
715 c[j-2] =
c[j-1]*z+
c[j-2];
718 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
721 for (i = 0; i < mm1; ++i)
722 if (!(k >=
n-2 && i != 0))
724 > diff[i]) diff[i] = z;
726 printf(
" MAXIMUM ABSOLUTE VALUES OF DIFFERENCES \n");
727 for (i = 0; i < mm1; ++i) printf(
"%18.9E",diff[i]);
729 printf(
" MAXIMUM ABSOLUTE VALUES OF COEFFICIENTS \n");
732 for (i = 0; i < mm1; ++i) printf(
"%16.8E",com[i]);
747 else if(
x>=
fXmax) klow=khig;
756 else if (klow < khig) {
757 if (
x >
fPoly[klow+1].X()) ++klow;
764 if(
x>
fPoly[khalf=(klow+khig)/2].X())
772 "Binary search failed x(%d) = %f < x= %f < x(%d) = %f\n",
785 if (klow >=
fNp-1 &&
fNp > 1) klow =
fNp-2;
795 if (klow >=
fNp-1) klow =
fNp-2;
806 std::ofstream *
f =
new std::ofstream(filename,std::ios::out);
808 Error(
"SaveAs",
"Cannot open file:%s\n",filename);
814 Int_t nch = strlen(filename);
815 snprintf(buffer,512,
"double %s",filename);
816 char *dot = strstr(buffer,
".");
818 strlcat(buffer,
"(double x) {\n",512);
819 nch = strlen(buffer);
f->write(buffer,nch);
821 nch = strlen(buffer);
f->write(buffer,nch);
823 nch = strlen(buffer);
f->write(buffer,nch);
827 snprintf(buffer,512,
" const double fX[%d] = {",
fNp);
828 nch = strlen(buffer);
f->write(buffer,nch);
832 for (i=0;i<
fNp;i++) {
835 if (i ==
fNp-1) numb[nch-1]=0;
836 strlcat(buffer,numb,512);
837 if (i%5 == 4 || i ==
fNp-1) {
838 nch = strlen(buffer);
f->write(buffer,nch);
843 nch = strlen(buffer);
f->write(buffer,nch);
845 snprintf(buffer,512,
" const double fY[%d] = {",
fNp);
846 nch = strlen(buffer);
f->write(buffer,nch);
848 for (i=0;i<
fNp;i++) {
851 if (i ==
fNp-1) numb[nch-1]=0;
852 strlcat(buffer,numb,512);
853 if (i%5 == 4 || i ==
fNp-1) {
854 nch = strlen(buffer);
f->write(buffer,nch);
859 nch = strlen(buffer);
f->write(buffer,nch);
861 snprintf(buffer,512,
" const double fB[%d] = {",
fNp);
862 nch = strlen(buffer);
f->write(buffer,nch);
864 for (i=0;i<
fNp;i++) {
867 if (i ==
fNp-1) numb[nch-1]=0;
868 strlcat(buffer,numb,512);
869 if (i%5 == 4 || i ==
fNp-1) {
870 nch = strlen(buffer);
f->write(buffer,nch);
875 nch = strlen(buffer);
f->write(buffer,nch);
877 snprintf(buffer,512,
" const double fC[%d] = {",
fNp);
878 nch = strlen(buffer);
f->write(buffer,nch);
880 for (i=0;i<
fNp;i++) {
883 if (i ==
fNp-1) numb[nch-1]=0;
884 strlcat(buffer,numb,512);
885 if (i%5 == 4 || i ==
fNp-1) {
886 nch = strlen(buffer);
f->write(buffer,nch);
891 nch = strlen(buffer);
f->write(buffer,nch);
893 snprintf(buffer,512,
" const double fD[%d] = {",
fNp);
894 nch = strlen(buffer);
f->write(buffer,nch);
896 for (i=0;i<
fNp;i++) {
899 if (i ==
fNp-1) numb[nch-1]=0;
900 strlcat(buffer,numb,512);
901 if (i%5 == 4 || i ==
fNp-1) {
902 nch = strlen(buffer);
f->write(buffer,nch);
907 nch = strlen(buffer);
f->write(buffer,nch);
910 snprintf(buffer,512,
" int klow=0;\n");
911 nch = strlen(buffer);
f->write(buffer,nch);
913 snprintf(buffer,512,
" // If out of boundaries, extrapolate. It may be badly wrong\n");
914 snprintf(buffer,512,
" if(x<=fXmin) klow=0;\n");
915 nch = strlen(buffer);
f->write(buffer,nch);
916 snprintf(buffer,512,
" else if(x>=fXmax) klow=fNp-1;\n");
917 nch = strlen(buffer);
f->write(buffer,nch);
919 nch = strlen(buffer);
f->write(buffer,nch);
920 snprintf(buffer,512,
" if(fKstep) {\n");
921 nch = strlen(buffer);
f->write(buffer,nch);
923 snprintf(buffer,512,
" // Equidistant knots, use histogramming\n");
924 nch = strlen(buffer);
f->write(buffer,nch);
925 snprintf(buffer,512,
" klow = int((x-fXmin)/fDelta);\n");
926 nch = strlen(buffer);
f->write(buffer,nch);
927 snprintf(buffer,512,
" if (klow < fNp-1) klow = fNp-1;\n");
928 nch = strlen(buffer);
f->write(buffer,nch);
930 nch = strlen(buffer);
f->write(buffer,nch);
931 snprintf(buffer,512,
" int khig=fNp-1, khalf;\n");
932 nch = strlen(buffer);
f->write(buffer,nch);
934 snprintf(buffer,512,
" // Non equidistant knots, binary search\n");
935 nch = strlen(buffer);
f->write(buffer,nch);
936 snprintf(buffer,512,
" while(khig-klow>1)\n");
937 nch = strlen(buffer);
f->write(buffer,nch);
938 snprintf(buffer,512,
" if(x>fX[khalf=(klow+khig)/2]) klow=khalf;\n");
939 nch = strlen(buffer);
f->write(buffer,nch);
940 snprintf(buffer,512,
" else khig=khalf;\n");
941 nch = strlen(buffer);
f->write(buffer,nch);
943 nch = strlen(buffer);
f->write(buffer,nch);
945 nch = strlen(buffer);
f->write(buffer,nch);
946 snprintf(buffer,512,
" // Evaluate now\n");
947 nch = strlen(buffer);
f->write(buffer,nch);
948 snprintf(buffer,512,
" double dx=x-fX[klow];\n");
949 nch = strlen(buffer);
f->write(buffer,nch);
950 snprintf(buffer,512,
" return (fY[klow]+dx*(fB[klow]+dx*(fC[klow]+dx*fD[klow])));\n");
951 nch = strlen(buffer);
f->write(buffer,nch);
956 if (
f) {
f->close();
delete f;}
971 out<<
"spline3 = new TSpline3("<<quote<<
GetTitle()<<quote<<
","
972 <<
fXmin<<
","<<
fXmax<<
",(TF1*)0,"<<
fNp<<
","<<quote<<quote<<
","
974 out<<
" spline3->SetName("<<quote<<
GetName()<<quote<<
");"<<std::endl;
979 if (
fNpx != 100) out<<
" spline3->SetNpx("<<
fNpx<<
");"<<std::endl;
982 out<<
" spline3->SetPoint("<<i<<
","<<
fPoly[i].
X()<<
","<<
fPoly[i].
Y()<<
");"<<std::endl;
983 out<<
" spline3->SetPointCoeff("<<i<<
","<<
fPoly[i].
B()<<
","<<
fPoly[i].
C()<<
","<<
fPoly[i].
D()<<
");"<<std::endl;
985 out<<
" spline3->Draw("<<quote<<option<<quote<<
");"<<std::endl;
993 if (i < 0 || i >=
fNp)
return;
1003 if (i < 0 || i >=
fNp)
return;
1088 for (
m=1;
m<
l; ++
m) {
1157 for (i=1; i<
fNp; ++i) {
1161 fPoly[i-1].
C() = (divdf1 -
fPoly[i-1].
B() - divdf3)/dtau;
1162 fPoly[i-1].
D() = (divdf3/dtau)/dtau;
1169void TSpline3::Streamer(
TBuffer &R__b)
1179 TSpline::Streamer(R__b);
1183 fPoly[i].Streamer(R__b);
1216 const char *cb1, *ce1, *cb2, *ce2;
1225 for (
Int_t i=0; i<
n; ++i) {
1250 const char *cb1, *ce1, *cb2, *ce2;
1259 for (
Int_t i=0; i<
n; ++i) {
1283 const char *cb1, *ce1, *cb2, *ce2;
1292 for (
Int_t i=0; i<
n; i++) {
1317 const char *cb1, *ce1, *cb2, *ce2;
1326 for (
Int_t i=0; i<
n; ++i) {
1329 if (func)
fPoly[i+beg].
Y() = ((
TF1*)func)->Eval(
x);
1352 const char *cb1, *ce1, *cb2, *ce2;
1363 g->GetPoint(i,xx,yy);
1386 const char *cb1, *ce1, *cb2, *ce2;
1396 fPoly[i+beg].
X()=
h->GetXaxis()->GetBinCenter(i+1);
1397 fPoly[i+beg].
Y()=
h->GetBinContent(i+1);
1443 const char *&cb1,
const char *&ce1,
1444 const char *&cb2,
const char *&ce2)
1449 cb1 = strstr(opt,
"b1");
1450 ce1 = strstr(opt,
"e1");
1451 cb2 = strstr(opt,
"b2");
1452 ce2 = strstr(opt,
"e2");
1474 const char *cb1,
const char *ce1,
const char *cb2,
1540 if(
x>
fPoly[khalf=(klow+khig)/2].X())
1549 "Binary search failed x(%d) = %f < x(%d) = %f\n",
1550 klow,
fPoly[klow].X(),klow+1,
fPoly[klow+1].X());
1580 std::ofstream *
f =
new std::ofstream(filename,std::ios::out);
1582 Error(
"SaveAs",
"Cannot open file:%s\n",filename);
1588 Int_t nch = strlen(filename);
1589 snprintf(buffer,512,
"double %s",filename);
1590 char *dot = strstr(buffer,
".");
1592 strlcat(buffer,
"(double x) {\n",512);
1593 nch = strlen(buffer);
f->write(buffer,nch);
1595 nch = strlen(buffer);
f->write(buffer,nch);
1597 nch = strlen(buffer);
f->write(buffer,nch);
1601 snprintf(buffer,512,
" const double fX[%d] = {",
fNp);
1602 nch = strlen(buffer);
f->write(buffer,nch);
1606 for (i=0;i<
fNp;i++) {
1609 if (i ==
fNp-1) numb[nch-1]=0;
1610 strlcat(buffer,numb,512);
1611 if (i%5 == 4 || i ==
fNp-1) {
1612 nch = strlen(buffer);
f->write(buffer,nch);
1617 nch = strlen(buffer);
f->write(buffer,nch);
1619 snprintf(buffer,512,
" const double fY[%d] = {",
fNp);
1620 nch = strlen(buffer);
f->write(buffer,nch);
1622 for (i=0;i<
fNp;i++) {
1625 if (i ==
fNp-1) numb[nch-1]=0;
1626 strlcat(buffer,numb,512);
1627 if (i%5 == 4 || i ==
fNp-1) {
1628 nch = strlen(buffer);
f->write(buffer,nch);
1633 nch = strlen(buffer);
f->write(buffer,nch);
1635 snprintf(buffer,512,
" const double fB[%d] = {",
fNp);
1636 nch = strlen(buffer);
f->write(buffer,nch);
1638 for (i=0;i<
fNp;i++) {
1641 if (i ==
fNp-1) numb[nch-1]=0;
1642 strlcat(buffer,numb,512);
1643 if (i%5 == 4 || i ==
fNp-1) {
1644 nch = strlen(buffer);
f->write(buffer,nch);
1649 nch = strlen(buffer);
f->write(buffer,nch);
1651 snprintf(buffer,512,
" const double fC[%d] = {",
fNp);
1652 nch = strlen(buffer);
f->write(buffer,nch);
1654 for (i=0;i<
fNp;i++) {
1657 if (i ==
fNp-1) numb[nch-1]=0;
1658 strlcat(buffer,numb,512);
1659 if (i%5 == 4 || i ==
fNp-1) {
1660 nch = strlen(buffer);
f->write(buffer,nch);
1665 nch = strlen(buffer);
f->write(buffer,nch);
1667 snprintf(buffer,512,
" const double fD[%d] = {",
fNp);
1668 nch = strlen(buffer);
f->write(buffer,nch);
1670 for (i=0;i<
fNp;i++) {
1673 if (i ==
fNp-1) numb[nch-1]=0;
1674 strlcat(buffer,numb,512);
1675 if (i%5 == 4 || i ==
fNp-1) {
1676 nch = strlen(buffer);
f->write(buffer,nch);
1681 nch = strlen(buffer);
f->write(buffer,nch);
1683 snprintf(buffer,512,
" const double fE[%d] = {",
fNp);
1684 nch = strlen(buffer);
f->write(buffer,nch);
1686 for (i=0;i<
fNp;i++) {
1689 if (i ==
fNp-1) numb[nch-1]=0;
1690 strlcat(buffer,numb,512);
1691 if (i%5 == 4 || i ==
fNp-1) {
1692 nch = strlen(buffer);
f->write(buffer,nch);
1697 nch = strlen(buffer);
f->write(buffer,nch);
1699 snprintf(buffer,512,
" const double fF[%d] = {",
fNp);
1700 nch = strlen(buffer);
f->write(buffer,nch);
1702 for (i=0;i<
fNp;i++) {
1705 if (i ==
fNp-1) numb[nch-1]=0;
1706 strlcat(buffer,numb,512);
1707 if (i%5 == 4 || i ==
fNp-1) {
1708 nch = strlen(buffer);
f->write(buffer,nch);
1713 nch = strlen(buffer);
f->write(buffer,nch);
1716 snprintf(buffer,512,
" int klow=0;\n");
1717 nch = strlen(buffer);
f->write(buffer,nch);
1719 snprintf(buffer,512,
" // If out of boundaries, extrapolate. It may be badly wrong\n");
1720 snprintf(buffer,512,
" if(x<=fXmin) klow=0;\n");
1721 nch = strlen(buffer);
f->write(buffer,nch);
1722 snprintf(buffer,512,
" else if(x>=fXmax) klow=fNp-1;\n");
1723 nch = strlen(buffer);
f->write(buffer,nch);
1725 nch = strlen(buffer);
f->write(buffer,nch);
1726 snprintf(buffer,512,
" if(fKstep) {\n");
1727 nch = strlen(buffer);
f->write(buffer,nch);
1729 snprintf(buffer,512,
" // Equidistant knots, use histogramming\n");
1730 nch = strlen(buffer);
f->write(buffer,nch);
1731 snprintf(buffer,512,
" klow = int((x-fXmin)/fDelta);\n");
1732 nch = strlen(buffer);
f->write(buffer,nch);
1733 snprintf(buffer,512,
" if (klow < fNp-1) klow = fNp-1;\n");
1734 nch = strlen(buffer);
f->write(buffer,nch);
1735 snprintf(buffer,512,
" } else {\n");
1736 nch = strlen(buffer);
f->write(buffer,nch);
1737 snprintf(buffer,512,
" int khig=fNp-1, khalf;\n");
1738 nch = strlen(buffer);
f->write(buffer,nch);
1740 snprintf(buffer,512,
" // Non equidistant knots, binary search\n");
1741 nch = strlen(buffer);
f->write(buffer,nch);
1742 snprintf(buffer,512,
" while(khig-klow>1)\n");
1743 nch = strlen(buffer);
f->write(buffer,nch);
1744 snprintf(buffer,512,
" if(x>fX[khalf=(klow+khig)/2]) klow=khalf;\n");
1745 nch = strlen(buffer);
f->write(buffer,nch);
1746 snprintf(buffer,512,
" else khig=khalf;\n");
1747 nch = strlen(buffer);
f->write(buffer,nch);
1749 nch = strlen(buffer);
f->write(buffer,nch);
1751 nch = strlen(buffer);
f->write(buffer,nch);
1752 snprintf(buffer,512,
" // Evaluate now\n");
1753 nch = strlen(buffer);
f->write(buffer,nch);
1754 snprintf(buffer,512,
" double dx=x-fX[klow];\n");
1755 nch = strlen(buffer);
f->write(buffer,nch);
1756 snprintf(buffer,512,
" return (fY[klow]+dx*(fB[klow]+dx*(fC[klow]+dx*(fD[klow]+dx*(fE[klow]+dx*fF[klow])))));\n");
1757 nch = strlen(buffer);
f->write(buffer,nch);
1762 if (
f) {
f->close();
delete f;}
1771 out<<
" "<<std::endl;
1781 out<<
"spline5 = new TSpline5("<<quote<<
GetTitle()<<quote<<
","
1782 <<
fXmin<<
","<<
fXmax<<
",(TF1*)0,"<<
fNp<<
","<<quote<<quote<<
","
1783 <<b1<<
","<<e1<<
","<<b2<<
","<<e2<<
");"<<std::endl;
1784 out<<
" spline5->SetName("<<quote<<
GetName()<<quote<<
");"<<std::endl;
1789 if (
fNpx != 100) out<<
" spline5->SetNpx("<<
fNpx<<
");"<<std::endl;
1792 out<<
" spline5->SetPoint("<<i<<
","<<
fPoly[i].
X()<<
","<<
fPoly[i].
Y()<<
");"<<std::endl;
1793 out<<
" spline5->SetPointCoeff("<<i<<
","<<
fPoly[i].
B()<<
","<<
fPoly[i].
C()<<
","<<
fPoly[i].
D()<<
","<<
fPoly[i].
E()<<
","<<
fPoly[i].
F()<<
");"<<std::endl;
1795 out<<
" spline5->Draw("<<quote<<option<<quote<<
");"<<std::endl;
1804 if (i < 0 || i >=
fNp)
return;
1815 if (i < 0 || i >=
fNp)
return;
1904 b1, p2, p3, q2, q3, r2, pq, pr, qr;
1919 if (
q)
fPoly[1].
D() =
q*6.*q2/(qr*qr);
1923 for (i = 1; i <
m; ++i) {
1936 fPoly[i+1].
D() = q3*6./(qr*qr);
1938 *(pr* 20.+q2*7.)+q2*
1939 ((p2+r2)*8.+pr*21.+q2+q2))/(pqqr*pqqr);
1940 fPoly[i-1].
D() += q3*6./(pq*pq);
1941 fPoly[i].
E() = q2*(p*qr+pq*3.*(qr+
r+
r))/(pqqr*qr);
1942 fPoly[i-1].
E() += q2*(
r*pq+qr*3.*(pq+p+p))/(pqqr*pq);
1943 fPoly[i-1].
F() = q3/pqqr;
1948 if (
r)
fPoly[
m-1].
D() +=
r*6.*r2/(qr*qr);
1953 for (i = 1; i <
fNp; ++i) {
1962 for (i = 2; i <
fNp; ++i) {
1980 for (i = 2; i <
m; ++i) {
1993 for (i=
fNp-3; i > 0; --i)
2011 for (i = 1; i <
m; ++i) {
2089 printf(
"1 TEST OF TSpline5 WITH NONEQUIDISTANT KNOTS\n");
2104 printf(
"\n-N = %3d M =%2d\n",
n,
m);
2106 for (i = 0; i <
n; ++i)
2108 a[i+600],
a[i+800],
a[i+1000]);
2110 for (i = 0; i < mm1; ++i) diff[i] = com[i] = 0;
2111 for (k = 0; k <
n; ++k) {
2112 for (i = 0; i <
mm; ++i)
c[i] =
a[k+i*200];
2113 printf(
" ---------------------------------------%3d --------------------------------------------\n",k+1);
2114 printf(
"%12.8f\n",
x[k]);
2116 printf(
"%16.8f\n",
c[0]);
2118 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
2120 for (i = 0; i < mm1; ++i)
2121 if ((z=
TMath::Abs(
a[k+i*200])) > com[i]) com[i] = z;
2123 for (i = 1; i <
mm; ++i)
2124 for (jj = i; jj <
mm; ++jj) {
2126 c[j-2] =
c[j-1]*z+
c[j-2];
2128 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
2130 for (i = 0; i < mm1; ++i)
2131 if (!(k >=
n-2 && i != 0))
2133 > diff[i]) diff[i] = z;
2136 printf(
" MAXIMUM ABSOLUTE VALUES OF DIFFERENCES \n");
2137 for (i = 0; i < mm1; ++i) printf(
"%18.9E",diff[i]);
2139 printf(
" MAXIMUM ABSOLUTE VALUES OF COEFFICIENTS \n");
2142 for (i = 0; i < mm1; ++i) printf(
"%16.8f",com[i]);
2145 for (
n = 10;
n <= 100;
n += 10) {
2149 for (i = 0; i < nm1; i += 2) {
2159 printf(
"\n-N = %3d M =%2d\n",
n,
m);
2161 for (i = 0; i <
n; ++i)
2163 a[i+600],
a[i+800],
a[i+1000]);
2165 for (i = 0; i < mm1; ++i)
2166 diff[i] = com[i] = 0;
2167 for (k = 0; k <
n; ++k) {
2168 for (i = 0; i <
mm; ++i)
2171 printf(
" ---------------------------------------%3d --------------------------------------------\n",k+1);
2172 printf(
"%12.8f\n",
x[k]);
2173 if (k ==
n-1) printf(
"%16.8f\n",
c[0]);
2175 if (k ==
n-1)
break;
2177 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
2180 for (i = 0; i < mm1; ++i)
2184 for (i = 1; i <
mm; ++i)
2185 for (jj = i; jj <
mm; ++jj) {
2187 c[j-2] =
c[j-1]*z+
c[j-2];
2190 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
2193 for (i = 0; i < mm1; ++i)
2194 if (!(k >=
n-2 && i != 0))
2196 > diff[i]) diff[i] = z;
2198 printf(
" MAXIMUM ABSOLUTE VALUES OF DIFFERENCES \n");
2199 for (i = 0; i < mm1; ++i) printf(
"%18.9E",diff[i]);
2201 printf(
" MAXIMUM ABSOLUTE VALUES OF COEFFICIENTS \n");
2204 for (i = 0; i < mm1; ++i) printf(
"%16.8E",com[i]);
2209 printf(
"1 TEST OF TSpline5 WITH NONEQUIDISTANT DOUBLE KNOTS\n");
2235 printf(
"-N = %3d M =%2d\n",
n,
m);
2237 for (i = 0; i < nn; ++i)
2239 a[i+600],
a[i+800],
a[i+1000]);
2241 for (i = 0; i < mm1; ++i)
2242 diff[i] = com[i] = 0;
2243 for (k = 0; k < nn; ++k) {
2244 for (i = 0; i <
mm; ++i)
2246 printf(
" ---------------------------------------%3d --------------------------------------------\n",k+1);
2247 printf(
"%12.8f\n",
x[k]);
2249 printf(
"%16.8f\n",
c[0]);
2252 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
2254 for (i = 0; i < mm1; ++i)
2255 if ((z=
TMath::Abs(
a[k+i*200])) > com[i]) com[i] = z;
2257 for (i = 1; i <
mm; ++i)
2258 for (jj = i; jj <
mm; ++jj) {
2260 c[j-2] =
c[j-1]*z+
c[j-2];
2262 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
2264 for (i = 0; i < mm1; ++i)
2265 if (!(k >= nn-2 && i != 0))
2267 > diff[i]) diff[i] = z;
2269 printf(
" MAXIMUM ABSOLUTE VALUES OF DIFFERENCES \n");
2270 for (i = 1; i <= mm1; ++i) {
2271 printf(
"%18.9E",diff[i-1]);
2276 printf(
" MAXIMUM ABSOLUTE VALUES OF COEFFICIENTS \n");
2277 for (i = 0; i < mm1; ++i) printf(
"%16.8f",com[i]);
2280 for (
n = 10;
n <= 100;
n += 10) {
2285 for (i = 0; i <
n; ++i) {
2292 printf(
"-N = %3d M =%2d\n",
n,
m);
2294 for (i = 0; i < nn; ++i)
2296 a[i+600],
a[i+800],
a[i+1000]);
2298 for (i = 0; i < mm1; ++i)
2299 diff[i] = com[i] = 0;
2300 for (k = 0; k < nn; ++k) {
2301 for (i = 0; i <
mm; ++i)
2304 printf(
" ---------------------------------------%3d --------------------------------------------\n",k+1);
2305 printf(
"%12.8f\n",
x[k]);
2306 if (k == nn-1) printf(
"%16.8f\n",
c[0]);
2308 if (k == nn-1)
break;
2310 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
2313 for (i = 0; i < mm1; ++i)
2314 if ((z=
TMath::Abs(
a[k+i*200])) > com[i]) com[i] = z;
2316 for (i = 1; i <
mm; ++i) {
2317 for (jj = i; jj <
mm; ++jj) {
2319 c[j-2] =
c[j-1]*z+
c[j-2];
2323 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
2326 for (i = 0; i < mm1; ++i)
2327 if (!(k >= nn-2 && i != 0))
2329 > diff[i]) diff[i] = z;
2331 printf(
" MAXIMUM ABSOLUTE VALUES OF DIFFERENCES \n");
2332 for (i = 0; i < mm1; ++i) printf(
"%18.9E",diff[i]);
2334 printf(
" MAXIMUM ABSOLUTE VALUES OF COEFFICIENTS \n");
2337 for (i = 0; i < mm1; ++i) printf(
"%18.9E",com[i]);
2343 printf(
"1 TEST OF TSpline5 WITH NONEQUIDISTANT KNOTS,\n");
2344 printf(
" ONE DOUBLE, ONE TRIPLE KNOT\n");
2365 printf(
"-N = %3d M =%2d\n",
n,
m);
2367 for (i = 0; i <
n; ++i)
2369 a[i+600],
a[i+800],
a[i+1000]);
2371 for (i = 0; i < mm1; ++i)
2372 diff[i] = com[i] = 0;
2373 for (k = 0; k <
n; ++k) {
2374 for (i = 0; i <
mm; ++i)
2376 printf(
" ---------------------------------------%3d --------------------------------------------\n",k+1);
2377 printf(
"%12.8f\n",
x[k]);
2379 printf(
"%16.8f\n",
c[0]);
2382 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
2384 for (i = 0; i < mm1; ++i)
2385 if ((z=
TMath::Abs(
a[k+i*200])) > com[i]) com[i] = z;
2387 for (i = 1; i <
mm; ++i)
2388 for (jj = i; jj <
mm; ++jj) {
2390 c[j-2] =
c[j-1]*z+
c[j-2];
2392 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
2394 for (i = 0; i < mm1; ++i)
2395 if (!(k >=
n-2 && i != 0))
2397 > diff[i]) diff[i] = z;
2399 printf(
" MAXIMUM ABSOLUTE VALUES OF DIFFERENCES \n");
2400 for (i = 0; i < mm1; ++i) printf(
"%18.9E",diff[i]);
2402 printf(
" MAXIMUM ABSOLUTE VALUES OF COEFFICIENTS \n");
2405 for (i = 0; i < mm1; ++i) printf(
"%16.8f",com[i]);
2410 printf(
"1 TEST OF TSpline5 WITH NONEQUIDISTANT KNOTS,\n");
2411 printf(
" TWO DOUBLE, ONE TRIPLE KNOT\n");
2436 printf(
"-N = %3d M =%2d\n",
n,
m);
2438 for (i = 0; i <
n; ++i)
2440 a[i+600],
a[i+800],
a[i+1000]);
2442 for (i = 0; i < mm1; ++i)
2443 diff[i] = com[i] = 0;
2444 for (k = 0; k <
n; ++k) {
2445 for (i = 0; i <
mm; ++i)
2447 printf(
" ---------------------------------------%3d --------------------------------------------\n",k+1);
2448 printf(
"%12.8f\n",
x[k]);
2450 printf(
"%16.8f\n",
c[0]);
2453 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
2455 for (i = 0; i < mm1; ++i)
2456 if ((z=
TMath::Abs(
a[k+i*200])) > com[i]) com[i] = z;
2458 for (i = 1; i <
mm; ++i)
2459 for (jj = i; jj <
mm; ++jj) {
2461 c[j-2] =
c[j-1]*z+
c[j-2];
2463 for (i = 0; i <
mm; ++i) printf(
"%16.8f",
c[i]);
2465 for (i = 0; i < mm1; ++i)
2466 if (!(k >=
n-2 && i != 0))
2468 > diff[i]) diff[i] = z;
2470 printf(
" MAXIMUM ABSOLUTE VALUES OF DIFFERENCES \n");
2471 for (i = 0; i < mm1; ++i) printf(
"%18.9E",diff[i]);
2473 printf(
" MAXIMUM ABSOLUTE VALUES OF COEFFICIENTS \n");
2476 for (i = 0; i < mm1; ++i) printf(
"%16.8f",com[i]);
2483void TSpline5::Streamer(
TBuffer &R__b)
2493 TSpline::Streamer(R__b);
2497 fPoly[i].Streamer(R__b);
Binding & operator=(OUT(*fun)(void))
R__EXTERN TSystem * gSystem
Fill Area Attributes class.
virtual Color_t GetFillColor() const
Return the fill area color.
virtual Style_t GetFillStyle() const
Return the fill area style.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SaveFillAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001)
Save fill attributes as C++ statement(s) on output stream out.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual Width_t GetLineWidth() const
Return the line width.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual Style_t GetLineStyle() const
Return the line style.
virtual void SaveLineAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1)
Save line attributes as C++ statement(s) on output stream out.
virtual void SaveMarkerAttributes(std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1)
Save line attributes as C++ statement(s) on output stream out.
virtual Style_t GetMarkerStyle() const
Return the marker style.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual Color_t GetMarkerColor() const
Return the marker color.
virtual Size_t GetMarkerSize() const
Return the marker size.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SetLimits(Double_t xmin, Double_t xmax)
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
A TGraph is an object made of two arrays X and Y with npoints each.
virtual void Paint(Option_t *chopt="")
Draw this graph with its current attributes.
1-D histogram with a float per channel (see TH1 documentation)}
virtual void SetDirectory(TDirectory *dir)
By default when an histogram is created, it is added to the list of histogram objects in the current ...
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
@ kLogX
X-axis in log scale.
@ kNoStats
don't draw stats box
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
virtual void Paint(Option_t *option="")
Control routine to paint any kind of histograms.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a line.
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetTitle() const
Returns title of object.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
virtual const char * GetName() const
Returns name of object.
TObject & operator=(const TObject &rhs)
TObject assignment operator.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Class to create third splines to interpolate knots Arbitrary conditions can be introduced for first a...
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
Int_t FindX(Double_t x) const
Find X.
static void Test()
Test method for TSpline5.
virtual 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...
void SetCond(const char *opt)
Check the boundary conditions.
Double_t Derivative(Double_t x) const
Derivative.
TSpline3 & operator=(const TSpline3 &)
Assignment operator.
Double_t Eval(Double_t x) const
Eval this spline at x.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set point number i.
void BuildCoeff()
Build coefficients.
void GetCoeff(Int_t i, Double_t &x, Double_t &y, Double_t &b, Double_t &c, Double_t &d)
virtual void SetPointCoeff(Int_t i, Double_t b, Double_t c, Double_t d)
Set point coefficient number i.
Class to create quintic natural splines to interpolate knots Arbitrary conditions can be introduced f...
static void Test()
Test method for TSpline5.
void GetCoeff(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 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...
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save primitive as a C++ statement(s) on output stream out.
virtual 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.
Double_t Derivative(Double_t x) const
Derivative.
Double_t Eval(Double_t x) const
Eval this spline at x.
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 BuildCoeff()
Algorithm 600, collected algorithms from acm.
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.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
Set point number i.
TSpline5 & operator=(const TSpline5 &)
Assignment operator.
Double_t Derivative(Double_t x) const
Double_t Eval(Double_t x) const
void CopyPoly(TSplinePoly3 const &other)
Utility called by the copy constructors and = operator.
TSplinePoly3 & operator=(TSplinePoly3 const &other)
Assignment operator.
void CopyPoly(TSplinePoly5 const &other)
Utility called by the copy constructors and = operator.
TSplinePoly5 & operator=(TSplinePoly5 const &other)
Assignment operator.
Double_t Derivative(Double_t x) const
Double_t Eval(Double_t x) const
Base class for TSpline knot.
void CopyPoly(TSplinePoly const &other)
Utility called by the copy constructors and = operator.
TSplinePoly & operator=(TSplinePoly const &other)
Assignment operator.
Base class for spline implementation containing the Draw/Paint methods.
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to one event.
virtual Double_t Eval(Double_t x) const =0
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
virtual void GetKnot(Int_t i, Double_t &x, Double_t &y) const =0
TSpline & operator=(const TSpline &)
Assignment operator.
virtual void Paint(Option_t *option="")
Paint this function with its current attributes.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Compute distance from point px,py to a spline.
virtual ~TSpline()
Destructor.
void ToLower()
Change string to lower-case.
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
static constexpr double s
static constexpr double mm
Short_t Max(Short_t a, Short_t b)
Int_t FloorNint(Double_t x)
constexpr Double_t E()
Base of natural log:
Short_t Min(Short_t a, Short_t b)
Double_t Log10(Double_t x)