C ALGORITHM 764, COLLECTED ALGORITHMS FROM ACM. C THIS WORK PUBLISHED IN TRANSACTIONS ON MATHEMATICAL SOFTWARE, C VOL. 23, NO. 1, March, 1997, P. 1--15. C #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # Src # Doc # This archive created: Sat Apr 19 22:37:40 1997 export PATH; PATH=/bin:$PATH if test ! -d 'Src' then mkdir 'Src' fi cd 'Src' if test ! -d 'Cubpack++' then mkdir 'Cubpack++' fi cd 'Cubpack++' if test ! -d 'Drivers' then mkdir 'Drivers' fi cd 'Drivers' if test -f 'CONTENTS' then echo shar: will not over-write existing file "'CONTENTS'" else cat << \SHAR_EOF > 'CONTENTS' What you find in the current directory -------------------------------------- CONTENTS : this file Small examples of main programs illustrating the use of different geometries. You can start playing with Cubpack++ by modifying these. ---------------------- ------------------------------ source region output ------ ------ ------ vb1.c : TRIANGLE : vb1.out vb2.c : CIRCLE : vb2.out vb3.c : PLANE_SECTOR (wedge) : vb3.out vb4.c : GENERALIZED_RECTANGLE (parabola) : vb4.out vb5.c : GENERALIZED_RECTANGLE (lemniscate) : vb5.out vb6.c : SEMI_INFINITE_STRIP : vb6.out vb7.c : SEMI_INFINITE_STRIP : vb7.out vb8.c : INFINITE_STRIP : vb8.out vb9.c : RECTANGLE : vb9.out vb10.c : TRIANGLE : vb10.out vb11.c : PLANE_SECTOR (half plane) : vb11.out vb12.c : PLANE_SECTOR (quadrant) : vb12.out vb13.c : House = TRIANGLE + RECTANGLE : vb13.out vb14.c : SEMI_INFINITE_STRIP (see vb6) : vb14.out vb15.c : House (see vb13) : vb15.out vb16.c : House (see vb13) : vb16.out vb17.c : GENERALIZED_RECTANGLE (see vb4) : vb17.out vb18.c : PLANE_SECTOR (Bivariate normal distribution) vb_hankel.c: call of Fortran function from C++, see User Manual. The output files where generated using the xlC compiler on an IBM RS6000 running AIX version 3.2.5 SHAR_EOF fi # end of overwriting check if test -f 'EXAMPLES' then echo shar: will not over-write existing file "'EXAMPLES'" else cat << \SHAR_EOF > 'EXAMPLES' Nr File Integration region -- ----- ---------------------------------- 0 interactive choice 1 vb1.c TRIANGLE 2 vb2.c CIRCLE 3 vb3.c PLANE_SECTOR (wedge) 4 vb4.c GENERALIZED_RECTANGLE (parabola) 5 vb5.c GENERALIZED_RECTANGLE (lemniscate) 6 vb6.c SEMI_INFINITE_STRIP 7 vb7.c SEMI_INFINITE_STRIP 8 vb8.c INFINITE_STRIP 9 vb9.c RECTANGLE 10 vb10.c TRIANGLE 11 vb11.c PLANE_SECTOR (half plane) 12 vb12.c PLANE_SECTOR (quadrant) 13 vb13.c House = TRIANGLE + RECTANGLE 14 vb14.c SEMI_INFINITE_STRIP (variant of vb6) 15 vb15.c House (variant of vb13) 16 vb16.c House (variant of vb13) 17 vb17.c GENERALIZED_RECTANGLE (variant of vb4) 18 vb18.c PLANE_SECTOR (Bivariate normal distribution) SHAR_EOF fi # end of overwriting check if test -f 'vb1.c' then echo shar: will not over-write existing file "'vb1.c'" else cat << \SHAR_EOF > 'vb1.c' #include #include real f(const Point& p) { real x=p.X(); return x*x; } int main() { Point p1(0,0), p2(1,1), p3(2,0); TRIANGLE T(p1,p2,p3); cout << "The integral is " << Integrate(f,T) << endl; return 0; } SHAR_EOF fi # end of overwriting check if test -f 'vb10.c' then echo shar: will not over-write existing file "'vb10.c'" else cat << \SHAR_EOF > 'vb10.c' // Example 20 from ditamo // exact value = 4/15 #include #include real f(const Point& p) { real x=p.X() , y=p.Y() ; return sqrt(1-x-y); } int main () { Point origin(0,0),p1(1,0),p2(0,1); TRIANGLE ditamo20(origin,p1,p2); EvaluationCounter count; count.Start(); cout <<"The integral is " << Integrate(f,ditamo20,0,0.5e-4,10000); cout <<" with absolute error " << ditamo20.AbsoluteError() << endl; count.Stop(); cout << count.Read() << " function evaluations were used." << endl; return 0; } SHAR_EOF fi # end of overwriting check if test -f 'vb11.c' then echo shar: will not over-write existing file "'vb11.c'" else cat << \SHAR_EOF > 'vb11.c' // This example assumes that math.h contains the function erfc. // The erfc function is only used to compute the exact value. // Problem posted in sci.math.num-analysis on 9 Feb 1995 // by N. Sukumar (E-mail: n-sukumar@nwu.edu), // Theoretical & Applied Mechanics, Northwestern U, Evanston IL 60208. // Exact value = 1/2 - (1/2) * erf (h/sqrt(2)) // where h = b / sqrt (1 + a^2) #include #include real f(const Point& p) { real x=p.X() , y=p.Y(); return exp(-(x*x+y*y)/2.0)/(2*M_PI); } int main () { real a=1,b=1,h=b/sqrt(1.0+a*a),t=h/sqrt(2.0); Point A(0,b),B(1,a+b),D=2*A-B; PLANE_SECTOR halfplane(A,B,D); EvaluationCounter count; count.Start(); cout <<"The estimated integral is " << Integrate(f,halfplane,0,0.5e-6)< 'vb12.c' // Example 34 from DITAMO // The function is rescaled such that the solution is 1. #include #include real f(const Point& p) { real x=p.X() , y=p.Y(),z , a=1.0/3.0 , b=2.0/3.0 ; if (x*y < 1e-15) return 0.0; z = x + y + 1/(x*y); if ((z > 100) || (z < -100)) { return 0.0;} else { return exp(-z) / (pow(x,b)*pow(y,a)*0.1806075059054343159);} } int main () { // Using the first constructor: Point origin(0,0),p1(1,0),p2(0,1); PLANE_SECTOR quadrant(origin,p1,p2); // Using the second constructor: // Point origin(0,0); // PLANE_SECTOR quadrant(origin,0.0, 0.0, M_PI/2); EvaluationCounter count; count.Start(); cout <<"The integral is " << Integrate(f,quadrant,0,0.5e-4); cout <<" with absolute error " << quadrant.AbsoluteError() << endl; count.Stop(); cout << count.Read() << " function evaluations were used." << endl; return 0; } SHAR_EOF fi # end of overwriting check if test -f 'vb13.c' then echo shar: will not over-write existing file "'vb13.c'" else cat << \SHAR_EOF > 'vb13.c' // Example suggested by a referee, who called this `reasonable'. // One can easily see, e.g. by substituting y=1, that this // integral involves severe difficulties such as fast oscillations // in the neighbourhood of the line x+y=2, and discontinuous derivatives. #include #include #define sqr(x) ((x)*(x)) static const real sqrt_PI = sqrt(M_PI), p35_PI = pow(M_PI,0.35e0); real f(const Point& p) { real x=p.X() , y=p.Y() ; return ( sqrt( sqr(x-sqrt_PI) + sqr(y-1) + 0.00001) + pow(pow(y-p35_PI,4) + sqr(x-1) + 0.00002,1.0/3.0) ) * sin( (x-y-sqrt_PI+p35_PI)/(sqr(x+y-2) + 0.01) ); } int main () { TRIANGLE Roof( Point(0,1), Point(2,1), Point(1,2)); RECTANGLE Walls( Point(0,0), Point(0,1), Point(2,0)); REGION_COLLECTION House = Walls + Roof; EvaluationCounter count; count.Start(); cout <<"The integral is " << Integrate(f,House,0,0.5e-1,1000000); cout <<" with absolute error " << House.AbsoluteError() << endl; count.Stop(); cout << count.Read() << " function evaluations were used." << endl; return 0; } SHAR_EOF fi # end of overwriting check if test -f 'vb14.c' then echo shar: will not over-write existing file "'vb14.c'" else cat << \SHAR_EOF > 'vb14.c' // Example 28 from ditamo #include #include real f(const Point& p) { real y=p.Y(); return 1/(y*y); } int main () { Point A(2,-1), B(1,-1); SEMI_INFINITE_STRIP langelat(A,B); real Integral_est, Error_est; Boolean Success; EvaluationCounter TikTak; TikTak.Start(); cout.setf(ios::scientific,ios::floatfield); do { Integrate(f,langelat,Integral_est,Error_est,Success,0,0.5e-7,10000); cout <<"The integral is " << Integral_est; cout <<" with estimated absolute error " << Error_est << endl; cout <<"The real error is " << Integral_est - 1 < 'vb15.c' // The `House' example with on each subregion a different integrand. #include #include real f1(const Point& p) { return ( p.X()*p.X() ); } real f2(const Point& p) { return ( p.Y()*p.Y() ); } int main () { TRIANGLE Roof( Point(0,1), Point(2,1), Point(1,2)); RECTANGLE Walls( Point(0,0), Point(0,1), Point(2,0)); REGION_COLLECTION House = Walls + Roof; Roof.LocalIntegrand(f1); Walls.LocalIntegrand(f2); EvaluationCounter count; count.Start(); cout <<"The integral is " << Integrate(House); cout <<" with estimated absolute error " << House.AbsoluteError() << endl; cout <<"The contributions of the subregions are:"< 'vb16.c' // Example suggested by a referee, who called this `reasonable'. // One can easily see, e.g. by substituting y=1, that this // integral involves severe difficulties such as fast oscillations // in the neighbourhood of the line x+y=2, and discontinuous derivatives. #include #include #define sqr(x) ((x)*(x)) static const real sqrt_PI = sqrt(M_PI), p35_PI = pow(M_PI,0.35e0); real f(const Point& p) { real x=p.X() , y=p.Y() ; return ( sqrt( sqr(x-sqrt_PI) + sqr(y-1) + 0.00001) + pow(pow(y-p35_PI,4) + sqr(x-1) + 0.00002,1.0/3.0) ) * sin( (x-y-sqrt_PI+p35_PI)/(sqr(x+y-2) + 0.01) ); } int main () { TRIANGLE T1( Point(0,0), Point(1,0), Point(0,1)), T2( Point(1,0), Point(2,0), Point(1.5,0.5)), T3( Point(2,0), Point(2,1), Point(1.5,0.5)); RECTANGLE R1( Point(1,0), Point(0,1), Point(2,1)); REGION_COLLECTION House1 = T1 + T2 + T3 + R1; RECTANGLE R3( Point(1,0), Point(0,1), Point(2,1)), R2( Point(1.8,0), Point(1.4,0.4), Point(2,0.2)); TRIANGLE T4( Point(1,0), Point(1.8,0), Point(1.4,0.4)), T7( Point(0,0), Point(1,0), Point(0,1)), T5( Point(1.8,0), Point(2,0), Point(2,0.2)), T6( Point(2,0.2), Point(2,1), Point(1.6,0.6)); REGION_COLLECTION House2 = T7 + R3 + R2 + T4 + T5 + T6; EvaluationCounter count; count.Start(); cout <<"The integral is " << Integrate(f,House1,0,0.5e-1,1000000); cout <<" with absolute error " << House1.AbsoluteError() << endl; count.Stop(); cout << count.Read() << " function evaluations were used." << endl; cout << "Contribution of the different parts:" << endl; cout << "R1: integral and error are " << R1.Integral() << " and " << R1.AbsoluteError() < 'vb17.c' // Example 23 from ditamo // The function is rescaled such that the solution is 1. #include #include real f(const Point& p) { real x=p.X() , y=p.Y(); return 0.25/sqrt(x*(2.0-x)); } real Height(const Point& p) { return sqrt(4-2*p.X()); } int main () { real Integral_est, Error_est; Boolean Success; Point A(0,0), B(2,0); GENERALIZED_RECTANGLE parabola(Height,A,B); do { Integrate(f,parabola,Integral_est,Error_est,Success,0,0.5e-1,10000); cout <<"The integral is " << Integral_est < 'vb18.c' // Bivariate normal distribution // Note that special purpose methods exist for this type of integral. #include #include // The integral depends on the following 3 parameters: real rho, a, b; real N; // This is used to save work real f(const Point& p) { real x=p.X() , y=p.Y(); return exp(N*(-x*x+2*rho*x*y-y*y)) ; } int main () { EvaluationCounter count; real c; // Read the 3 parameters from standard input: cout << "Give a,b and rho ( |rho| < 1 ): "; cin >> a >> b >> rho; // Define the region of integration: Point Center(a,b); PLANE_SECTOR quadrant(Center,0.0, M_PI , 3*M_PI/2); c = 1.0/(2.0*M_PI*sqrt(1.0 - rho*rho)); N = 1.0/(2.0 - 2.0*rho*rho); count.Start(); cout <<"The integral is " << Integrate(f,quadrant,0,0.5e-6)*c; cout <<" with absolute error " << quadrant.AbsoluteError()*c << endl; count.Stop(); cout << count.Read() << " function evaluations were used." << endl; return 0; } SHAR_EOF fi # end of overwriting check if test -f 'vb2.c' then echo shar: will not over-write existing file "'vb2.c'" else cat << \SHAR_EOF > 'vb2.c' #include #include real f(const Point& p) { real r=p.Length(); return 1.0/(1.0+r*r*r*r); } int main () { Point origin(0,0); real radius=1; CIRCLE cir(origin,radius); cout <<"The integral is " << Integrate(f, cir, 0, 1.0e-6, 10000); cout <<" with absolute error " << cir.AbsoluteError() << endl; return 0; } SHAR_EOF fi # end of overwriting check if test -f 'vb3.c' then echo shar: will not over-write existing file "'vb3.c'" else cat << \SHAR_EOF > 'vb3.c' // Example 33 from ditamo // Exact value = arctan(2) // Note that the "exact" value in the original paper is wrong. #include #include #include real f(const Point& p) { real x=p.X() , y=p.Y(); return exp(0.5*(-x*x -y*y)); } int main () { Point origin(0,0); real innerradius=0, alfa=0, beta=atan(2.0); PLANE_SECTOR wedge(origin,innerradius,alfa,beta); EvaluationCounter count; cout.setf(ios::scientific,ios::floatfield); cout<<"req. rel. error est integral est error abs error evaluations" <1e-12; req_err/=10) { cout << setprecision(1) << " <" << req_err <<" " << setprecision(10) << Integrate(f,wedge,0,req_err) << " "; cout << setprecision(1) << wedge.AbsoluteError() << " " << fabs(wedge.Integral() - atan(2.0)) << " " << count.Read() << endl; } count.Stop(); return 0; } SHAR_EOF fi # end of overwriting check if test -f 'vb4.c' then echo shar: will not over-write existing file "'vb4.c'" else cat << \SHAR_EOF > 'vb4.c' // Example 23 from ditamo // The function is rescaled such that the solution is 1. #include #include real f(const Point& p) { real x=p.X() , y=p.Y(); return 0.25/sqrt(x*(2.0-x)); } real Height(const Point& p) { return sqrt(4-2*p.X()); } int main () { Point A(0,0), B(2,0); GENERALIZED_RECTANGLE parabola(Height,A,B); Chrono TikTak; TikTak.Start(); cout <<"The integral is " << Integrate(f,parabola,0,0.5e-4); TikTak.Stop(); cout <<" with absolute error " << parabola.AbsoluteError() << endl; cout <<"Elapsed Time: " << TikTak.Read()/1000<<" seconds" << endl; return 0; } SHAR_EOF fi # end of overwriting check if test -f 'vb5.c' then echo shar: will not over-write existing file "'vb5.c'" else cat << \SHAR_EOF > 'vb5.c' // Example 5 from ditamo #include #include real f(const Point& p) { real x=p.X() , y=p.Y(); return p.Y(); } real Height(const Point& p) { real x=p.X(); return sqrt(4*cos(x)*cos(x)/9 - 16*sin(x)*sin(x)/25); } int main () { Point A(0,0), B(atan(5.0/6.0),0); GENERALIZED_RECTANGLE lemniscate(Height,A,B); EvaluationCounter TikTak; TikTak.Start(); // cout.setf(ios::left,ios::adjustfield); cout.setf(ios::scientific,ios::floatfield); cout <<"The integral is " << Integrate(f,lemniscate,0,0.5e-7,10000); cout <<" with estimated absolute error " << lemniscate.AbsoluteError() << endl; cout <<"The real error is " << lemniscate.Integral() - (2-11*atan(5.0/6.0)/15)/15 < 'vb6.c' // Example 28 from ditamo #include #include real f(const Point& p) { real y=p.Y(); return 1/(y*y); } int main () { Point A(2,-1), B(1,-1); SEMI_INFINITE_STRIP langelat(A,B); EvaluationCounter TikTak; TikTak.Start(); // cout.setf(ios::left,ios::adjustfield); cout.setf(ios::scientific,ios::floatfield); cout <<"The integral is " << Integrate(f,langelat,0,0.5e-7,20000); cout <<" with estimated absolute error " << langelat.AbsoluteError() << endl; cout <<"The real error is " << langelat.Integral() - 1 < 'vb7.c' // Example 29 from ditamo #include #include real f(const Point& p) { return fabs(p.Y())*exp(-p.Y()*p.Y()/2); } int main () { Point A(0,0), B(1.107148717794090503,0); SEMI_INFINITE_STRIP langelat(A,B); EvaluationCounter TikTak; TikTak.Start(); // cout.setf(ios::left,ios::adjustfield); cout.setf(ios::scientific,ios::floatfield); cout <<"The integral is " << Integrate(f,langelat,0,0.5e-4,10000); cout <<" with estimated absolute error " << langelat.AbsoluteError() << endl; TikTak.Stop(); cout<<"Number of evaluations = "< 'vb8.c' // Example #include #include #include real f(const Point& p) { return exp(-p.Y()*p.Y()); } int main () { Point A(0,0), B(1,0); INFINITE_STRIP langelat(A,B); EvaluationCounter TikTak; TikTak.Start(); // cout.setf(ios::left,ios::adjustfield); cout.setf(ios::scientific,ios::floatfield); cout <<"The integral is " << Integrate(f,langelat,0,0.5e-3,10000); cout <<" with estimated absolute error " << langelat.AbsoluteError() << endl; cout <<"The real error is " << langelat.Integral() - sqrt(M_PI) < 'vb9.c' // This example comes from Problem 94-7 by D.E. Loper // Siam Review, Vol. 36 (1994) page 277 #include #include #include static real q; real A(const Point& p) { real m=p.X() , f=p.Y(); real t=(1-m*m)*(1-m*m), s = sin(f); s = s*s; return (t*s)/(t*s*s+q*q*m*m); } real B(const Point& p) { real m=p.X() , f=p.Y(); real t=(1-m*m), s = sin(f); s = s*s; return (t*s*(t*s+m*m))/(t*t*s*s+q*q*m*m); } int main () { Point Origin(0,0), mu(1,0),phi(0,M_PI/2); cout<<"q A(q) B(q) A(q)/B(q)"< 'vb_hankel.c' #include #include extern "C" {void zbesh_ (real&, real&, real&, int&, int&, int&, real[], real[], int&, int&);} real AbsHankel1 ( const Point& z) { real x=z.X(), y=z.Y(), cr[10], ci[10], fnu=0; int kode=1, m=1, n=1, nz, ierr; zbesh_(x,y,fnu,kode,m,n,cr,ci,nz,ierr); return sqrt(cr[0]*cr[0]+ci[0]*ci[0]); } real AbsHankel2 ( const Point& z) { real x=(z.X()*0.8+z.Y()*0.6), y=(0.8*z.Y()-z.X()*0.6), cr[10], ci[10], fnu=0; int kode=1, m=1, n=1, nz, ierr; zbesh_(x,y,fnu,kode,m,n,cr,ci,nz,ierr); return sqrt(cr[0]*cr[0]+ci[0]*ci[0]); } int main() { Point O(0,0), A(-1,0),B(-0.8,-0.6); EvaluationCounter count; cout << " Omega = 1"< 'vb1.out' The integral is 1.16667 SHAR_EOF fi # end of overwriting check if test -f 'vb10.out' then echo shar: will not over-write existing file "'vb10.out'" else cat << \SHAR_EOF > 'vb10.out' The integral is 0.266677 with absolute error 1.16825e-05 925 function evaluations were used. SHAR_EOF fi # end of overwriting check if test -f 'vb11.out' then echo shar: will not over-write existing file "'vb11.out'" else cat << \SHAR_EOF > 'vb11.out' The estimated integral is 0.23975 The exact value is 0.23975 17620 function evaluations were used. SHAR_EOF fi # end of overwriting check if test -f 'vb12.out' then echo shar: will not over-write existing file "'vb12.out'" else cat << \SHAR_EOF > 'vb12.out' The integral is 1 with absolute error 4.27146e-05 5091 function evaluations were used. SHAR_EOF fi # end of overwriting check if test -f 'vb13.out' then echo shar: will not over-write existing file "'vb13.out'" else cat << \SHAR_EOF > 'vb13.out' The integral is -0.40791 with absolute error 0.0203924 266548 function evaluations were used. SHAR_EOF fi # end of overwriting check if test -f 'vb14.out' then echo shar: will not over-write existing file "'vb14.out'" else cat << \SHAR_EOF > 'vb14.out' The integral is 1.000000e+00 with estimated absolute error 3.035122e-05 The real error is 1.779739e-07 ------------------------------------------------- The integral is 1.000000e+00 with estimated absolute error 4.073745e-07 The real error is 5.862995e-10 ------------------------------------------------- The integral is 1.000000e+00 with estimated absolute error 6.832923e-08 The real error is 2.741229e-11 ------------------------------------------------- The integral is 1.000000e+00 with estimated absolute error 4.986300e-08 The real error is 2.816547e-11 ------------------------------------------------- Total number of evaluations = 32067 SHAR_EOF fi # end of overwriting check if test -f 'vb15.out' then echo shar: will not over-write existing file "'vb15.out'" else cat << \SHAR_EOF > 'vb15.out' The integral is 1.83333 with estimated absolute error 2.03541e-14 The contributions of the subregions are: Walls: integral = 0.666667, error = 7.40149e-15 Roof: integral = 1.16667, error = 1.29526e-14 The exact value is 2/3 + 7/6 = 11/6 74 function evaluations were used. SHAR_EOF fi # end of overwriting check if test -f 'vb16.out' then echo shar: will not over-write existing file "'vb16.out'" else cat << \SHAR_EOF > 'vb16.out' The integral is -0.407393 with absolute error 0.0203507 105968 function evaluations were used. Contribution of the different parts: R1: integral and error are -0.283031 and 0.00816722 T1: integral and error are -0.221416 and 1.09496e-06 T2: integral and error are 0.068406 and 0.0055473 T3: integral and error are 0.0286485 and 0.00663513 The integral is -0.407853 with absolute error 0.0203784 94572 function evaluations were used. SHAR_EOF fi # end of overwriting check if test -f 'vb17.out' then echo shar: will not over-write existing file "'vb17.out'" else cat << \SHAR_EOF > 'vb17.out' The integral is 0.996521 with estimated absolute error 0.151082 ------------------------------------------------- The integral is 0.997535 with estimated absolute error 0.107081 ------------------------------------------------- The integral is 0.997926 with estimated absolute error 0.0900689 ------------------------------------------------- The integral is 0.998255 with estimated absolute error 0.0758062 ------------------------------------------------- The integral is 0.998393 with estimated absolute error 0.0697915 ------------------------------------------------- The integral is 0.998532 with estimated absolute error 0.0637768 ------------------------------------------------- The integral is 0.99867 with estimated absolute error 0.0577621 ------------------------------------------------- The integral is 0.998765 with estimated absolute error 0.0536343 ------------------------------------------------- The integral is 0.998814 with estimated absolute error 0.0515078 ------------------------------------------------- The integral is 0.998851 with estimated absolute error 0.0499129 ------------------------------------------------- SHAR_EOF fi # end of overwriting check if test -f 'vb18.out' then echo shar: will not over-write existing file "'vb18.out'" else cat << \SHAR_EOF > 'vb18.out' Give a,b and rho ( |rho| < 1 ): 1.0 1.0 0.5 The integral is 0.745204 with absolute error 3.68313e-07 17194 function evaluations were used. SHAR_EOF fi # end of overwriting check if test -f 'vb2.out' then echo shar: will not over-write existing file "'vb2.out'" else cat << \SHAR_EOF > 'vb2.out' The integral is 2.4674 with absolute error 5.77166e-08 SHAR_EOF fi # end of overwriting check if test -f 'vb3.out' then echo shar: will not over-write existing file "'vb3.out'" else cat << \SHAR_EOF > 'vb3.out' req. rel. error est integral est error abs error evaluations <5.0e-02 1.1096504402e+00 3.4e-02 2.5e-03 292 <5.0e-03 1.1071935478e+00 4.1e-03 4.5e-05 1181 <5.0e-04 1.1071470438e+00 5.1e-04 1.7e-06 3105 <5.0e-05 1.1071488562e+00 5.3e-05 1.4e-07 5657 <5.0e-06 1.1071486939e+00 5.3e-06 2.4e-08 11239 <5.0e-07 1.1071487183e+00 5.3e-07 5.5e-10 16377 <5.0e-08 1.1071487178e+00 5.5e-08 1.0e-12 25553 <5.0e-09 1.1071487178e+00 5.5e-09 1.1e-11 38577 <5.0e-10 1.1071487178e+00 5.4e-10 5.2e-13 53081 <5.0e-11 1.1071487178e+00 5.5e-11 2.6e-13 73949 <5.0e-12 1.1071487178e+00 5.5e-12 1.8e-15 117794 SHAR_EOF fi # end of overwriting check if test -f 'vb4.out' then echo shar: will not over-write existing file "'vb4.out'" else cat << \SHAR_EOF > 'vb4.out' The integral is 0.99886 with absolute error 0.0495064 Elapsed Time: 0 seconds SHAR_EOF fi # end of overwriting check if test -f 'vb5.out' then echo shar: will not over-write existing file "'vb5.out'" else cat << \SHAR_EOF > 'vb5.out' The integral is 9.936835e-02 with estimated absolute error 7.230197e-14 The real error is 1.387779e-17 Number of evaluations = 37 SHAR_EOF fi # end of overwriting check if test -f 'vb6.out' then echo shar: will not over-write existing file "'vb6.out'" else cat << \SHAR_EOF > 'vb6.out' The integral is 1.000000e+00 with estimated absolute error 4.173926e-07 The real error is 5.863554e-10 Number of evaluations = 20079 SHAR_EOF fi # end of overwriting check if test -f 'vb7.out' then echo shar: will not over-write existing file "'vb7.out'" else cat << \SHAR_EOF > 'vb7.out' The integral is 1.107149e+00 with estimated absolute error 5.263967e-05 Number of evaluations = 5657 SHAR_EOF fi # end of overwriting check if test -f 'vb8.out' then echo shar: will not over-write existing file "'vb8.out'" else cat << \SHAR_EOF > 'vb8.out' The integral is 1.772455e+00 with estimated absolute error 6.976425e-04 The real error is 1.067348e-06 Number of evaluations = 1183 SHAR_EOF fi # end of overwriting check if test -f 'vb9.out' then echo shar: will not over-write existing file "'vb9.out'" else cat << \SHAR_EOF > 'vb9.out' q A(q) B(q) A(q)/B(q) 1 1.513682 0.7568409 2 2 0.9107223 0.4553611 2 3 0.6587322 0.3293661 2 4 0.5176153 0.2588077 2 5 0.4268288 0.2134144 2 6 0.3633539 0.181677 2 7 0.3164155 0.1582078 2 8 0.2802695 0.1401347 2 9 0.2515646 0.1257823 2 10 0.2282109 0.1141055 2 11 0.2088359 0.104418 2 12 0.1925005 0.09625026 2 13 0.1785401 0.08927006 2 14 0.166471 0.08323551 2 15 0.1559327 0.07796635 2 16 0.1466509 0.07332547 2 17 0.1384134 0.06920668 2 18 0.131053 0.06552649 2 19 0.1244366 0.06221831 2 SHAR_EOF fi # end of overwriting check cd .. if test ! -d 'Documentation' then mkdir 'Documentation' fi cd 'Documentation' if test -f 'CONTENTS' then echo shar: will not over-write existing file "'CONTENTS'" else cat << \SHAR_EOF > 'CONTENTS' What you find in the current directory -------------------------------------- CONTENTS : this file COMPILERS : overview of compilers used to test Cubpack++ MACHINE_DEPEND : list of machine dependable source files paper.dvi : copy of submitted paper in dvi format paper.ps : copy of submitted paper in Postscript format userman.dvi : copy of User Manual in dvi format userman.ps : copy of User Manual in Postscript format SHAR_EOF fi # end of overwriting check if test -f 'COMPILERS' then echo shar: will not over-write existing file "'COMPILERS'" else cat << \SHAR_EOF > 'COMPILERS' Systems for which Cubpack++ has proven it works =============================================== Compiler Version Operating System Machine type -------------------------------------------------------------- g++/gcc 2.5.8 Ultrix 4.4 DECstation 5000 SunOS 5.3 Sparcenter 1000 Linux 1.0 i586 2.6.0 HP-UX 2.6.2 SunOS 5.3 Sparcenter 1000 2.6.3* MSDOS 2.7.2 Ultrix 4.4 DECstation 5000 Solaris2.3 Sparcenter 1000 -------------------------------------------------------------- xlC AIX Version 3.2 IBM RS6000 -------------------------------------------------------------- cxx OSF/1 V1.3 DECalpha -------------------------------------------------------------- CC SC3.0.1 SunOS 5.3 Sparcenter 1000 -------------------------------------------------------------- Borland C++ 4.0 Windows -------------------------------------------------------------- Turbo C++ 3.0 MSDOS 5.0 386SX -------------------------------------------------------------- *) DJGPP 1.12m4 Systems for which a workaround is provided ========================================== Compiler Version Operating System Machine type -------------------------------------------------------------- CC SC3.0 SunOS 5.3 Sparcenter 1000 (15 Dec 1993) Workaround activated with compiler option -DSOLARIS Note that this bug was removed from CC in version SC3.0.1. -------------------------------------------------------------- Systems for which Cubpack++ is too complex ========================================== Compiler Version Operating System Machine type -------------------------------------------------------------- CC SC2.0.1 SunOS 4. Sun4 -------------------------------------------------------------- The answer from vendors to these problems is: upgrade. SHAR_EOF fi # end of overwriting check if test -f 'MACHINE_DEPEND' then echo shar: will not over-write existing file "'MACHINE_DEPEND'" else cat << \SHAR_EOF > 'MACHINE_DEPEND' MACHINE DEPENDENT FILES: ------------------------ chrono.c real.h templist.h -> For details we refer to the User Manual, section 11. Users might need to change these. deccxxtp.c -> This file is only used by the cxx compiler on DECalpha OSF/1 V1.3 Users should not change this. gnu262tp.c -> This file is only used by the gnu compiler version at least 2.6.2 Users should not change this. SHAR_EOF fi # end of overwriting check cd .. if test ! -d 'Tools' then mkdir 'Tools' fi cd 'Tools' if test -f 'CONTENTS' then echo shar: will not over-write existing file "'CONTENTS'" else cat << \SHAR_EOF > 'CONTENTS' What you find in the current directory -------------------------------------- CONTENTS : this file c2C : change from suffix .c to .C c2cpp : change from suffix .c to .cpp The following makefile-s are used by quick_install and quick_run. mkfile.decalpha : makefile for cxx compiler on DECalpha OSF mkfile.gn1 : makefile for gnu compiler at most v2.6.0 mkfile.gn2 : makefile for gnu compiler v2.6.2 mkfile.gn3 : makefile for gnu compiler v2.7.0 mkfile.rs6000 : makefile for xlC compiler on RS6000 AIX mkfile.solaris : makefile for CC compiler on Solaris 2.* mkfile.tc : makefile for Turbo C++ under MS-DOS The following Makefile-s are models which can be modified by users. Mk.decalpha : makefile for cxx compiler on DECalpha OSF Mk.gn1 : makefile for gnu compiler at most v2.6.0 Mk.gn2 : makefile for gnu compiler v2.6.2 Mk.gn3 : makefile for gnu compiler v2.7.0 Mk.solaris : makefile for CC compiler on Solaris 2.* Mk.tc : makefile for Turbo C++ under MS-DOS SHAR_EOF fi # end of overwriting check if test -f 'c2C' then echo shar: will not over-write existing file "'c2C'" else cat << \SHAR_EOF > 'c2C' #!/bin/sh SRC_DIR=Src cd ../$SRC_DIR for i in s_adapt.h set.h stack.h vector.h vstack.h heap.h atomic.h div.h passbuck.h pointer.h regproc.h rule.h samediv.h userint.h do cat $i | sed 's/\.c>/.C>/' > tmp mv tmp $i done # for i in `ls *.c` do a=`echo $i | sed "s/\.c$/.C/"` mv $i $a done SHAR_EOF chmod +x 'c2C' fi # end of overwriting check if test -f 'c2cpp' then echo shar: will not over-write existing file "'c2cpp'" else cat << \SHAR_EOF > 'c2cpp' #!/bin/sh SRC_DIR=Src cd ../$SRC_DIR for i in s_adapt.h set.h stack.h vector.h vstack.h heap.h atomic.h div.h passbuck.h pointer.h regproc.h rule.h samediv.h userint.h do cat $i | sed 's/\.c>/.cpp>/' > tmp mv tmp $i done # for i in `ls *.c` do a=`echo $i | sed "s/\.c$/.cpp/"` mv $i $a done SHAR_EOF chmod +x 'c2cpp' fi # end of overwriting check if test -f 'mkfile.decalpha' then echo shar: will not over-write existing file "'mkfile.decalpha'" else cat << \SHAR_EOF > 'mkfile.decalpha' .SUFFIXES: .o .C .C.o: ; $(CC) $(CFLAGS) -c $*.C CC = cxx CFLAGS = -I. libdir = -L. libs = -lcubpack -lm MYTESTPROG = main.o OBJS = \ deccxxtp.o \ point2D.o \ C2.o \ C2dv2.o \ C2dv4.o \ C2interf.o \ C2prc.o \ C2rule13.o \ C2toS2.o \ C2togr.o \ E2tostrp.o \ E2.o \ E2adapt.o \ E2interf.o \ E2sec.o \ E2secitf.o \ E2secprc.o \ S2.o \ S2adapt.o \ S2interf.o \ S2rule13.o \ T2.o \ T2dv4.o \ T2interf.o \ T2rule13.o \ T2tops.o \ atomreg.o \ boolean.o \ chrono.o \ compreg.o \ eval_ctr.o \ geometry.o \ gr.o \ gritf.o \ gs.o \ gsitf.o \ gsprc.o \ integran.o \ integrat.o \ invert.o \ outS2.o \ outS2itf.o \ polC2.o \ polC2itf.o \ polC2prc.o \ ps.o \ psitf.o \ refcount.o \ regcoll.o \ reginfo.o \ region.o \ semstitf.o \ semistrp.o \ sttosmst.o \ strip.o \ stripitf.o \ translat.o \ trnsfrm.o all:: libcubpack.a libcubpack.a: $(OBJS) ar rus libcubpack.a $(OBJS) tst: $(MYTESTPROG) $(CC) $(MYTESTPROG) $(libdir) $(libs) -o tst clean: /bin/rm -f *.o tst core SHAR_EOF fi # end of overwriting check if test -f 'mkfile.gn1' then echo shar: will not over-write existing file "'mkfile.gn1'" else cat << \SHAR_EOF > 'mkfile.gn1' CC = gcc CFLAGS = -x c++ -I. # COPTIONS = -DEGTRUSAGE COPTIONS = libdir = -L. libs = -lcubpack -lm -lg++ MYTESTPROG = main.o .c.o: ; $(CC) $(CFLAGS) -c $*.c chrono.o: chrono.c $(CC) $(CFLAGS) $(COPTIONS) -c chrono.c OBJS = \ point2D.o \ C2.o \ C2dv2.o \ C2dv4.o \ C2interf.o \ C2prc.o \ C2rule13.o \ C2toS2.o \ C2togr.o \ E2tostrp.o \ E2.o \ E2adapt.o \ E2interf.o \ E2sec.o \ E2secitf.o \ E2secprc.o \ S2.o \ S2adapt.o \ S2interf.o \ S2rule13.o \ T2.o \ T2dv4.o \ T2interf.o \ T2rule13.o \ T2tops.o \ atomreg.o \ boolean.o \ chrono.o \ compreg.o \ eval_ctr.o \ geometry.o \ gr.o \ gritf.o \ gs.o \ gsitf.o \ gsprc.o \ integran.o \ integrat.o \ invert.o \ outS2.o \ outS2itf.o \ polC2.o \ polC2itf.o \ polC2prc.o \ ps.o \ psitf.o \ refcount.o \ regcoll.o \ reginfo.o \ region.o \ semstitf.o \ semistrp.o \ sttosmst.o \ strip.o \ stripitf.o \ translat.o \ trnsfrm.o all:: libcubpack.a libcubpack.a: $(OBJS) ar ru libcubpack.a $(OBJS) ranlib libcubpack.a tst: $(MYTESTPROG) $(CC) $(MYTESTPROG) $(libdir) $(libs) -o tst clean: /bin/rm -f *.o tst core SHAR_EOF fi # end of overwriting check if test -f 'mkfile.gn2' then echo shar: will not over-write existing file "'mkfile.gn2'" else cat << \SHAR_EOF > 'mkfile.gn2' CC = gcc CFLAGS = -x c++ -I. -fno-implicit-templates # COPTIONS = -DEGTRUSAGE COPTIONS = libdir = -L. libs = -lcubpack -lm -lg++ MYTESTPROG = main.o .c.o: ; $(CC) $(CFLAGS) -c $*.c chrono.o: chrono.c $(CC) $(CFLAGS) $(COPTIONS) -c chrono.c OBJS = \ point2D.o \ C2.o \ C2dv2.o \ C2dv4.o \ C2interf.o \ C2prc.o \ C2rule13.o \ C2toS2.o \ C2togr.o \ E2tostrp.o \ E2.o \ E2adapt.o \ E2interf.o \ E2sec.o \ E2secitf.o \ E2secprc.o \ S2.o \ S2adapt.o \ S2interf.o \ S2rule13.o \ T2.o \ T2dv4.o \ T2interf.o \ T2rule13.o \ T2tops.o \ atomreg.o \ boolean.o \ chrono.o \ compreg.o \ eval_ctr.o \ geometry.o \ gr.o \ gritf.o \ gs.o \ gsitf.o \ gsprc.o \ integran.o \ integrat.o \ invert.o \ outS2.o \ outS2itf.o \ polC2.o \ polC2itf.o \ polC2prc.o \ ps.o \ psitf.o \ refcount.o \ regcoll.o \ reginfo.o \ region.o \ semstitf.o \ semistrp.o \ sttosmst.o \ strip.o \ stripitf.o \ translat.o \ trnsfrm.o \ gnu262tp.o all:: libcubpack.a libcubpack.a: $(OBJS) ar rus libcubpack.a $(OBJS) tst: $(MYTESTPROG) $(CC) $(MYTESTPROG) $(libdir) $(libs) -o tst clean: /bin/rm -f *.o tst core SHAR_EOF fi # end of overwriting check if test -f 'mkfile.gn3' then echo shar: will not over-write existing file "'mkfile.gn3'" else cat << \SHAR_EOF > 'mkfile.gn3' CC = g++ CFLAGS = -I. -fno-implicit-templates # COPTIONS = -DEGTRUSAGE COPTIONS = libdir = -L. libs = -lcubpack -lm MYTESTPROG = main.o .c.o: ; $(CC) $(CFLAGS) -c $*.c chrono.o: chrono.c $(CC) $(CFLAGS) $(COPTIONS) -c chrono.c OBJS = \ point2D.o \ C2.o \ C2dv2.o \ C2dv4.o \ C2interf.o \ C2prc.o \ C2rule13.o \ C2toS2.o \ C2togr.o \ E2tostrp.o \ E2.o \ E2adapt.o \ E2interf.o \ E2sec.o \ E2secitf.o \ E2secprc.o \ S2.o \ S2adapt.o \ S2interf.o \ S2rule13.o \ T2.o \ T2dv4.o \ T2interf.o \ T2rule13.o \ T2tops.o \ atomreg.o \ boolean.o \ chrono.o \ compreg.o \ eval_ctr.o \ geometry.o \ gr.o \ gritf.o \ gs.o \ gsitf.o \ gsprc.o \ integran.o \ integrat.o \ invert.o \ outS2.o \ outS2itf.o \ polC2.o \ polC2itf.o \ polC2prc.o \ ps.o \ psitf.o \ refcount.o \ regcoll.o \ reginfo.o \ region.o \ semstitf.o \ semistrp.o \ sttosmst.o \ strip.o \ stripitf.o \ translat.o \ trnsfrm.o \ gnu262tp.o all:: libcubpack.a libcubpack.a: $(OBJS) ar rus libcubpack.a $(OBJS) tst: $(MYTESTPROG) $(CC) $(MYTESTPROG) $(libdir) $(libs) -o tst clean: /bin/rm -f *.o tst core SHAR_EOF fi # end of overwriting check if test -f 'mkfile.rs6000' then echo shar: will not over-write existing file "'mkfile.rs6000'" else cat << \SHAR_EOF > 'mkfile.rs6000' CC = xlC -+ #CFLAGS = -O CFLAGS = -I. libdir = libs = -lm MYTESTPROG = main.o .c.o: ; $(CC) $(CFLAGS) -c $*.c OBJS = \ point2D.o \ C2.o \ C2dv2.o \ C2dv4.o \ C2interf.o \ C2prc.o \ C2rule13.o \ C2toS2.o \ C2togr.o \ E2tostrp.o \ E2.o \ E2adapt.o \ E2interf.o \ E2sec.o \ E2secitf.o \ E2secprc.o \ S2.o \ S2adapt.o \ S2interf.o \ S2rule13.o \ T2.o \ T2dv4.o \ T2interf.o \ T2rule13.o \ T2tops.o \ atomreg.o \ boolean.o \ chrono.o \ compreg.o \ eval_ctr.o \ geometry.o \ gr.o \ gritf.o \ gs.o \ gsitf.o \ gsprc.o \ integran.o \ integrat.o \ invert.o \ outS2.o \ outS2itf.o \ polC2.o \ polC2itf.o \ polC2prc.o \ ps.o \ psitf.o \ refcount.o \ regcoll.o \ reginfo.o \ region.o \ semstitf.o \ semistrp.o \ sttosmst.o \ strip.o \ stripitf.o \ translat.o \ trnsfrm.o all:: $(OBJS) tst: $(MYTESTPROG) $(CC) $(CFLAGS) $(MYTESTPROG) $(OBJS) $(libdir) $(libs) -o tst clean: /bin/rm -f *.o run tst core SHAR_EOF fi # end of overwriting check if test -f 'mkfile.solaris' then echo shar: will not over-write existing file "'mkfile.solaris'" else cat << \SHAR_EOF > 'mkfile.solaris' CC = CC # If you have CC version SC3.0 of 15 Dec 1993, then use the following # to activated the workaround # CFLAGS = -I. -DSOLARIS # If you have CC version SC3.0.1 of 13 Jul 1994, then use CFLAGS = -I. libdir = -L. libs = -lcubpack -lm MYTESTPROG = main.o .c.o: ; $(CC) $(CFLAGS) -c $*.c OBJS = \ point2D.o \ C2.o \ C2dv2.o \ C2dv4.o \ C2interf.o \ C2prc.o \ C2rule13.o \ C2toS2.o \ C2togr.o \ E2tostrp.o \ E2.o \ E2adapt.o \ E2interf.o \ E2sec.o \ E2secitf.o \ E2secprc.o \ S2.o \ S2adapt.o \ S2interf.o \ S2rule13.o \ T2.o \ T2dv4.o \ T2interf.o \ T2rule13.o \ T2tops.o \ atomreg.o \ boolean.o \ chrono.o \ compreg.o \ eval_ctr.o \ geometry.o \ gr.o \ gritf.o \ gs.o \ gsitf.o \ gsprc.o \ integran.o \ integrat.o \ invert.o \ outS2.o \ outS2itf.o \ polC2.o \ polC2itf.o \ polC2prc.o \ ps.o \ psitf.o \ refcount.o \ regcoll.o \ reginfo.o \ region.o \ semstitf.o \ semistrp.o \ sttosmst.o \ strip.o \ stripitf.o \ translat.o \ trnsfrm.o all:: libcubpack.a libcubpack.a: $(OBJS) $(CC) -xar -o libcubpack.a $(OBJS) tst: $(MYTESTPROG) $(CC) $(MYTESTPROG) $(libdir) $(libs) -o tst clean: /bin/rm -f *.o run tst core /bin/rm -r -f Templates.DB SHAR_EOF fi # end of overwriting check if test -f 'mkfile.tc' then echo shar: will not over-write existing file "'mkfile.tc'" else cat << \SHAR_EOF > 'mkfile.tc' # Makefile for Cubpack++ installation using Turbo C++ under MS-DOS # File suffixes C = .c # C++ code H = .h # C++ header O = .obj # Compiled code X = .exe # Executable # File delete utility RM = del # Compiler name and flags CC = tcc # Must be 3.0 or later CFLAGS = -v -P -I. -ml # This combination works. Many others don't. # COPTIONS = -DEGTRUSAGE COPTIONS = MYTESTPROG = main$(O) $(C)$(O): $(CC) $(CFLAGS) -c $*$(C) chrono$(O): chrono$(C) $(CC) $(CFLAGS) $(COPTIONS) -c chrono$(C) main$(O): main$(C) $(CC) $(CFLAGS) -c main$(C) OBJS = \ point2D$(O) \ C2$(O) \ C2dv2$(O) \ C2dv4$(O) \ C2interf$(O) \ C2prc$(O) \ C2rule13$(O) \ C2toS2$(O) \ C2togr$(O) \ E2tostrp$(O) \ E2$(O) \ E2adapt$(O) \ E2interf$(O) \ E2sec$(O) \ E2secitf$(O) \ E2secprc$(O) \ S2$(O) \ S2adapt$(O) \ S2interf$(O) \ S2rule13$(O) \ T2$(O) \ T2dv4$(O) \ T2interf$(O) \ T2rule13$(O) \ T2tops$(O) \ atomreg$(O) \ boolean$(O) \ chrono$(O) \ compreg$(O) \ eval_ctr$(O) \ geometry$(O) \ gr$(O) \ gritf$(O) \ gs$(O) \ gsitf$(O) \ gsprc$(O) \ integran$(O) \ integrat$(O) \ invert$(O) \ outS2$(O) \ outS2itf$(O) \ polC2$(O) \ polC2itf$(O) \ polC2prc$(O) \ ps$(O) \ psitf$(O) \ refcount$(O) \ regcoll$(O) \ reginfo$(O) \ region$(O) \ semstitf$(O) \ semistrp$(O) \ sttosmst$(O) \ strip$(O) \ stripitf$(O) \ translat$(O) \ trnsfrm$(O) all: cubpack.lib cubpack.lib: $(OBJS) tlib.rsp tlib cubpack @tlib.rsp tst$(X): $(MYTESTPROG) $(CC) $(CFLAGS) -etst$(X) cubpack.lib $(MYTESTPROG) tst.out: tst$(X) tst > tst.out type tst.out clean: $(RM) *$(O) $(RM) tst$(X) $(RM) cubpack.lib $(RM) tlib.rsp $(RM) *.out tlib.rsp: # TLIB response file copy &&| /C & /P64 & +point2D$(O) & +C2$(O) & +C2dv2$(O) & +C2dv4$(O) & +C2interf$(O) & +C2prc$(O) & +C2rule13$(O) & +C2toS2$(O) & +C2togr$(O) & +E2tostrp$(O) & +E2$(O) & +E2adapt$(O) & +E2interf$(O) & +E2sec$(O) & +E2secitf$(O) & +E2secprc$(O) & +S2$(O) & +S2adapt$(O) & +S2interf$(O) & +S2rule13$(O) & +T2$(O) & +T2dv4$(O) & +T2interf$(O) & +T2rule13$(O) & +T2tops$(O) & +atomreg$(O) & +boolean$(O) & +chrono$(O) & +compreg$(O) & +eval_ctr$(O) & +geometry$(O) & +gr$(O) & +gritf$(O) & +gs$(O) & +gsitf$(O) & +gsprc$(O) & +integran$(O) & +integrat$(O) & +invert$(O) & +outS2$(O) & +outS2itf$(O) & +polC2$(O) & +polC2itf$(O) & +polC2prc$(O) & +ps$(O) & +psitf$(O) & +refcount$(O) & +regcoll$(O) & +reginfo$(O) & +region$(O) & +semstitf$(O) & +semistrp$(O) & +sttosmst$(O) & +strip$(O) & +stripitf$(O) & +translat$(O) & +trnsfrm$(O) | tlib.rsp SHAR_EOF fi # end of overwriting check if test -f 'Mk.decalpha' then echo shar: will not over-write existing file "'Mk.decalpha'" else cat << \SHAR_EOF > 'Mk.decalpha' CUBPACK = /home/ronald/Research/Cubpack++ MYTESTPROG = tmp.o TARGET = tst ######################################################### LIB_DIR=$(CUBPACK)/Src INCLUDE_DIR=$(CUBPACK)/Src CC = cxx CFLAGS = -I$(INCLUDE_DIR) libdir = -L$(LIB_DIR) libs = -lcubpack -lm .SUFFIXES: .o .C .C.o: ; $(CC) $(CFLAGS) -c $*.C $(TARGET): $(MYTESTPROG) $(CC) $(MYTESTPROG) $(libdir) $(libs) -o $(TARGET) clean: /bin/rm -f *.o $(TARGET) core SHAR_EOF fi # end of overwriting check if test -f 'Mk.gn1' then echo shar: will not over-write existing file "'Mk.gn1'" else cat << \SHAR_EOF > 'Mk.gn1' CUBPACK = /home/ronald/Research/Cubpack++ MYTESTPROG = vb5.o TARGET = tst ######################################################### LIB_DIR=$(CUBPACK)/Src INCLUDE_DIR=$(CUBPACK)/Src CC = gcc CFLAGS = -x c++ -I$(INCLUDE_DIR) libdir = -L$(LIB_DIR) libs = -lcubpack -lm -lg++ .c.o: ; $(CC) $(CFLAGS) -c $*.c $(TARGET): $(MYTESTPROG) $(CC) $(MYTESTPROG) $(libdir) $(libs) -o $(TARGET) clean: /bin/rm -f *.o $(TARGET) core SHAR_EOF fi # end of overwriting check if test -f 'Mk.gn2' then echo shar: will not over-write existing file "'Mk.gn2'" else cat << \SHAR_EOF > 'Mk.gn2' CUBPACK = /home/ronald/Research/Cubpack++ MYTESTPROG = vb5.o TARGET = tst ######################################################### LIB_DIR=$(CUBPACK)/Src INCLUDE_DIR=$(CUBPACK)/Src CC = gcc CFLAGS = -x c++ -I$(INCLUDE_DIR) -fno-implicit-templates libdir = -L$(LIB_DIR) libs = -lcubpack -lm -lg++ .c.o: ; $(CC) $(CFLAGS) -c $*.c $(TARGET): $(MYTESTPROG) $(CC) $(MYTESTPROG) $(libdir) $(libs) -o $(TARGET) clean: /bin/rm -f *.o $(TARGET) core SHAR_EOF fi # end of overwriting check if test -f 'Mk.gn3' then echo shar: will not over-write existing file "'Mk.gn3'" else cat << \SHAR_EOF > 'Mk.gn3' CUBPACK = /home/ronald/Research/Cubpack++ MYTESTPROG = vb5.o TARGET = tst ######################################################### LIB_DIR=$(CUBPACK)/Src INCLUDE_DIR=$(CUBPACK)/Src CC = g++ CFLAGS = -I$(INCLUDE_DIR) -fno-implicit-templates libdir = -L$(LIB_DIR) libs = -lcubpack -lm .c.o: ; $(CC) $(CFLAGS) -c $*.c $(TARGET): $(MYTESTPROG) $(CC) $(MYTESTPROG) $(libdir) $(libs) -o $(TARGET) clean: /bin/rm -f *.o $(TARGET) core SHAR_EOF fi # end of overwriting check if test -f 'Mk.solaris' then echo shar: will not over-write existing file "'Mk.solaris'" else cat << \SHAR_EOF > 'Mk.solaris' CUBPACK = /home/ronald/Cubpack++ MYTESTPROG = vb7.o TARGET = tst ######################################################### LIB_DIR=$(CUBPACK)/Src INCLUDE_DIR=$(CUBPACK)/Src CC = CC CFLAGS = -I$(INCLUDE_DIR) libdir = -L$(LIB_DIR) libs = -lcubpack -lm .c.o: ; $(CC) $(CFLAGS) -c $*.c $(TARGET): $(MYTESTPROG) $(CC) $(MYTESTPROG) $(libdir) $(libs) -o $(TARGET) clean: /bin/rm -f *.o $(TARGET) core SHAR_EOF fi # end of overwriting check if test -f 'Mk.tc' then echo shar: will not over-write existing file "'Mk.tc'" else cat << \SHAR_EOF > 'Mk.tc' # Makefile for running Cubpack++ applications using Turbo C++ under MS-DOS CUBPACK = D:\CUBPACK MYTESTPROG = C2toquad.obj quadril.obj quadritf.obj testquad.obj TARGET = tst.exe # You should not need to change anything after this ############################################################################# LIB_DIR=$(CUBPACK)/Src INCLUDE_DIR=$(CUBPACK)/Src # File suffixes C = .c # C++ code H = .h # C++ header O = .obj # Compiled code X = .exe # Executable # File delete utility RM = del # Compiler name and flags. The given compiler options work with # Turbo C++ 3.0. Many others don't. CC = tcc CFLAGS = -v -P -I$(INCLUDE_DIR) -ml libdir = -L$(LIB_DIR) $(C)$(O): $(CC) $(CFLAGS) -c $*$(C) >> compiler.log $(TARGET): $(MYTESTPROG) $(CC) $(CFLAGS) -e$(TARGET) $(libdir) cubpack.lib $(MYTESTPROG) clean: $(RM) *.$(O) $(TARGET) SHAR_EOF fi # end of overwriting check cd .. if test -f 'README.1st' then echo shar: will not over-write existing file "'README.1st'" else cat << \SHAR_EOF > 'README.1st' ////////////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools (ronald@cs.kuleuven.ac.be) // // Dirk Laurie (dirk@calvyn.puk.ac.za) // // Luc Pluym // // // ////////////////////////////////////////////////////////////// // // // Last modification of source code: April 4, 1996 // // Last modification of text : May 23, 1996 // // // ////////////////////////////////////////////////////////////// This version is available by anonymous ftp from ftp.cs.kuleuven.ac.be in /pub/NumAnal-ApplMath/Cubpack/all.tar.gz or /pub/NumAnal-ApplMath/Cubpack/all.zip and also by using a World Wide Web browser such as xmosaic via "http://www.cs.kuleuven.ac.be/~ronald/". If you tell us who you are, we promise to keep you informed about corrections, updates and extensions. If you need assistance, please always mention the two dates above. The next file to read is named INSTALL. Enjoy Cubpack++ ! SHAR_EOF fi # end of overwriting check if test -f 'README.DOS' then echo shar: will not over-write existing file "'README.DOS'" else cat << \SHAR_EOF > 'README.DOS' [ If you are using UNIX, read the file README instead of this one. ] 23 May 1996 The current version of Cubpack++ is Version 0.1h = 1.0 ====================================================== |The complete Cubpack++ distribution is in the file all.zip . | |Switch your ftp to binary mode before you get this file. | |Once you have this file on your machine, you have to execute | unzip -aL all.zip |You now have a directory named CUBPACK . --------------------------------------------------------------------- Start by reading CUBPACK\DOCUMENT\PAPER.* and CUBPACK\DOCUMENT\USERMAN.* and CUBPACK\README.1ST Enjoy Cubpack++! SHAR_EOF fi # end of overwriting check if test -f 'README' then echo shar: will not over-write existing file "'README'" else cat << \SHAR_EOF > 'README' [ If you are using MSDOS, read the file README.DOS instead of this one. ] 23 May 1996 The current version of Cubpack++ is Version 0.1h = 1.0 ====================================================== First check which decompression program is available on your machine. IF you have gunzip and tar THEN |The complete Cubpack++ distribution is in the file all.tar.gz . |(Yes, all patches are already included in this.) | |Switch your ftp to binary mode before you get this file. | |Once you have this file on your machine, you have to execute | gunzip all.tar.gz | tar xf all.tar |You now have a directory named Cubpack++ . --------------------------------------------------------------------- IF you have unzip THEN |The complete Cubpack++ distribution is in the file all.zip . | |Switch your ftp to binary mode before you get this file. | |Once you have this file on your machine, you have to execute | unzip all.zip |You now have a directory named Cubpack . --------------------------------------------------------------------- Start by reading Cubpack{++}/Documentation/paper.* and Cubpack{++}/Documentation/userman.* and Cubpack{++}/README.1st Enjoy Cubpack++! SHAR_EOF fi # end of overwriting check if test -f 'CONTENTS' then echo shar: will not over-write existing file "'CONTENTS'" else cat << \SHAR_EOF > 'CONTENTS' What you find in the current directory -------------------------------------- README.1st : information you should first look at CONTENTS : this file INSTALL : hints to get Cubpack++ up and running Makefile : primitive Makefile for unix systems INSTALL.BAT : installation for MS-DOS systems TESTCASE.BAT : running test cases on MS-DOS systems quick_install : script invoked by `make install' quick_run : script invoked by `make run' Src : directory with all source code Documentation : directory with documentation See Documentation/CONTENTS for details. Drivers : directory with example programs See Documentation/CONTENTS for details. Tools : directory with unix tools to change suffixes and makefiles for several systems See Documentation/CONTENTS for details. Note that on MSDOS systems, the file names are all in the same case and truncated to conform to the 8.3 naming restriction. We have taken care to ensure that no conflicts arise. SHAR_EOF fi # end of overwriting check if test -f 'INSTALL' then echo shar: will not over-write existing file "'INSTALL'" else cat << \SHAR_EOF > 'INSTALL' How to get Cubpack++ up and running? ------------------------------------ 1) Getting the suffix right --------------------------- At this stage of C++, a uniform installation procedure is impossible (one of the reasons is that templates are treated differently by different systems). With this file we provide some help. At the moment all source code is located in one directory, named `Src'. All C++ source files have suffix .c on the distribution. Start with verifying what suffix your compiler expects. - If this is .c, you have nothing to change. (This is the case with e.g. gcc (gnu), xlC (IBM), CC (Sun). With some other compilers (e.g. Turbo C++) this is not the default, but you can specify it with a compiler option.) - If there is absolutely no way to persuade your compiler to accept .c files as C++ code, you have to change not only the suffixes of the files itself but also inside the header files of template classes where .c files are included. For those working on Unix systems, we provided some shell scripts to do this. These are located in the directory `Tools'. Change your current working directory to `Tools', learn from the file `CONTENTS' which script you need and execute if from where you are. Other users can learn from these scripts (e.g. c2C) which files they have to modify. 2) Compile the package ---------------------- Those working on a Unix system can now try to execute make install in the parent directory. Then you can choose between the several compilers we used. Those working on MSDOS can now try to execute INSTALL in the parent directory, and choose a compiler. Now you can go for coffee or lunch, depending on your platform. Some timings to give you an idea: IBM RS6000 AIX 3.2.5, xlC compiler - 181.0u 34.0s 6:09 58% i586 90 MHz Linux1.2.4, g++ compiler (gcc v2.7.2) - 208.79u 36.69s 4:29.19 91% DECalpha OSF/1 V1.3, cxx compiler - 272.08u 62.45s 13:00 42% Sparccenter 1000, SunOS 5.3, g++ compiler ( gcc v2.7.2) - 296.0u 49.0s 7:28 76% DECstation 5000/240 ULTRIX V4.4 , g++ compiler (gcc v2.7.2) - 366.3u 85.6s 15:31 48% Sparccenter 1000, SunOS 5.3, CC compiler - 286.0u 186.0s 28:49 27% i486 33MHz MS-DOS Turbo C++ 3.0 compiler - 7min38s elapsed time HP, HP-UX, g++ compiler (gcc v2.6.0) - 499.2u 41.3s 10:36 84% DECstation 5000/120 ULTRIX V4.4 , g++ compiler (gcc v2.7.2) - 747.8u 148.6s 19:45 75% --------------- | If you use one of the platforms on which we tested Cubpack++ no | problem should occur. If it does, please let us know. | | If you use another Unix platform, writing a specific makefile (by | modifying one of those we provided in the directory Tools) and | extending the script quick_install, should be straitforward. If | you are not feeling that familiar with makefiles, please ask and | we will help. | | If you are not using a Unix platform, we hope you know enough | about your system to get Cubpack++ at work. Probably you can | still find useful information in the makefiles we provided in the | directory Tools. --------------- This was the time consuming part which never has to be done again if you continue to use the same platform. 3) Trying some examples ----------------------- Those working on a Unix system can now try to execute make run in the parent directory. You are requested to select a main program. You can choose among the examples we provided or enter the name of your own main program. When the compilation finished successfully, an executable named `tst' is available in the parent directory. Those working on MSDOS can now try to execute TESTCASE n in the parent directory, where n is a number in the range 1 to 11. (Executing TESTCASE without a number will give a menu.) The corresponding main program will be copied into the CODE directory, compiled, linked and executed. The output will be written to the file CODE\VBn.OUT and may be compared with EXAMPLES\VBn.OUT. --------------- | If you have problems linking with libcubpack.a you can replace | this with $(OBJS) in the lines that define tst. --------------- 4) Using Cubpack++ ------------------ It is of course far from ideal that the user program has to be copied into the directory where the Cubpack++ source code is located. Because templates are treated differently on different platforms, we cannot (yet) provide a good alternative for all platforms. The ideal solution we have in mind can be realized for those using the gnu gcc compiler, the cxx compiler on DECalpha OSF or the CC compiler on Solaris. In the directory Tools we provided a Makefile which a user can copy into his working directory. He should modify the values of the constants CUBPACK, MYTESTPROG and TARGET in the beginning of these files, depending on his situation and wishes. 5) Cleaning up -------------- To remove all object files, archive, the template data base, execute make clean in the parent directory. 6) In case of problems ---------------------- In case of installation problems, please don't wait to contact one of the authors: ----------------------------------------------------------------------------- | Name : Ronald Cools | | Email : ronald.cools@cs.kuleuven.ac.be Katholieke Universiteit Leuven | | ronald@cs.kuleuven.ac.be Department of Computer Science | | Celestijnenlaan 200 A | | Fax : +(32) 16 32 79 96 B-3001 HEVERLEE | | Phone : +(32) 16 32 75 62 BELGIUM | ----------------------------------------------------------------------------- For MSDOS installation, contact: ----------------------------------------------------------------------------- | Name : Dirk Laurie | | Email : dirk@calvyn.puk.ac.za Potchefstroomse Universiteit vir CHO | | na.dlaurie@na-net.ornl.gov Department of Mathematics | | P.O.Box 1174 | | Fax : +(27) 16 807 3614 1900 VANDERBIJLPARK | | Phone : +(27) 16 807 3600 South Africa | ----------------------------------------------------------------------------- SHAR_EOF fi # end of overwriting check if test -f 'INSTALL.BAT' then echo shar: will not over-write existing file "'INSTALL.BAT'" else cat << \SHAR_EOF > 'INSTALL.BAT' @echo off if "%1"=="" goto 1 rem Quick installation on MS-DOS systems using Turbo C++ copy tools\mkfile.%1 code\makefile echo --------------------------------------------------- echo Compilation will now start. This will take a while. echo --------------------------------------------------- chdir code make clean rem The REM'd lines below record start/finish times, and require an rem empty file called CR in the root directory rem type ..\cr|time>time make all rem type ..\cr|time>>time chdir .. goto 2 :1 echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ echo ³ Available makefiles under MSDOS ³ echo ³ ³ echo ³ tc Turbo C++ version 3.00 and later ³ echo ³ gnu Gnu C++ version 2.6.0 and earlier ³ echo ³ gn2 Gnu C++ version 2.6.2 and later ³ echo ³ ³ echo ³ Type 'install OPTION' at the DOS prompt to install ³ echo ³ the chosen OPTION; e.g. 'install tc'. ³ echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :2 SHAR_EOF fi # end of overwriting check if test -f 'TESTCASE.BAT' then echo shar: will not over-write existing file "'TESTCASE.BAT'" else cat << \SHAR_EOF > 'TESTCASE.BAT' @echo off if "%1"=="" goto 1 copy examples\vb%1.c code\main.c chdir code del main.obj del tst.* make tst.out rename tst.out vb%1.out chdir .. goto 2 :1 echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ echo ³ Available examples for Cubpack++ ³ echo ³ ³ echo ³ vb1 CIRCLE ³ echo ³ vb2 PLANE_SECTOR (quadrant) ³ echo ³ vb3 PLANE_SECTOR (wedge) ³ echo ³ vb4 GENERALIZED_RECTANGLE (parabola) ³ echo ³ vb5 GENERALIZED_RECTANGLE (lemniscate) ³ echo ³ vb6 SEMI_INFINITE_STRIP ³ echo ³ vb7 SEMI_INFINITE_STRIP ³ echo ³ vb8 INFINITE_STRIP ³ echo ³ vb9 RECTANGLE ³ echo ³ vb10 TRIANGLE ³ echo ³ vb10 TRIANGLE ³ echo ³ vb11 PLANE_SECTOR (wedge) ³ echo ³ ³ echo ³ Type 'testcase 1' etc. at the DOS ³ echo ³ prompt to activate one of these options. ³ echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :2 SHAR_EOF fi # end of overwriting check if test -f 'quick_install' then echo shar: will not over-write existing file "'quick_install'" else cat << \SHAR_EOF > 'quick_install' #!/bin/sh # # Constants that must be adjusted # SRC_DIR=Src TOOL_DIR=Tools # ####################################################################### echo "This script should make it easier for you to install Cubpack++." echo "An appropriate makefile is selected based on the brand of unix" echo "you use." echo "Available are" echo " (1) IBM RS6000 - AIX - XlC compiler" echo " (2) DEC alpha - DEC OSF - cxx compiler" echo " (3) Unix gnu - gcc or g++ compiler" echo " (4) Solaris 2.* - CC compiler version 4.*" echo echo "Make your choice. \c" read x case $x in 1) cp $TOOL_DIR/mkfile.rs6000 $SRC_DIR/makefile;; 2) cp $TOOL_DIR/mkfile.decalpha $SRC_DIR/makefile;; 3) OLDVERSION1=2.6.0 OLDVERSION2=2.7.0 gcc -v 2> tmp$$ v=`tail -1 tmp$$ | sed "s/^.*version //" | sed "s/ .*$//"` /bin/rm tmp$$ echo "You are using gcc version $v" a=`expr "$v" ">" "$OLDVERSION2"` if test $a = "1" then cp $TOOL_DIR/mkfile.gn3 $SRC_DIR/makefile else a=`expr "$v" ">" "$OLDVERSION1"` if test $a = "1" then cp $TOOL_DIR/mkfile.gn2 $SRC_DIR/makefile else cp $TOOL_DIR/mkfile.gn1 $SRC_DIR/makefile fi fi;; 4) cp $TOOL_DIR/mkfile.solaris $SRC_DIR/makefile;; *) echo "This was an illegal choice!" exit 1 ;; esac ####################################################################### if test -f .lastinstall then y=`cat .lastinstall` /bin/rm -f .lastinstall if test $x != $y then echo "Removing the remains of a previous compilation which might interfere ..." cd $SRC_DIR make clean cd .. echo "... Done." fi fi echo $x > .lastinstall ####################################################################### echo "Do you want to edit the makefile first? [n/y] \c" read a case $a in [Yy]*) vi $SRC_DIR/makefile ;; esac ####################################################################### # echo echo "Compilation will now start. This will take a while." echo cd $SRC_DIR make all SHAR_EOF chmod +x 'quick_install' fi # end of overwriting check if test -f 'quick_run' then echo shar: will not over-write existing file "'quick_run'" else cat << \SHAR_EOF > 'quick_run' #!/bin/sh # # Constants that must be adjusted # SRC_DIR=Src # ####################################################################### if test -f .lastinstall then y=`cat .lastinstall` case $y in 1|3|4) SUFFIX=c;; 2) SUFFIX=C;; *) echo "Unknown compiler used for installation." exit 1;; esac else echo "make install must be executed first." exit 1 fi ####################################################################### echo "Choose a main program from the following list." echo cat Drivers/EXAMPLES echo echo "Make your choice. \c" read a case $a in 0) echo "Give the name of your example file." echo "(Full pathname from current position.)" read a cp $a $SRC_DIR/main.$SUFFIX ;; [1-9]|1[0-8]) cp Drivers/vb${a}.c $SRC_DIR/main.$SUFFIX ;; *) echo "That was an illegal choice!" exit 1 ;; esac ####################################################################### # echo echo "Compilation will now start." echo cd $SRC_DIR make tst SHAR_EOF chmod +x 'quick_run' fi # end of overwriting check if test -f 'Makefile' then echo shar: will not over-write existing file "'Makefile'" else cat << \SHAR_EOF > 'Makefile' SRC_DIR = Src install: ./quick_install run: ./quick_run mv $(SRC_DIR)/tst . echo 'executable "tst" is available.' clean: cd $(SRC_DIR) ; /bin/rm -f *.o tst core makefile cd $(SRC_DIR) ; /bin/rm -f main.c libcubpack.a cd $(SRC_DIR) ; /bin/rm -r -f ptrepository tempinc Templates.DB SHAR_EOF fi # end of overwriting check if test ! -d 'Src' then mkdir 'Src' fi cd 'Src' if test -f 'C2.c' then echo shar: will not over-write existing file "'C2.c'" else cat << \SHAR_EOF > 'C2.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////// //File C2.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) //////////////////////////////////////////////// #include #include ////////////////////////////////////////////// Parallelogram::Parallelogram (const Point& p1,const Point& p2,const Point& p3) : Geometry(2),Vertices(3),TheVolumeKnown(False) { Vertices[0] = p1; Vertices[1] = p2; Vertices[2] = p3; } ////////////////////////////////////////////// void Parallelogram::ComputeVolume() { TheVolume = fabs( ((Vertices[0][0]*Vertices[1][1]-Vertices[1][0]*Vertices[0][1]) +(Vertices[1][0]*Vertices[2][1]-Vertices[2][0]*Vertices[1][1]) +(Vertices[2][0]*Vertices[0][1]-Vertices[0][0]*Vertices[2][1])) ); TheVolumeKnown = True; } /////////////////////////////////////////////// const Point& Parallelogram::Vertex(int i) const { return Vertices[i]; } ////////////////////////////////////////////////// real Parallelogram::Volume() const { Parallelogram* P = (Parallelogram*) this; if (!TheVolumeKnown) { P->ComputeVolume(); }; return P->TheVolume; } /////////////////////////////////////////////// void Parallelogram::Volume(real v) { TheVolume = v; TheVolumeKnown = True; } //////////////////////////////////////////////// //Processor* //Parallelogram::DefaultProcessor() //const //{ //return new SimpleAdaptive //(new Parallelogram_Rule13, //new Parallelogram_Divide4); //} /////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'C2dv2.c' then echo shar: will not over-write existing file "'C2dv2.c'" else cat << \SHAR_EOF > 'C2dv2.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////////////// //File C2dv2.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(long lines split) ///////////////////////////////////////////////// #include #include #include #include ////////////////////////////////////////////////// void Parallelogram_Divide2::Apply (const Parallelogram& t, Stack& Offspring, const Vector& DiffOrder) { Point m12 = (t.Vertex(0)+t.Vertex(DiffOrder[0]))/2; Point m34 = t.Vertex(DiffOrder[1])+(t.Vertex(DiffOrder[0])-t.Vertex(0))/2; Parallelogram* t1 = new Parallelogram(t.Vertex(0),m12,t.Vertex(DiffOrder[1])); Parallelogram* t2 = new Parallelogram(m12,t.Vertex(DiffOrder[0]),m34); Offspring.Push(t1); Offspring.Push(t2); } ////////////////////////////////////////////////// Parallelogram_Divide2::Parallelogram_Divide2() :SameShapeDivisor() { } ////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'C2dv4.c' then echo shar: will not over-write existing file "'C2dv4.c'" else cat << \SHAR_EOF > 'C2dv4.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////////////// //File C2dv4.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(long lines split) ///////////////////////////////////////////////// #include #include #include ////////////////////////////////////////////////// void Parallelogram_Divide4::Apply (const Parallelogram& t, Stack& Offspring, const Vector& DiffOrder) { Point m12 = (t.Vertex(0)+t.Vertex(1))/2; Point m13 = (t.Vertex(0)+t.Vertex(2))/2; Point m23 = (t.Vertex(2)+t.Vertex(1))/2; Point m24 = t.Vertex(1)+(t.Vertex(2)-t.Vertex(0))/2; Point m34 = t.Vertex(2)+(t.Vertex(1)-t.Vertex(0))/2; Parallelogram* t1 = new Parallelogram(t.Vertex(0),m12,m13); Parallelogram* t2 = new Parallelogram(m12,t.Vertex(1),m23); Parallelogram* t3 = new Parallelogram(m13,m23,t.Vertex(2)); Parallelogram* t4 = new Parallelogram(m23,m24,m34); Offspring.Push(t1); Offspring.Push(t2); Offspring.Push(t3); Offspring.Push(t4); } ////////////////////////////////////////////////// Parallelogram_Divide4::Parallelogram_Divide4() :SameShapeDivisor() { } ////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'C2interf.c' then echo shar: will not over-write existing file "'C2interf.c'" else cat << \SHAR_EOF > 'C2interf.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //////////////////////////////////////////////// //File C2interf.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(typedef introduced) //////////////////////////////////////////////// #include #include #include #include #include #include #include /////////////////////////////////////////////// typedef Rule RuleParallelogram; typedef SameShapeDivisor SameShapeDivisorParallelogram; PARALLELOGRAM::PARALLELOGRAM(const Point& p1, const Point& p2, const Point& p3) :USERINTERFACE() {Pointer R13(new Parallelogram_Rule13); Pointer D4(new Parallelogram_Divide4); Processor *SAP(new SimpleAdaptive(R13,D4)); StoreAtomic(new Parallelogram(p1,p2,p3),SAP); } /////////////////////////////////////////////// RECTANGLE::RECTANGLE(const Point& p1, const Point& p2, const Point& p3) :USERINTERFACE() { Error( fabs((p2-p1)*(p3-p1)) > 100*REAL_EPSILON, "Sides of RECTANGLE not orthogonal"); StoreAtomic(new Parallelogram(p1,p2,p3), //new SimpleAdaptive( //new Parallelogram_Rule13, //new Parallelogram_Divide4)); new Parallelogram_Processor); } /////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'C2prc.c' then echo shar: will not over-write existing file "'C2prc.c'" else cat << \SHAR_EOF > 'C2prc.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //File C2prc.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(typedef introduced and long lines split) //////////////////////////////////////////////////////////// #include #include #include #include #include #include //////////////////////////////////////////////////////// Pointer < Parallelogram_Processor::RuleParallelogram > Parallelogram_Processor::TheRule = new Parallelogram_Rule13; Pointer < Parallelogram_Processor::SameShapeDivisorParallelogram > Parallelogram_Processor::TheDivisor2 = new Parallelogram_Divide2; Pointer < Parallelogram_Processor::SameShapeDivisorParallelogram > Parallelogram_Processor::TheDivisor4 = new Parallelogram_Divide4; //////////////////////////////////////////////////////// Parallelogram_Processor::Parallelogram_Processor() :TimesCalled(0), Diffs(2) { } ///////////////////////////////////////////////////////////// Parallelogram_Processor* Parallelogram_Processor::Descendant() const { Parallelogram_Processor* r = new Parallelogram_Processor; return r; } //////////////////////////////////////////////// void Parallelogram_Processor::Process( Stack& Offspring) { TimesCalled ++; if (TimesCalled == 1) { TheRule->ApplyWithDiffs(LocalIntegrand(),Geometry(),Integral(), AbsoluteError(),Diffs); Offspring.MakeEmpty(); return; }; if(TimesCalled == 2) { real NewVolume = Geometry().Volume()/2; Stack Parts; Vector DiffOrder(Diffs.Size()); const real difffac = 1.81818, difftreshold = 0.00004; if (max(Diffs[0],Diffs[1]) < difftreshold) { TheDivisor4->Apply(Geometry(),Parts,DiffOrder); NewVolume /=2; } else if (Diffs[0]>difffac*Diffs[1]) { DiffOrder[0] = 1 ; DiffOrder[1] = 2; TheDivisor2->Apply (Geometry(),Parts,DiffOrder); } else if (Diffs[1]>difffac*Diffs[0]) { DiffOrder[0] = 2; DiffOrder[1] =1; TheDivisor2->Apply (Geometry(),Parts,DiffOrder); } else { TheDivisor4->Apply(Geometry(),Parts,DiffOrder); NewVolume /=2; }; unsigned int N = Parts.Size(); for (unsigned int i =0;iVolume(NewVolume); Processor* p = Descendant(); Atomic* a = new Atomic(g,p); a->LocalIntegrand(&LocalIntegrand()); Offspring.Push(a); }; return; }; Error(TimesCalled > 2, "Parallelogram_Processor : more than two calls of Process()"); } /////////////////////////////////////////////// Processor* Parallelogram_Processor::NewCopy() const { return new Parallelogram_Processor(*this); } /////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'C2rule13.c' then echo shar: will not over-write existing file "'C2rule13.c'" else cat << \SHAR_EOF > 'C2rule13.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// // //File C2rule13.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(long lines split) ///////////////////////////////////////////////////////// // // A cubature formula of degree 13 with 37 points and associated // null rules. // The cubature formula, from Rabinowitz & Richter, was recomputed // to obtain higher accuracy. // ///////////////////////////////////////////////////////// #include static int K[]={1,2,3,2}; const int NumberOfPoints=K[0]+4*K[1]+4*K[2]+8*K[3]; const int Orbits=K[0]+K[1]+K[2]+K[3]; static real Type1[]={ 0.9909890363004326469792722978603e+00, 0.6283940712305315063814483471116e+00}; static real l1sdl2s = Type1[1]*Type1[1]/Type1[0]/Type1[0]; static real Type2[]={ 0.9194861553393073086142137772149e+00, 0.6973201917871173078084506730937e+00, 0.3805687186904854497424188074662e+00}; static real Type3[2][2]={{0.9708504361720225062147290554088e+00, 0.6390348393207252159077623446225e+00}, {0.8623637916722781475018696425693e+00, 0.3162277660168700033875075593701e+00}}; static real Weight[8][8]={{0.2995235559387052215463143056692e+00, 0.3311006686692356205977471655046e-01, 0.1802214941550624038355347399683e+00, 0.3916727896035153300761243260674e-01, 0.1387748348777288706306435595057e+00, 0.2268881207335707037147066705814e+00, 0.3657395765508995601240002438981e-01, 0.1169047000557533546701746277951e+00}, {7.610781847149629154716409791983e-2, 1.486101247399760261471935168346e-1, -2.077685631717747007172983323970e-1, 6.850758313011924198538315395405e-2, 2.024205813317813585572881715385e-1, 1.108627473745508429879249169864e-1, -1.187411393304862640859204217487e-1, -5.208857468077715683772080394959e-2}, {4.016494861405949747097510013162e-2, -1.093132962444079541048635452881e-1, -2.270251673633777452624380129694e-1, 1.231674163356097016086203579325e-2, -1.420402526499201540699111172200e-1, 1.189080551229557928776504129312e-1, -4.482039658150474743804189300793e-3, 1.730383808319875827592824151609e-1}, {-5.643905795781771973971259866415e-1, 2.878418073676293225652331648545e-2, 1.159354231997583294689565314470e-1, 1.376081498690624477894043101438e-1, -7.909780225340130915490382973570e-2, 1.174335441429478112778176601234e-1, -1.107251942334134124782600707843e-1, 2.094226883312045633400182488252e-2}, {-2.269001713589584730602581694579e-1, 2.976190892690301120078774620049e-2, -7.440193483272787588251423144751e-2, -1.224665989043784131260454301280e-1, -4.857910454732976198562745578156e-2, 2.228157325962656425537280474671e-1, 1.459764751457503859063666414952e-1, -1.211789553452468781539987084682e-1}, {-3.326760468009974589269134283992e-1, 1.796655319904795478676993902115e-1, -4.389976396805911868560791966472e-2, -2.295841771339316497310760908889e-1, 6.182618387692816082856552878852e-2, -1.202703885325137746461829140891e-1, 5.109536580363550180208564374234e-3, 1.126062761533095493689566169969e-1}, {2.290638530086106512999345512401e-1, 2.702070398116919449911037051753e-1, -9.078047988731123605988441792069e-3, 4.618480310858703283999169489655e-2, -2.598231009547631799096616255056e-1, -2.518433931146441037986247681820e-2, -1.257796993152456033984707367389e-2, -2.720818902721190304043617320910e-2}, {2.746908885094872977794932213372e-1, -1.149427039769738298032807785523e-2, 1.596178537820019535731955591283e-1, -2.180626972663360443142752377527e-1, -8.711748038292630173597899697063e-3, 1.902786182960269617633915869710e-1, -1.189840649092108827784089292890e-1, 2.883382565767354162177931122471e-2}}; // // The error estimator constants // static const real crival=0.4 , facmed=8.0; static const real facopt = facmed/(crival*crival); #include #include #include #include #define sqr(x) ((x)*(x)) void Parallelogram_Rule13::ApplyWithDiffs(Integrand& F,Parallelogram& R, real& TheResult,real& TheError, Vector& DiffOrder) { int i,j,p,Type,nr,number; real Null[7]; real Tres = -1.0; real noise,r,r1,r2,r3,Deg5,Deg3,Deg1,Deg7,z1,z2,sumval; real D1,D2; real F0; real FE[2][2][2]; // [l1,l2][vertex1,vertex2][plus,minus] Point x[8]; if (Tres <= 0) { Tres=50*REAL_EPSILON; } TheResult = 0.0; for (i=0;i<7;i++){Null[i]=0;} p=0; for (Type=0;Type <=3;Type++){ for (nr=0;nr= 1) { TheError =facmed*Deg7; } else { if (r>=crival) { TheError = facmed*r*Deg7; } else { TheError = facopt *r*r*r*Deg7; } } TheError = max(noise,TheError); } TheError *= R.Volume()/4; TheResult *=R.Volume()/4; } ////////////////////////////////////////////////// Parallelogram_Rule13::Parallelogram_Rule13() :Rule() { } ////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'C2toS2.c' then echo shar: will not over-write existing file "'C2toS2.c'" else cat << \SHAR_EOF > 'C2toS2.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////// //File C2toS2.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ////////////////////////////////////////// #include #include #include ////////////////////////////////////////// void PolarToRectangular::Transform(real& w, Point& p) { Point P(p.R()*cos(p.Theta()),p.R()*sin(p.Theta())); w *= p.R(); p = P; } /////////////////////////////////////////// PolarToRectangular::PolarToRectangular() : Transformation() { } /////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'C2togr.c' then echo shar: will not over-write existing file "'C2togr.c'" else cat << \SHAR_EOF > 'C2togr.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////// //File gr.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) //////////////////////////////////////////////// #include #include //////////////////////////////////////////// void C2toGR::Transform(real& w, Point& p) { GeneralizedRectangle& G = *GR_ptr; Point M = G.B()-G.A(); Point C = G.A() + p.X()*M; real ml = M.Length(); real dist = G.Boundary(C), ratio=dist/ml; Point P(-ratio*M.Y(),ratio*M.X()); w *= dist*ml; p = C+p.Y()*P; } /////////////////////////////////////////////////// C2toGR::C2toGR(GeneralizedRectangle* g) : Transformation(),GR_ptr(g) { } ////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'E2.c' then echo shar: will not over-write existing file "'E2.c'" else cat << \SHAR_EOF > 'E2.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// //File E2.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Nov 1994 V0.1d(re-ordering of member initializers) ///////////////////////////////////////////////////////// #include #include #include #include ///////////////////////////////////////////////////////// Plane::Plane () : Geometry(2), xscale(1.0), yscale(1.0), TheCenter(0,0) { } ///////////////////////////////////////////////////////// Plane::Plane (const Point& center) : Geometry(2), xscale(1.0), yscale(1.0), TheCenter(center) { } ///////////////////////////////////////////////////////// Plane::Plane(const Point& center, real x, real y) : Geometry(2), xscale(x), yscale(y), TheCenter(center) { } ///////////////////////////////////////////////////////// real Plane::ScaleX() const { return xscale; } ///////////////////////////////////////////////////////// real Plane::ScaleY() const { return yscale; } ///////////////////////////////////////////////////////// //Processor* //Plane::DefaultProcessor() //const //{ //return new PlaneAdaptive; //} ///////////////////////////////////////////////////////// const Point& Plane::Center() const { return TheCenter; } ///////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'E2adapt.c' then echo shar: will not over-write existing file "'E2adapt.c'" else cat << \SHAR_EOF > 'E2adapt.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////// //File E2.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) //////////////////////////////////////////////// #include #include #include #include #include #include #include #include /////////////////////////////////////////////// #define sqr(x) ((x)*(x)) static int K[]={0,3,2,2}; const int NumberOfPoints=K[0]+4*K[1]+4*K[2]+8*K[3]; const int Orbits=K[0]+K[1]+K[2]+K[3]; static real Type1[]= {0.5460844152585403666984417e+00 , 0.1376486679696350642323050e+01 , 0.2358932261980680967828022e+01}; static real Type2[]= {0.8462499884480199068814807e+00 , 0.1985531339917884990890422e+01}; static real Type3[2][2]= {{0.1779246738905319006374908e+01 , 0.9318240227761998500475049e+00}, {0.3030436065368579151664045e+01 , 0.9962534261727632104611162e+00}}; static real OrigWeight[7]= {0.1418036987406628465242303e+00, 0.3807850175899473939094384e-01, 0.1290856883945041937607418e-02, 0.5772571826901623901546648e-01, 0.1620590503146543183518239e-03, 0.5445472363593369147167489e-02, 0.2411028493987025953260209e-04}; static int d[]={0,3,1,5,2,4,6}; static real Weight[7][7]= {{0.6002713316445080080142126, 0.7955990316249109629216728, 1.0584888443837658614605899, 0.7595383160846588054989698, 1.3523576929325600784468914, 0.9663531601396869556259704, 1.9895758469520118113052969}, {-0.1714120818975139, -1.4261615934658296, 20.9491066359021694, 1.7029699666146943, 57.2013795938251143, -4.3332227154742827, -175.0624620496226842}, {-0.2883800695213331, 2.5450105556734605, 2.8699527274413806, 0.304671504643251, 138.1913876850488233, -8.5573830821954439, -18.7930973279112966}, {-0.250456836419066, 0.3273926337592694, -83.9551965137636766, 0.4609375440071548, -365.1974538111883157, 10.4127651350263225, 1537.3605596124529503}, {-0.2595143739988262, 0.1255865390202144, 85.4652862386879934, -0.2489288730337109, -712.5513360902265439, 6.3018929219370941, -645.6559424743654782}, {-0.24820543230912, -0.2143965818640334, 8.5337065366470588, -0.2238393816932916, 867.6556565044116888, 7.6084037588845301, -4712.804729866979117}, {0.3052968227487744, 1.0011209710514362, -6.3357177267870899, 0.7227067892680122, -358.0249035190603089, 2.7469614313645364, -6407.2910382311609777}}; // Radii of rings associated with weights of published formula static real RingRadius[]= {0.9151577658134376, 1.2649388389767648, 1.7333214530567136, 2.2616892861784437, 2.6609731353556634, 2.9246248487342039, 6.0979478618219725}; //This is `infinity'. Never used actually // // The error estimator constants // const real crival=0.5 , facmed=5.0; const real facopt = facmed/(crival*crival); ////////////////////////////////////////////////////// void PlaneAdaptive::Rule(Integrand& F,Plane& R,real& TheResult,real& TheError,real& HalfValueRadius) { int i,j,p,Type,nr,number; real Null[6],OrbitContrib[7],below,above,fraction; real Tres = 50*REAL_EPSILON; real noise,r,r1,r2,r3,Deg5,Deg3,Deg7,Deg1,sumval; real A=1.0/R.ScaleX() , B=1.0/R.ScaleY(); Point x[8]; TheResult = 0.0; for (i=0;i<6;i++){Null[i]=0;} p=0; for (Type=0;Type <=3;Type++){ for (nr=0;nr= 1) { TheError =facmed*Deg7; } else { if (r>=crival) { TheError = facmed*r*Deg7; } else { TheError = facopt *r*r*r*Deg7; } } TheError = max(noise,TheError); } TheResult *= (A*B); TheError *= (A*B); // cout <<"=> Error = "<& Offspring) { TimesCalled++; if (TimesCalled==1) { Rule(LocalIntegrand(),Geometry(),Integral(),AbsoluteError(),HalfValueRadius); } else { const Point& C=Geometry().Center(); Offspring.Push(( AtomicRegion*) CIRCLE(C,HalfValueRadius)); Offspring.Push(( AtomicRegion*) OUT_CIRCLE(C,HalfValueRadius)); Offspring.IteratorReset(); while (!Offspring.IteratorAtEnd()) { Offspring.IteratorNext()->LocalIntegrand(&LocalIntegrand()); }; } } /////////////////////////////////////////////////// PlaneAdaptive::PlaneAdaptive() :Processor(),TimesCalled(0),HalfValueRadius(0) { } //////////////////////////////////////////////////// Processor* PlaneAdaptive::NewCopy() const { return new PlaneAdaptive(*this); } ////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'E2interf.c' then echo shar: will not over-write existing file "'E2interf.c'" else cat << \SHAR_EOF > 'E2interf.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// /////////// //File E2interf.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) //////////////// #include #include /////////////////////// PLANE::PLANE() { StoreAtomic(new Plane,new PlaneAdaptive); } ////////////////////////////////////////////// PLANE::PLANE(const Point& Center) { StoreAtomic(new Plane(Center),new PlaneAdaptive); } ////////////////////////////////////////////// PLANE::PLANE(const Point& Center, real ScaleX, real ScaleY) { StoreAtomic(new Plane(Center,ScaleX, ScaleY),new PlaneAdaptive); } /////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'E2sec.c' then echo shar: will not over-write existing file "'E2sec.c'" else cat << \SHAR_EOF > 'E2sec.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////// //File E2sec.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 14 Feb 1995 V0.1e(bug fix in transformation) ////////////////////////////////////////// #include #include #include ////////////////////////////////////////// PlaneSector::PlaneSector( const Point& A, const Point& B, const Point& C) :Geometry(2) { if(C==B) { TheCenter=A; } else { real dp = (C-B)*(A-B); Error(dp==0, "Error: trying to construct a plane sector with centre at infinity"); TheCenter = (A+(A-B)*((C-B)*((C+B)/2-A))/dp); }; TheInnerRadius=(TheCenter-A).Length(); Point BB(B-TheCenter), CC(C-TheCenter); TheSmallAngle=atan2(BB.Y(),BB.X()); TheBigAngle=atan2(CC.Y(),CC.X()); if (TheBigAngle<=TheSmallAngle) TheBigAngle += 2*M_PI; } /////////////////////////////////////////////////// PlaneSector::PlaneSector(const Point& O,real r, real theta1, real theta2) : Geometry(2) { TheCenter = O; TheInnerRadius = r; TheSmallAngle = theta1; TheBigAngle = theta2; if (TheSmallAngle == TheBigAngle) TheBigAngle += 2*M_PI; } ///////////////////////////////////////////////////// real PlaneSector::InnerRadius() const { return TheInnerRadius; } //////////////////////////////////////////////////// real PlaneSector::SmallAngle() const { return TheSmallAngle; } ///////////////////////////////////////////////////// real PlaneSector::BigAngle() const { return TheBigAngle; } //////////////////////////////////////////////////// const Point& PlaneSector::Center() const { return TheCenter; } //////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'E2secitf.c' then echo shar: will not over-write existing file "'E2secitf.c'" else cat << \SHAR_EOF > 'E2secitf.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////////// //File E2secitf.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ////////////////////////////////////////////// #include #include ////////////////////////////////////////////// PLANE_SECTOR::PLANE_SECTOR (const Point& A, const Point& B,const Point& C) { StoreAtomic(new PlaneSector(A,B,C),new PlaneSector_Processor); } ////////////////////////////////////////////// PLANE_SECTOR::PLANE_SECTOR (const Point& O, real r , real theta1, real theta2) { StoreAtomic(new PlaneSector(O,r,theta1,theta2), new PlaneSector_Processor); } /////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'E2secprc.c' then echo shar: will not over-write existing file "'E2secprc.c'" else cat << \SHAR_EOF > 'E2secprc.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //////////////////////////////////////////////////// //File E2secprc.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// #include #include #include #include #include #include #include //////////////////////////////////////////////////////// void PlaneSector_Processor::Process( Stack& Offspring) { PlaneSector& G = Geometry(); Point P1(G.InnerRadius(),G.BigAngle()), P2(G.InnerRadius(),G.SmallAngle()); AtomicRegion* A ; A= (AtomicRegion*) SEMI_INFINITE_STRIP(P1,P2); Integrand I1(LocalIntegrand(),new Translation(G.Center())); A->LocalIntegrand(new Integrand(I1, new PolarToRectangular)); Offspring.Push(A); } ///////////////////////////////////////////////// PlaneSector_Processor::PlaneSector_Processor() :Processor() { } ///////////////////////////////////////////////// Processor* PlaneSector_Processor::NewCopy() const { return new PlaneSector_Processor(*this); } //////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'E2tostrp.c' then echo shar: will not over-write existing file "'E2tostrp.c'" else cat << \SHAR_EOF > 'E2tostrp.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////// //File E2tostrp.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) //////////////////////////////////////////////// #include #include #include //////////////////////////////////////////// void E2toIS::Transform(real& w, Point& p) { InfiniteStrip& s = *IS_ptr; Point D = s.B()- s.A(); Point C(-D.Y(),D.X()); C = C/C.Length(); w *= D.Length()*.5*(1-tanh(p.X())*tanh(p.X())); p = s.A() + p.Y()*C + (.5*(1+tanh(p.X())))*D; } /////////////////////////////////////////////////// E2toIS::E2toIS(InfiniteStrip* g) : Transformation(),IS_ptr(g) { } ////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'S2.c' then echo shar: will not over-write existing file "'S2.c'" else cat << \SHAR_EOF > 'S2.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////// //File S2.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ////////////////////////////////////////// #include #include #include #include #include #include #include #include #include //////////////////////////////////////////// Circle::Circle(const Point& Center, real Radius) : Geometry(2), TheCenter(Center), TheRadius(fabs(Radius)) {} /////////////////////////////////////////////// Circle::Circle(const Point& Center, const Point& Boundary) : Geometry(2), TheCenter(Center), TheRadius(sqrt((Center.X()-Boundary.X())*(Center.X()-Boundary.X()) +(Center.Y()-Boundary.Y())*(Center.Y()-Boundary.Y()))) {} /////////////////////////////////////////////// real Circle::Volume() const { return M_PI*TheRadius*TheRadius; } ////////////////////////////////////////////// const Point& Circle::Center() const { return TheCenter; } ///////////////////////////////////////////// real Circle::Radius() const { return TheRadius; } ////////////////////////////////////////////// //Processor* //Circle::DefaultProcessor() //const //{ //return new CircleAdaptive(new Circle_Rule13); //} ///////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'S2adapt.c' then echo shar: will not over-write existing file "'S2adapt.c'" else cat << \SHAR_EOF > 'S2adapt.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////// //File S2adapt.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 30 Jan 1996 V0.1g(no longer compare signed and unsigned) ////////////////////////////////////////// #include #include #include #include #include //////////////////////////////////////////////// void CircleAdaptive::Process(Stack& Offspring) { Circle& C = Geometry(); static unsigned int mxgen=2; //if (mxgen == 0) //{ //cerr<<"How many times may I apply the circle rule? "; //cin>>mxgen; //}; TimesCalled++; if(TimesCalled ==1) { if (GenerationNumber < mxgen) { TheRule->Apply(LocalIntegrand(),C,Integral(),AbsoluteError()); } else { Point rv (C.Radius(),0); Point bp = C.Center()+rv; AtomicRegion* A ; A= (AtomicRegion*) POLAR_RECTANGLE(C.Center(),bp,bp); A->LocalIntegrand(&(LocalIntegrand())); Offspring.Push(A); }; } else { const real CircleRatio = 0.44721359549995793928; Point m1(C.Radius()*CircleRatio ,0.); Point m2(C.Radius() , 0.); Point m3(0.,C.Radius()); Point m4(0.,C.Radius()*CircleRatio); Point origin=C.Center(); AtomicRegion* t1=(AtomicRegion*) POLAR_RECTANGLE(origin+m1,origin+m2,origin+m3); AtomicRegion* t2=(AtomicRegion*) POLAR_RECTANGLE(origin+m4,origin+m3,origin-m2); AtomicRegion* t3=(AtomicRegion*) POLAR_RECTANGLE(origin-m1,origin-m2,origin-m3); AtomicRegion* t4=(AtomicRegion*) POLAR_RECTANGLE(origin-m4,origin-m3,origin+m2); Offspring.Push(t1); Offspring.Push(t2); Offspring.Push(t3); Offspring.Push(t4); Offspring.IteratorReset(); while (!Offspring.IteratorAtEnd()) { Offspring.IteratorNext()->LocalIntegrand(&LocalIntegrand()); }; if (CircleRatio != 0.0) { Circle* tmp = new Circle(origin,C.Radius()*CircleRatio); Atomic* a =new Atomic(tmp,Descendant()); a->LocalIntegrand(&LocalIntegrand()); Offspring.Push(a); }; }; } ////////////////////////////////////////////////// CircleAdaptive::CircleAdaptive(Rule * R) :Processor(),TheRule(R),TimesCalled(0),GenerationNumber(0) { } ///////////////////////////////////////////////////// CircleAdaptive* CircleAdaptive::Descendant() const { CircleAdaptive * CA = new CircleAdaptive (&(*(TheRule))); CA->GenerationNumber = GenerationNumber+1; return CA; } ////////////////////////////////////////////////////// Processor* CircleAdaptive::NewCopy() const { return new CircleAdaptive(*this); } ////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'S2interf.c' then echo shar: will not over-write existing file "'S2interf.c'" else cat << \SHAR_EOF > 'S2interf.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// //File S2interf.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// #include #include #include ///////////////////////////////////////////////////////// CIRCLE::CIRCLE(const Point& c,const Point& b) { StoreAtomic(new Circle(c,b),new CircleAdaptive(new Circle_Rule13)); } ///////////////////////////////////////////////////////// CIRCLE::CIRCLE(const Point& c, real Radius) { StoreAtomic(new Circle(c,Radius),new CircleAdaptive(new Circle_Rule13)); } ///////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'S2rule13.c' then echo shar: will not over-write existing file "'S2rule13.c'" else cat << \SHAR_EOF > 'S2rule13.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //File S2rule13.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // // A cubature formula of degree 13 with 36 points and associated // null rules (Cools & Haegemans). // #include static real facmed = 1.5; static real crival = 0.3; static int K[]={0,3,2,2}; const int NumberOfPoints=K[0]+4*K[1]+4*K[2]+8*K[3]; const int Orbits=K[0]+K[1]+K[2]+K[3]; static real Type1[]= {0.283402832348840340260055531925e+00, 0.649007230578023857142954047869e+00, 0.920575474036255978410400945265e+00}; static real Type2[]= {0.677355106028069632559870394597e+00, 0.412672216763278882147845015245e+00}; static real Type3[2][2]= {{0.335767600829543545504321849367e+00, 0.938694583835106683089433405007e+00}, {0.752042776803937943743749637665e+00, 0.379717011170079696840056017956e+00}}; static real Weight[7][7]= {{0.497326951852944153115255529183e-01, 0.439732090591084987635001867639e-01, 0.221057969395291114959209696751e-01, 0.138071954801617944635783199052e-01, 0.478191639416850908138653549756e-01, 0.579302409092634509107760741653e-02, 0.304879456061841994847272004644e-01}, // Nullrule exact for the first 6 basispolynomials, {-0.8073879159066197e-02, -0.2498315518214109e-01, 0.5349170539028515e-01, 0.3595547716318644e-01, 0.4320518775944201e-01, -0.1967607360410405e-01, -0.3012159438174910e-01}, // Nullrule exact for the first 5 basispolynomials, {0.2175100120594341e-01, -0.7117820786684134e-01, 0.1801191272610644e-01, -0.1775642346529020e-01, -0.2754333027079005e-02, -0.1170796597217573e-01, 0.3767099118575607e-01}, // Nullrule exact for the first 4 basispolynomials, {0.2413156434309756e-01, 0.2327141313816948e-01, 0.3438009174891747e-01, 0.3084063431284037e-01, -0.6858211678704531e-01, -0.2561913343310581e-01, 0.3598340055116032e-02}, // Nullrule exact for the first 3 basispolynomials, {-0.4853627844062673e-01, 0.3645578330411178e-01, 0.4003943562394422e-01, -0.4494496660283691e-01, 0.1266357696444992e-01, -0.2028566592818438e-01, 0.2244689050366323e-01}, // Nullrule exact for the first 2 basispolynomials, {-0.2979266039117054e-01, 0.3977474716810517e-02, -0.4396076050818155e-01, 0.5463380585542593e-01, 0.1777067704103634e-01, -0.2876745680547196e-01, 0.2745318844851159e-01}, // Nullrule exact for the first 1 basispolynomials, {0.6246499865107039e-01, 0.2624836264288300e-01, -0.1903648724133519e-01, -0.2649038633167001e-01, 0.3481279195257287e-01, -0.3459307949232926e-01, -0.4406560344431272e-02}}; // // The error estimator constants // #include #include #include #include //#include #define sqr(x) ((x)*(x)) void Circle_Rule13::Apply(Integrand& F,Circle& R,real& TheResult,real& TheError) { //if (crival<0 || facmed <0) // { // cerr << " crival,facmed? " << endl; // cin >> crival; // cin >> facmed; // }; const real facopt = facmed/(crival*crival); int i,j,p,Type,nr,number; real Null[6]; real Tres = -1.0; real noise,r,r1,r2,Deg5,Deg3,Deg7,sumval; Point x[8]; if (Tres <= 0) { Tres=50*REAL_EPSILON; } TheResult = 0.0; for (i=0;i<6;i++){Null[i]=0;} p=0; for (Type=0;Type <=3;Type++){ for (nr=0;nr= 1) { TheError =10*Deg7; } else { if (r>=crival) { TheError = facmed*r*Deg7; } else { TheError = facopt *r*r*r*Deg7; } } TheError = max(noise,TheError); } TheError *= R.Volume(); TheResult *= R.Volume(); // cout <<"=> Error = "<() { } /////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'T2.c' then echo shar: will not over-write existing file "'T2.c'" else cat << \SHAR_EOF > 'T2.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////// //File T2.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) //////////////////////////////////////////////// #include #include ////////////////////////////////////////////// Triangle::Triangle (const Point& p1,const Point& p2,const Point& p3) : Geometry(2),Vertices(3),TheVolumeKnown(False) { Vertices[0] = p1; Vertices[1] = p2; Vertices[2] = p3; } ////////////////////////////////////////////// void Triangle::ComputeVolume() { TheVolume = fabs( 0.5* ((Vertices[0][0]*Vertices[1][1]-Vertices[1][0]*Vertices[0][1]) +(Vertices[1][0]*Vertices[2][1]-Vertices[2][0]*Vertices[1][1]) +(Vertices[2][0]*Vertices[0][1]-Vertices[0][0]*Vertices[2][1])) ); TheVolumeKnown = True; } /////////////////////////////////////////////// const Point& Triangle::Vertex(int i) const { return Vertices[i]; } ////////////////////////////////////////////////// real Triangle::Volume() const { Triangle* T= (Triangle*) this; if (!TheVolumeKnown) { T->ComputeVolume(); }; return T->TheVolume; } /////////////////////////////////////////////// void Triangle::Volume(real v) { TheVolume = v; TheVolumeKnown = True; } //////////////////////////////////////////////// //Processor* //Triangle::DefaultProcessor() //const //{ //return new SimpleAdaptive( //new Triangle_Rule13, //new Triangle_Divide4); //} //////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'T2dv4.c' then echo shar: will not over-write existing file "'T2dv4.c'" else cat << \SHAR_EOF > 'T2dv4.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////////////// //File T2dv4.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////// #include #include #include ////////////////////////////////////////////////// void Triangle_Divide4::Apply (const Triangle& t,Stack& Offspring, const Vector& D) { Point m12 = (t.Vertex(0)+t.Vertex(1))/2; Point m13 = (t.Vertex(0)+t.Vertex(2))/2; Point m23 = (t.Vertex(2)+t.Vertex(1))/2; Triangle* t1 = new Triangle(t.Vertex(0),m12,m13); Triangle* t2 = new Triangle(t.Vertex(1),m12,m23); Triangle* t3 = new Triangle(t.Vertex(2),m23,m13); Triangle* t4 = new Triangle(m23,m12,m13); Offspring.Push(t1); Offspring.Push(t2); Offspring.Push(t3); Offspring.Push(t4); } ////////////////////////////////////////////////// Triangle_Divide4::Triangle_Divide4() :SameShapeDivisor() { } ////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'T2interf.c' then echo shar: will not over-write existing file "'T2interf.c'" else cat << \SHAR_EOF > 'T2interf.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //////////////////////////////////////////////// //File T2interf.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(typedef introduced) //////////////////////////////////////////////// #include #include #include #include /////////////////////////////////////////////// typedef Rule RuleTriangle; typedef SameShapeDivisor SameShapeDivisorTriangle; TRIANGLE::TRIANGLE(const Point& p1,const Point& p2, const Point& p3) { Pointer R13 (new Triangle_Rule13); Pointer D4 (new Triangle_Divide4); StoreAtomic(new Triangle(p1,p2,p3), new SimpleAdaptive(R13,D4) ); } /////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'T2rule13.c' then echo shar: will not over-write existing file "'T2rule13.c'" else cat << \SHAR_EOF > 'T2rule13.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// //File T2rule13.c //Authors: Berntsen & Espelid (DRLTRI) //C++Translation: Luc Pluym/Ronald Cools // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 28 Mar 1996 V0.1h(redundant variable removed) ///////////////////////////////////////////////////////// #include #include #include #define sqr(x) ((x)*(x)) // coordinates of the quadrature rule static real G1[] = { 0.333333333333333333333333333333e0, 0.950275662924105565450352089520e0, 0.171614914923835347556304795551e0, 0.539412243677190440263092985511e0, 0.772160036676532561750285570113e0, 0.009085399949835353883572964740e0, 0.062277290305886993497083640527e0, 0.022076289653624405142446876931e0, 0.018620522802520968955913511549e0, 0.096506481292159228736516560903e0, 0.851306504174348550389457672223e0, 0.689441970728591295496647976487e0, 0.635867859433872768286976979827e0}; static real G2[] = { 0.333333333333333333333333333333e0, 0.024862168537947217274823955239e0, 0.414192542538082326221847602214e0, 0.230293878161404779868453507244e0, 0.113919981661733719124857214943e0, 0.495457300025082323058213517632e0, 0.468861354847056503251458179727e0, 0.851306504174348550389457672223e0, 0.689441970728591295496647976487e0, 0.635867859433872768286976979827e0, 0.022076289653624405142446876931e0, 0.018620522802520968955913511549e0, 0.096506481292159228736516560903e0}; // // Weights of the degree 13 quadrature rule. // static real W[] = {0.051739766065744133555179145422e0, 0.008007799555564801597804123460e0, 0.046868898981821644823226732071e0, 0.046590940183976487960361770070e0, 0.031016943313796381407646220131e0, 0.010791612736631273623178240136e0, 0.032195534242431618819414482205e0, 0.015445834210701583817692900053e0, 0.017822989923178661888748319485e0, 0.037038683681384627918546472190e0, 0.015445834210701583817692900053e0, 0.017822989923178661888748319485e0, 0.037038683681384627918546472190e0}; // Weights of the first null rule of degree 7. static real W71[] = {-0.077738051051462052051304462750e0, 0.001640389740236881582083124927e0, 0.078124083459915167386776552733e0, -0.030706528522391137165581298102e0, 0.010246307817678312345028512621e0, 0.012586300774453821540476193059e0, -0.043630506151410607808929481439e0, -0.004567055157220063810223671248e0, 0.003393373439889186878847613140e0, 0.000000000000000000000000000000e0, -0.004567055157220063810223671248e0, 0.003393373439889186878847613140e0, 0.000000000000000000000000000000e0}; // Weights of the second null rule of degree 7. static real W72[] = {-0.064293709240668260928898888457e0, 0.003134665264639380635175608661e0, 0.007822550509742830478456728602e0, 0.048653051907689492781049400973e0, 0.032883327334384971735434067029e0, -0.017019508374229390108580829589e0, 0.025973557893399824586684707198e0, -0.010716753326806275930657622320e0, 0.018315629578968063765722278290e0, -0.047607080313197299401024682666e0, -0.010716753326806275930657622320e0, 0.018315629578968063765722278290e0, -0.047607080313197299401024682666e0}; // Weights of the first degree 5 null rule. static real W51[] = {0.021363205584741860993131879186e0, 0.022716410154120323440432428315e0, -0.026366191271182090678117381002e0, 0.029627021479068212693155637482e0, 0.004782834546596399307634111034e0, 0.004178667433984132052378990240e0, -0.065398996748953861618846710897e0, -0.033589813176131630980793760168e0, 0.033018320112481615757912576257e0, 0.012241086002709814125707333127e0, -0.033589813176131630980793760168e0, 0.033018320112481615757912576257e0, 0.012241086002709814125707333127e0}; // Weights of the second degree 5 null rule. static real W52[] = { -0.046058756832790538620830792345e0, 0.005284159186732627192774759959e0, 0.009325799301158899112648198129e0, -0.006101110360950124560783393745e0, -0.056223328794664871336486737231e0, -0.062516479198185693171971930698e0, 0.022428226812039547178810743269e0, -0.000026014926110604563130107142e0, 0.032882099937471182365626663487e0, 0.018721740987705986426812755881e0, -0.000026014926110604563130107142e0, 0.032882099937471182365626663487e0, 0.018721740987705986426812755881e0}; // Weights of first degree 3 null rule. static real W31[] = {0.080867117677405246540283712799e0, -0.033915806661511608094988607349e0, 0.014813362053697845461526433401e0, 0.001442315416337389214102507204e0, -0.024309696484708683486455879210e0, -0.005135085639122398522835391664e0, -0.034649417896235909885490654650e0, 0.035748423431577326597742956780e0, 0.024548155266816447583155562333e0, -0.032897267038856299280541675107e0, 0.035748423431577326597742956780e0, 0.024548155266816447583155562333e0, -0.032897267038856299280541675107e0}; // Weights of second degree 3 null rule. static real W32[] = {-0.038457863913548248582247346193e0, -0.055143631258696406147982448269e0, -0.021536994314510083845999131455e0, 0.001547467894857008228010564582e0, 0.057409361764652373776043522086e0, -0.040636938884669694118908764512e0, -0.020801144746964801777584428369e0, 0.019490770404993674256256421103e0, 0.002606109985826399625043764771e0, 0.023893703367437102825618048130e0, 0.019490770404993674256256421103e0, 0.002606109985826399625043764771e0, 0.023893703367437102825618048130e0}; // Weights of first degree 1 null rule. static real W11[] = {0.074839568911184074117081012527e0, -0.004270103034833742737299816615e0, 0.049352639555084484177095781183e0, 0.048832124609719176627453278550e0, 0.001042698696559292759051590242e0, -0.044445273029113458906055765365e0, -0.004670751812662861209726508477e0, -0.015613390485814379318605247424e0, -0.030581651696100000521074498679e0, 0.010801113204340588798240297593e0, -0.015613390485814379318605247424e0, -0.030581651696100000521074498679e0, 0.010801113204340588798240297593e0}; // Weights of second degree 1 null rule. static real W12[] = {0.009373028261842556370231264134e0, -0.074249368848508554545399978725e0, 0.014709707700258308001897299938e0, 0.009538502545163567494354463302e0, -0.014268362488069444905870465047e0, 0.040126396495352694403045023109e0, 0.028737181842214741174950928350e0, -0.031618075834734607275229608099e0, 0.016879961075872039084307382161e0, 0.010878914758683152984395046434e0, -0.031618075834734607275229608099e0, 0.016879961075872039084307382161e0, 0.010878914758683152984395046434e0}; void Triangle_Rule13::Apply(Integrand& F,Triangle& t,real& TheResult,real& TheError) { real Null71,Null72,Null51,Null52,Null31,Null32,Null11,Null12; const int Wtleng =13; real Tres = -1.0; real tune = 1.0; real f,Z1,Z2,Z3; real noise,r,r1,r2,r3,DEG1,DEG3,DEG5,DEG7; Point X[3],Center; int i,l; real cvmax,cvmin,fmmax,fmmin, crival,facmed,facopt; // // The abscissas are given in homogeneous coordinates. // // *FIRST EXECUTABLE STATEMENT DRLT2A cvmax = 0.5; cvmin = 0.9; crival = tune*cvmax + (1-tune)*cvmin; fmmax = 10; fmmin = 0.1; facmed = tune*fmmax + (1-tune)*fmmin; facopt = facmed/(crival*crival); if (Tres <= 0) { Tres=50*REAL_EPSILON; }; // Compute contributions from the center of the triangle. Center = (t.Vertex(0)+t.Vertex(1)+t.Vertex(2))/3; f = F(Center); TheResult = W[0]*f; Null71 = W71[0]*f; Null72 = W72[0]*f; Null51 = W51[0]*f; Null52 = W52[0]*f; Null31 = W31[0]*f; Null32 = W32[0]*f; Null11 = W11[0]*f; Null12 = W12[0]*f; // Compute contributions from points with // multiplicity 3. for (i=1;i= 1) { TheError =10*max(max(max(DEG1,DEG3),DEG5),DEG7); } else { if (r>=crival) { TheError = facmed*r*DEG7; } else { TheError = facopt *r*r*r*DEG7; }; }; TheError = max(noise,TheError); }; TheError *= t.Volume(); TheResult *=t.Volume(); TheError = min(fabs(TheResult),TheError); // **END DRLTRI } ///////////////////////////////////////////////////////// Triangle_Rule13::Triangle_Rule13() :Rule() { } ///////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'T2tops.c' then echo shar: will not over-write existing file "'T2tops.c'" else cat << \SHAR_EOF > 'T2tops.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : T2tops.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// #include ///////////////////////////////////////////////////////// T2toPS::T2toPS(ParabolicSegment* p) : Transformation(), P(p->P()), M((p->A()+p->B())/2), H((p->B()-p->A())/2) { a= -0.5* (P-M).Length(); k= H.X()*(P.Y()-M.Y())-H.Y()*(P.X()-M.X()); k*=a; } //////////////////////////////////////////////////////// void T2toPS::Transform(real & w, Point& p) { if (p.X()<0) { real X = p.X(); real Y = a*(X-1)*p.Y(); p= M+X*H+Y*(P-M); w *= k*(X-1); } else { real X = p.X(); real Y = -a*(X+1)*p.Y(); p= M+X*H+Y*(P-M); w *= -k*(X+1); }; } ///////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'atomic.c' then echo shar: will not over-write existing file "'atomic.c'" else cat << \SHAR_EOF > 'atomic.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////////// //File atomic.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////// #include ///////////////////////////////////////////// template Atomic::Atomic(GEOMETRY* g, Processor* p) :AtomicRegion(),G_ptr(g),RP_ptr(p),I_ptr( new Integrand) { p->LocalAtomic(this); } ////////////////////////////////////////////// template void Atomic::Use(Processor* p) { RP_ptr =p; p->LocalAtomic(this); } //////////////////////////////////////////// template void Atomic::Process(Stack& Offspring) { RP_ptr->Process(Offspring); } //////////////////////////////////////////// template void Atomic::LocalIntegrand(Integrand* i) { I_ptr = i; } ////////////////////////////////////////////// template RegionInfo* Atomic::LocalRegionInfo() { return &(LocalInfo()); } /////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'atomreg.c' then echo shar: will not over-write existing file "'atomreg.c'" else cat << \SHAR_EOF > 'atomreg.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //////////////////////////////////////////////// //File atomreg.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) //////////////////////////////////////////////// #include //////////////////////////////////////////////// AtomicRegion::AtomicRegion() :Region() { } ///////////////////////////////////////////////// AtomicRegion::~AtomicRegion() { } ////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'boolean.c' then echo shar: will not over-write existing file "'boolean.c'" else cat << \SHAR_EOF > 'boolean.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //////////////////////////////////////////////// //File boolean.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) //////////////////////////////////////////////// #include #include ostream& operator << (ostream& os, const Boolean& b) { if (b==False) { os<< "False "; } else { os<< "True "; }; return os; } SHAR_EOF fi # end of overwriting check if test -f 'chrono.c' then echo shar: will not over-write existing file "'chrono.c'" else cat << \SHAR_EOF > 'chrono.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// //File chrono.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 28 Mar 1996 V0.1h(long instead of int) ///////////////////////////////////////////////////////// #include #ifdef GETRUSAGE #include #include #endif ///////////////////////////////////////////////////////// Chrono::Chrono() { Reset(); } ///////////////////////////////////////////////////////// void Chrono::Start() { if ( !Running) { Time= OldTime = times_(); Running =True; }; } ///////////////////////////////////////////////////////// void Chrono::Stop() { if (Running) { Time = times_(); Running =False; }; } ///////////////////////////////////////////////////////// void Chrono::Reset() { Time=0; OldTime=0; Running = False; } ///////////////////////////////////////////////////////// unsigned long Chrono::Read() { if (Running) { return (times_() - OldTime); } else { return (Time -OldTime); }; } ///////////////////////////////////////////////////////// long Chrono::times_ () { long t=0; #ifdef GETRUSAGE struct rusage info ; struct timeval *user_t = &(info.ru_utime), *sys_t = &(info.ru_stime) ; getrusage (0, &info) ; t += user_t->tv_sec * 1000 + user_t->tv_usec / 1000 ; t += sys_t->tv_sec * 1000 + sys_t->tv_usec / 1000 ; #endif return t; } ///////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'compreg.c' then echo shar: will not over-write existing file "'compreg.c'" else cat << \SHAR_EOF > 'compreg.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////// //File compreg.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ////////////////////////////////////////////////// #include #include ///////////////////////////////////////////////// COMPOUND_REGION::COMPOUND_REGION() : Region(),TheStatus(Virgin) { } ////////////////////////////////////////////////// void COMPOUND_REGION::Process() { Error(Hopeless(),"Processing a hopeless COMPOUND_REGION"); if (TheStatus==Virgin) { TheStatus= Active; Preprocess(); } else { Improve(); } } //////////////////////////////////////////////////// COMPOUND_REGION::~COMPOUND_REGION() { } ///////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'deccxxtp.c' then echo shar: will not over-write existing file "'deccxxtp.c'" else cat << \SHAR_EOF > 'deccxxtp.c' // This file is needed by cxx, The Decalpha C++ compiler. // // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // #include #include #include #include #include #include #include /////////////////////////////////////////////////////////////// #include #pragma define_template SimpleAdaptive #pragma define_template SimpleAdaptive /////////////////////////////////////////////////////////////// #include #pragma define_template Set /////////////////////////////////////////////////////////////// #include #pragma define_template Stack #pragma define_template Stack #pragma define_template Stack #pragma define_template Stack /////////////////////////////////////////////////////////////// #include #pragma define_template Vector #pragma define_template Vector #pragma define_template Vector #pragma define_template Vector< Pointer > /////////////////////////////////////////////////////////////// #include #pragma define_template VectorStack< Pointer < Transformation > > /////////////////////////////////////////////////////////////// #include #pragma define_template SubHeap #pragma define_template Heap /////////////////////////////////////////////////////////////// #include #pragma define_template Atomic #pragma define_template Atomic #pragma define_template Atomic #pragma define_template Atomic #pragma define_template Atomic #pragma define_template Atomic #pragma define_template Atomic #pragma define_template Atomic #pragma define_template Atomic #pragma define_template Atomic #pragma define_template Atomic #pragma define_template Atomic /////////////////////////////////////////////////////////////// #include #pragma define_template Divisor #pragma define_template Divisor /////////////////////////////////////////////////////////////// #include #pragma define_template PassTheBuck #pragma define_template PassTheBuck #pragma define_template PassTheBuck #pragma define_template PassTheBuck #pragma define_template PassTheBuck /////////////////////////////////////////////////////////////// #include #pragma define_template Pointer > #pragma define_template Pointer #pragma define_template Pointer #pragma define_template Pointer #pragma define_template Pointer #pragma define_template Pointer #pragma define_template Pointer #pragma define_template Pointer #pragma define_template Pointer #pragma define_template Pointer #pragma define_template Pointer #pragma define_template Pointer #pragma define_template Pointer #pragma define_template Pointer #pragma define_template Pointer #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer > #pragma define_template Pointer /////////////////////////////////////////////////////////////// #include #pragma define_template Processor #pragma define_template Processor #pragma define_template Processor #pragma define_template Processor #pragma define_template Processor #pragma define_template Processor #pragma define_template Processor #pragma define_template Processor #pragma define_template Processor #pragma define_template Processor #pragma define_template Processor #pragma define_template Processor /////////////////////////////////////////////////////////////// #include #pragma define_template Rule #pragma define_template Rule #pragma define_template Rule /////////////////////////////////////////////////////////////// #include #pragma define_template SameShapeDivisor #pragma define_template SameShapeDivisor /////////////////////////////////////////////////////////////// #include #pragma define_template USERINTERFACE #pragma define_template USERINTERFACE #pragma define_template USERINTERFACE #pragma define_template USERINTERFACE #pragma define_template USERINTERFACE #pragma define_template USERINTERFACE #pragma define_template USERINTERFACE #pragma define_template USERINTERFACE #pragma define_template USERINTERFACE #pragma define_template USERINTERFACE #pragma define_template USERINTERFACE #pragma define_template USERINTERFACE /////////////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'div.c' then echo shar: will not over-write existing file "'div.c'" else cat << \SHAR_EOF > 'div.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////// //File div.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////// #include ///////////////////////////////////////////////// template Divisor::Divisor() :ReferenceCounting() { } ////////////////////////////////////////////////// template Divisor::~Divisor() { } ////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'eval_ctr.c' then echo shar: will not over-write existing file "'eval_ctr.c'" else cat << \SHAR_EOF > 'eval_ctr.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////// //File eval_ctr.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 28 Mar 1996 V0.1h(long instead of int) ///////////////////////////////////////////// #include #include ///////////////////////////////////////////// EvaluationCounter::EvaluationCounter() { Reset(); } ///////////////////////////////////////////// void EvaluationCounter::Start() { if (!Running) { Strt = Integrand::NumberOfEvaluations(); End =Strt; Running = True; }; } ///////////////////////////////////////////// void EvaluationCounter::Stop() { if (Running) { End =Integrand::NumberOfEvaluations(); Running = False; }; } ///////////////////////////////////////////// void EvaluationCounter::Reset() { Bias =0; Strt=Integrand::NumberOfEvaluations(); End =Strt; Running = False; } ///////////////////////////////////////////// void EvaluationCounter::Reset(unsigned long v) { Bias =v; Strt=Integrand::NumberOfEvaluations(); End =Strt; Running = False; } ///////////////////////////////////////////// unsigned long EvaluationCounter::Read() { if (Running) { return Integrand::NumberOfEvaluations()-Strt+ Bias; } else { return End - Strt+ Bias; }; } ///////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'geometry.c' then echo shar: will not over-write existing file "'geometry.c'" else cat << \SHAR_EOF > 'geometry.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////////////// //File geometry.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) /////////////////////////////////////////////////// #include /////////////////////////////////////////////////// Geometry::Geometry(unsigned int Dim) :ReferenceCounting(),TheDimension(Dim) { } /////////////////////////////////////////////////// unsigned int Geometry::Dimension() const { return TheDimension; } ////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'gnu262tp.c' then echo shar: will not over-write existing file "'gnu262tp.c'" else cat << \SHAR_EOF > 'gnu262tp.c' // This file is needed by gcc v2.6.2 . // One has to compile with option -fno-implicit-templates. // // History: // (date) (version) // 28 Nov 1994 V0.1 (first limited distribution) // #include #include #include #include #include #include #include /////////////////////////////////////////////////////////////// #include template class SimpleAdaptive; template class SimpleAdaptive; /////////////////////////////////////////////////////////////// #include template class Set; /////////////////////////////////////////////////////////////// #include template class Stack; template class Stack; template class Stack; template class Stack; /////////////////////////////////////////////////////////////// #include template class Vector; template class Vector; template class Vector; template class Vector< Pointer >; /////////////////////////////////////////////////////////////// #include template class VectorStack< Pointer < Transformation > >; /////////////////////////////////////////////////////////////// #include template class SubHeap; template class Heap; /////////////////////////////////////////////////////////////// #include template class Atomic; template class Atomic; template class Atomic; template class Atomic; template class Atomic; template class Atomic; template class Atomic; template class Atomic; template class Atomic; template class Atomic; template class Atomic; template class Atomic; /////////////////////////////////////////////////////////////// #include template class Divisor; template class Divisor; /////////////////////////////////////////////////////////////// #include template class PassTheBuck; template class PassTheBuck; template class PassTheBuck; template class PassTheBuck; template class PassTheBuck; /////////////////////////////////////////////////////////////// #include template class Pointer >; template class Pointer; template class Pointer; template class Pointer; template class Pointer; template class Pointer; template class Pointer; template class Pointer; template class Pointer; template class Pointer; template class Pointer; template class Pointer; template class Pointer; template class Pointer; template class Pointer; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer >; template class Pointer; /////////////////////////////////////////////////////////////// #include template class Processor; template class Processor; template class Processor; template class Processor; template class Processor; template class Processor; template class Processor; template class Processor; template class Processor; template class Processor; template class Processor; template class Processor; /////////////////////////////////////////////////////////////// #include template class Rule; template class Rule; template class Rule; /////////////////////////////////////////////////////////////// #include template class SameShapeDivisor; template class SameShapeDivisor; /////////////////////////////////////////////////////////////// #include template class USERINTERFACE; template class USERINTERFACE; template class USERINTERFACE; template class USERINTERFACE; template class USERINTERFACE; template class USERINTERFACE; template class USERINTERFACE; template class USERINTERFACE; template class USERINTERFACE; template class USERINTERFACE; template class USERINTERFACE; template class USERINTERFACE; /////////////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'gr.c' then echo shar: will not over-write existing file "'gr.c'" else cat << \SHAR_EOF > 'gr.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //////////////////////////////////////////// //File gr.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////// #include #include #include #include ////////////////////////////////////////////// GeneralizedRectangle::GeneralizedRectangle(Function f,const Point& a,const Point& b) :Geometry(2),TheBoundary(f),TheA(a),TheB(b) { } //////////////////////////////////////////// const Point& GeneralizedRectangle::A() const { return TheA; } /////////////////////////////////////////// const Point& GeneralizedRectangle::B() const { return TheB; } ///////////////////////////////////////////// real GeneralizedRectangle::Boundary(const Point& p) const { return ((GeneralizedRectangle*)this)->TheBoundary(p); } ////////////////////////////////////////// //Processor* //GeneralizedRectangle::DefaultProcessor() //const //{ //Point a(0,0),b(1,0),c(0,1); //Parallelogram* R= new Parallelogram(a,b,c); //return new //PassTheBuck(R); //} //////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'gritf.c' then echo shar: will not over-write existing file "'gritf.c'" else cat << \SHAR_EOF > 'gritf.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //////////////////////////////////////////////// //File gritf.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ////////////////////////////////////////////// #include #include #include #include #include #include ////////////////////////////////////////////// GENERALIZED_RECTANGLE::GENERALIZED_RECTANGLE(Function f,const Point& a,const Point& b) :USERINTERFACE() { Point A(0,0),B(1,0),C(0,1); PARALLELOGRAM R(A,B,C); StoreAtomic(new GeneralizedRectangle(f,a,b), new PassTheBuck((AtomicRegion*)R)); } /////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'gs.c' then echo shar: will not over-write existing file "'gs.c'" else cat << \SHAR_EOF > 'gs.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : gs.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// #include //////////////////////////////////////////////////////// GeneralizedSector::GeneralizedSector(real (*f)(real) ,real a,real b,const Point& C) :Geometry(2),TheCenter(C),TheAlpha(a),TheBeta(b),TheBoundary(f) { } ///////////////////////////////////////////////////////// real GeneralizedSector::Alpha() const { return TheAlpha; } ////////////////////////////////////////////////////////// real GeneralizedSector::Beta() const { return TheBeta; } ////////////////////////////////////////////////////////// const Point& GeneralizedSector::Center() const { return TheCenter; } ////////////////////////////////////////////////////////// real GeneralizedSector::Boundary(real p) const { GeneralizedSector* G= (GeneralizedSector*) this; return G->TheBoundary(p); } /////////////////////////////////////////////////////////// RealFunction GeneralizedSector::Boundary() const { return TheBoundary; } ///////////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'gsitf.c' then echo shar: will not over-write existing file "'gsitf.c'" else cat << \SHAR_EOF > 'gsitf.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //////////////////////////////////////////////// //File gsitf.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ////////////////////////////////////////////// #include #include #include ////////////////////////////////////////////// GENERALIZED_SECTOR::GENERALIZED_SECTOR(real (*F)(real), real a, real b, const Point& Center) :USERINTERFACE() { StoreAtomic(new GeneralizedSector(F,a,b,Center), new GeneralizedSector_Processor); } /////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'gsprc.c' then echo shar: will not over-write existing file "'gsprc.c'" else cat << \SHAR_EOF > 'gsprc.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //////////////////////////////////////////////////// //File polC2prc.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// #include #include #include #include #include #include #include //////////////////////////////////////////////////////// // LOCAL CLASS ////////////////////////////////////////// class VariableScaling : public Transformation { private: real (*B) (real); public: VariableScaling(real(*b)(real)) :Transformation(),B(b) {}; void Transform( real& w, Point& p) { p.R() = B(p.Theta())*p.R(); w*= B(p.Theta()); }; }; /////////////////////////////////////////////////////////// void GeneralizedSector_Processor::Process( Stack& Offspring) { GeneralizedSector& G = Geometry(); Point P1(0,G.Alpha()), P2(0,G.Beta()), P3(1,G.Alpha()); AtomicRegion* A ; A= (AtomicRegion*) PARALLELOGRAM(P1,P2,P3); Integrand I1(LocalIntegrand(),new Translation(G.Center())); Integrand I2(I1, new PolarToRectangular); A->LocalIntegrand(new Integrand(I2, new VariableScaling(G.Boundary()))); Offspring.Push(A); } ///////////////////////////////////////////////// GeneralizedSector_Processor::GeneralizedSector_Processor() :Processor() { } ///////////////////////////////////////////////// Processor* GeneralizedSector_Processor::NewCopy() const { return new GeneralizedSector_Processor(*this); } ///////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'heap.c' then echo shar: will not over-write existing file "'heap.c'" else cat << \SHAR_EOF > 'heap.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// /////////////////////////////////////////////// //File heap.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 30 Jan 1996 V0.1g(good for old and new ANSI for-scope) /////////////////////////////////////////////// #include #include #include #include ////////////////////////////////////////////// template SubHeap::SubHeap() :Set() { ActiveChild = -1; LastChild = -1; } //////////////////////////////////////////////// template SubHeap::~SubHeap() { Clear(); } /////////////////////////////////////////////// template T* SubHeap::Get() { Error(Number == 0,"error:get from empty heap"); if(Number ==1) { Number--; return Contents[1]; }; T* B =Bottom(); if (LastChild == CAPACITY && Children[ActiveChild]->Saturated()) { ActiveChild--; if(ActiveChild<0) ActiveChild =CAPACITY; }; T* Result = Contents[1]; int Hole = 1; int First= 2; int Second= 3; while (Second <= Number) { if ((*B >= *Contents[First]) &&(*B >= *Contents[Second])) { goto putinhole; } else { if(*Contents[First] >= *Contents[Second]) { Contents[Hole] = Contents[First]; Hole = First; First = 2*Hole; Second = First +1; } else { Contents[Hole] = Contents [Second]; Hole = Second; First = 2*Hole; Second = First+1; }; }; }; if (First == Number) { if (*B >= *Contents[First]) { goto putinhole; } else { Contents[Hole] = Contents [First]; Hole = First; }; }; putinhole: Contents[Hole] = B; if((CAPACITY+1)/2<=Hole && Hole <=CAPACITY) { First =LeftChild(Hole); Second =RightChild(Hole); if (LastChild >=Second) { if( *Contents[Hole] < *Children[Second]->Look() ||*Contents[Hole] < *Children[First]->Look()) { if(*Children[First]->Look() > *Children[Second]->Look()) { B=Children[First]->Swap(Contents[Hole]); Contents[Hole]=B; } else { B=Children[Second]->Swap(Contents[Hole]); Contents[Hole]=B; }; }; }; if(LastChild ==First) { if (*Contents[Hole] <*Children[First]->Look()) { B=Children[First]->Swap(Contents[Hole]); Contents[Hole]=B; }; }; }; return Result; } /////////////////////////////////////////////////// template T* SubHeap::Look() { Error(Number==0,"Looking at empty heap"); return Contents [1]; } /////////////////////////////////////////////////// template T* SubHeap::Swap(T* B) { T* Result = Contents[1]; int Hole =1; int First =2; int Second =3; while (Second <= Number) { if ((*B > *Contents[First]) &&(*B > *Contents[Second])) { goto putinhole; } else { if(*Contents[First] > *Contents[Second]) { Contents[Hole] = Contents[First]; Hole = First; First = 2*Hole; Second = First +1; } else { Contents[Hole] = Contents [Second]; Hole = Second; First = 2*Hole; Second = First+1; }; }; }; if (First == Number-1) { if (*B > *Contents[First]) { goto putinhole; } else { Contents[Hole] = Contents [First]; Hole = Number-1; }; }; putinhole: Contents[Hole] = B; if((CAPACITY+1)/2<=Hole && Hole <=CAPACITY) { First =LeftChild(Hole); Second =RightChild(Hole); if (LastChild >=Second) { if( *Contents[Hole] < *Children[Second]->Look() ||*Contents[Hole] < *Children[First]->Look()) { if(*Children[First]->Look() > *Children[Second]->Look()) { B=Children[First]->Swap(Contents[Hole]); Contents[Hole]=B; } else { B=Children[Second]->Swap(Contents[Hole]); Contents[Hole]=B; }; }; }; if(LastChild ==First) { if (*Contents[Hole] <*Children[First]->Look()) { B=Children[First]->Swap(Contents[Hole]); Contents[Hole]=B; }; }; }; return Result; } /////////////////////////////////////////////////// template Boolean SubHeap::Saturated() const { if (Number!=CAPACITY) return False; if (LastChild <0) return True; if (LastChild !=CAPACITY) return False; Boolean Return = True; for (int i=0;iSaturated()); }; return Return; } //////////////////////////////////////////////////// template T* SubHeap::Bottom() { Error(Number==0,"error:Bottom of empty subheap"); if (ActiveChild >=0) { T* Return = Children[ActiveChild]->Bottom(); if(Children[ActiveChild]->Size()==0) { delete Children[ActiveChild]; ActiveChild--; LastChild--; }; return Return; } else { T* Return =Contents[Number]; Number--; return Return; }; } //////////////////////////////////////////////////// template void SubHeap::operator +=(T* t) { T* NewT; int Hole; if(ActiveChild>=0) { if(Children[ActiveChild]->Saturated()) { ActiveChild++; ActiveChild%=(CAPACITY+1); if (ActiveChild>LastChild) { LastChild=ActiveChild; Children[ActiveChild]=new SubHeap; Error(!Children[ActiveChild],"heap:allocation failed"); }; }; *Children[ActiveChild] +=t; if (*Children[ActiveChild]->Look() > *Contents[FatherOfChild(ActiveChild)]) { NewT =Children[ActiveChild]->Swap(Contents[FatherOfChild(ActiveChild)]); Hole =FatherOfChild(ActiveChild); } else { return; }; } else { if (Number==CAPACITY) { ActiveChild=LastChild=0; Children[ActiveChild] = new SubHeap; Error(!Children[ActiveChild],"heap:allocation failed"); *Children[ActiveChild] +=t; if (*t > *Contents[FatherOfChild(ActiveChild)]) { NewT =Children[ActiveChild]->Swap(Contents[FatherOfChild(ActiveChild)]); Hole =FatherOfChild(ActiveChild); } else { return; }; } else { Number++; NewT = t; Hole = Number; }; }; int Father = Hole/2; while (Father > 0) { if (*Contents[Father] > *NewT) { break; } else { Contents [Hole] = Contents[Father]; Hole = Father; Father = Hole / 2; }; }; Contents [Hole] = NewT; } //////////////////////////////////////////////////// template void SubHeap::Clear() { int i; for (i=0;i<=LastChild;i++) { Children [i] ->Clear(); delete Children[i]; }; for (i=1;i<=Number;i++) { delete Contents [i]; }; ActiveChild=-1; LastChild =-1; Number =0; } //////////////////////////////////////////////////// template void SubHeap::Print() const { int i; for (i=1;i<=Number;i++) { cout <AbsoluteError()<Print(); }; } /////////////////////////////////////////////////// template int SubHeap::FatherOfChild(int i) const { return i/2 + (CAPACITY +1)/2; } /////////////////////////////////////////////////// template int SubHeap::LeftChild(int i) const { return 2*(i-(CAPACITY+1)/2); } ////////////////////////////////////////////////// template int SubHeap::RightChild(int i) const { return LeftChild(i) +1; } //////////////////////////////////////////////////// ///HEAP //////////////////////////////////////////////////// template Heap::Heap() :Set() { } //////////////////////////////////////////////// template T* Heap::Look() { return TheSubHeap.Look(); } /////////////////////////////////////////////////// template T* Heap::Get() { Error(Number == 0,"error:get from empty heap"); Number--; return TheSubHeap.Get(); } /////////////////////////////////////////////////// template void Heap::operator +=( T* t) { Number++; TheSubHeap +=t; } //////////////////////////////////////////////////// template void Heap::Clear() { Number =0; TheSubHeap.Clear(); } //////////////////////////////////////////////////// template void Heap::operator+=(Heap& h) { int n = h.Number; for (int i=0;i void Heap::Print() const { cout<< "Heap"< Heap::~Heap() { Clear(); } ////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'integran.c' then echo shar: will not over-write existing file "'integran.c'" else cat << \SHAR_EOF > 'integran.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// /////////////////////////////////////////////////// //File integran.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 9 Sep 1994 V0.1a(operator added) // 10 Sep 1994 V0.1b(constructors of ReferenceCounting added) // 25 Jan 1996 V0.1f(unused parameter removed) // 30 Jan 1996 V0.1g(no longer compare signed and unsigned) // 28 Mar 1996 V0.1h(long instead of int) ////////////////////////////////////////////////// #include #include #include #include #include ////////////////////////////////////////////////// long Integrand::Number = 0; ////////////////////////////////////////////////////// Integrand::Integrand (real (*f)(const Point&)) :TheFunction(f),AppliedTransformations() ,ReferenceCounting() { } //////////////////////////////////////////////// Integrand::Integrand(const Integrand& I, Transformation* T) : TheFunction(I.TheFunction), AppliedTransformations(I.AppliedTransformations) ,ReferenceCounting(I) { Pointer p=T; AppliedTransformations += p; } ///////////////////////////////////////////////////////// Integrand::Integrand(const Integrand& I) : TheFunction(I.TheFunction), AppliedTransformations(I.AppliedTransformations) ,ReferenceCounting(I) { } //////////////////////////////////////////////// long Integrand::NumberOfEvaluations() { return Number; } ////////////////////////////////////////////////////// real Integrand::operator() (const Point& StartingPoint) { real JacProd =1; Point p =StartingPoint; for (unsigned int i=0; JacProd!=0 && iTransform(JacProd,p); }; if (JacProd == 0) return 0.0; real R = TheFunction(p)*fabs(JacProd); Number++; return R; } //////////////////////////////////////////////// real ErrorMessage(const Point&) { Error(True,"Error : Attempt to integrate without knowing integrand"); return 0; } Integrand::Integrand() :TheFunction(ErrorMessage),AppliedTransformations() ,ReferenceCounting() { } /////////////////////////////////////////////// Boolean Integrand::operator==(const Integrand& i) const { if ((AppliedTransformations.Size() > 0 ) || (i.AppliedTransformations.Size() > 0 )) return False; return (Boolean)(TheFunction == i.TheFunction); } /////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'integrat.c' then echo shar: will not over-write existing file "'integrat.c'" else cat << \SHAR_EOF > 'integrat.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////// //File integrat.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////// #include #include #include #include #include #include //////////////////////////////////////////////// void Integrate ( COMPOUND_REGION& R, real& Integral, real& AbsError, Boolean& Success, real AbsErrReq, real RelErrReq, unsigned long MaxEval) { EvaluationCounter E; E.Start(); do { if (R.Hopeless()) break; R.Process(); } while (R.AbsoluteError() > AbsErrReq && R.AbsoluteError() > fabs(R.Integral())*RelErrReq && E.Read() < MaxEval); Success = (Boolean)(R.AbsoluteError() <= AbsErrReq || R.AbsoluteError() <= fabs(R.Integral()*RelErrReq)); Integral = R.Integral(); AbsError = R.AbsoluteError(); } ///////////////////////////////////////////////////////// real Integrate ( COMPOUND_REGION& R, real AbsErrReq, real RelErrReq, unsigned long MaxEval) { real Integral; real AbsError; Boolean Success; Integrate(R,Integral,AbsError,Success,AbsErrReq,RelErrReq,MaxEval); return Integral; } ///////////////////////////////////////////////////////// void Integrate ( Function f, COMPOUND_REGION& R, real& Integral, real& AbsError, Boolean& Success, real AbsErrReq, real RelErrReq, unsigned long MaxEval) { R.LocalIntegrand(new Integrand(f)); Integrate(R,Integral,AbsError,Success,AbsErrReq,RelErrReq,MaxEval); } ///////////////////////////////////////////////////////// real Integrate ( Function f, COMPOUND_REGION& R, real AbsErrReq, real RelErrReq, unsigned long MaxEval) { R.LocalIntegrand(new Integrand(f)); real Integral; real AbsError; Boolean Success; Integrate(R,Integral,AbsError,Success,AbsErrReq,RelErrReq,MaxEval); return Integral; } ///////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'invert.c' then echo shar: will not over-write existing file "'invert.c'" else cat << \SHAR_EOF > 'invert.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////// //File invert.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) //////////////////////////////////////////////////////// #include /////////////////////////////////////////////////////// Invert::Invert(Circle* C) :Transformation(), C_ptr(C), RadiusSq(C->Radius()*C->Radius()) { } ////////////////////////////////////////// void Invert::Transform (real &w, Point& p) { const Point diff = p-C_ptr->Center(); real r=diff.Length(); real ratio=RadiusSq/(r*r); p = C_ptr->Center()+diff*ratio; w *= ratio*ratio; } ///////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'outS2.c' then echo shar: will not over-write existing file "'outS2.c'" else cat << \SHAR_EOF > 'outS2.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// /////////////////////////////////////////////// //File outS2.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) //////////////////////////////////////////////// #include #include #include //////////////////////////////////////////////// OutCircle::OutCircle(const Point& C,const Point& B) :Circle(C,B) { } /////////////////////////////////////////////// OutCircle::OutCircle(const Point& C,real r) :Circle(C,r) { } /////////////////////////////////////////////// //Processor* //OutCircle::DefaultProcessor() //const // { //return new PassTheBuck( // new Circle(*this)); //} //////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'outS2itf.c' then echo shar: will not over-write existing file "'outS2itf.c'" else cat << \SHAR_EOF > 'outS2itf.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// /////////// //File outs2itf.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) //////////////// #include #include #include #include #include #include /////////////////////// OUT_CIRCLE::OUT_CIRCLE(const Point& c,const Point& b) { StoreAtomic(new OutCircle(c,b), new PassTheBuck((AtomicRegion*)CIRCLE(c,b))); } ////////////////////////////////////////////// OUT_CIRCLE::OUT_CIRCLE(const Point& c, real Radius) { StoreAtomic(new OutCircle(c,Radius), new PassTheBuck((AtomicRegion*)CIRCLE(c,Radius))); } ////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'passbuck.c' then echo shar: will not over-write existing file "'passbuck.c'" else cat << \SHAR_EOF > 'passbuck.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// //File passbuck.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// #include #include #include #include ////////////////////////////////////////////////// template PassTheBuck::PassTheBuck(AtomicRegion* a) :Processor(), AR_ptr(a) { } ////////////////////////////////////////////////// template void PassTheBuck::Process( Stack& Offspring) { Transformation* T = new VIA(&Geometry()); Integrand* I = new Integrand(LocalIntegrand(),T); AR_ptr->LocalIntegrand(I); Offspring.Push(AR_ptr); } ///////////////////////////////////////////////// template Processor* PassTheBuck::NewCopy() const { return new PassTheBuck(*this); } //////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'point2D.c' then echo shar: will not over-write existing file "'point2D.c'" else cat << \SHAR_EOF > 'point2D.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////// //File point2D.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(file name changed) ///////////////////////////////////////////// #include ////////////////////////////////////////////////////// Point_2D::Point_2D() { } ////////////////////////////////////////////////////// Point_2D::Point_2D(const Point_2D& v) :x(v.x),y(v.y) { } ////////////////////////////////////////////////////// Point_2D::Point_2D(const real X, const real Y) :x(X),y(Y) { } ////////////////////////////////////////////////////// Point_2D::~Point_2D() { } ////////////////////////////////////////////////// // Other functions are inlined ////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'pointer.c' then echo shar: will not over-write existing file "'pointer.c'" else cat << \SHAR_EOF > 'pointer.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// //File pointer.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 11 Sep 1994 V0.1b(bug removed from destructor) // 14 Sep 1994 V0.1c(inlines removed) // 25 Jan 1996 V0.1f(code moved from .c to .h) ///////////////////////////////////////////////////////// #include //////////////////////////////////////////////// template Pointer::Pointer() { ptr = 0; } //////////////////////////////////////////////// template Pointer::Pointer(const Pointer& p) { ptr = p.ptr; if (ptr !=0) ptr->Refer(); } /////////////////////////////////////////////// template Pointer::Pointer(T* p) { ptr = p; if (ptr !=0) ptr->Refer(); } //////////////////////////////////////////////// template Pointer& Pointer::operator=(const Pointer& p) { if (ptr !=0) { ptr->UnRefer(); if(ptr->NumberOfReferences() == 0 && (ptr != p.ptr)) { delete ptr; }; }; ptr = p.ptr; if (ptr !=0) ptr->Refer(); return *this; } //////////////////////////////////////////////// template Pointer& Pointer::operator=(T* p) { if (ptr !=0) { ptr->UnRefer(); if(ptr->NumberOfReferences() == 0 && (p != ptr)) { delete ptr; }; }; ptr = p; if (ptr !=0) ptr->Refer(); return *this; } //////////////////////////////////////////////// //////////////////////////////////////////////// template T& Pointer::operator[] (int i) const { return ptr[i]; } /////////////////////////////////////////////// template Pointer::~Pointer() { if (ptr ==0) return; ptr->UnRefer(); if(ptr->NumberOfReferences() == 0) { delete ptr; }; } /////////////////////////////////////////////// template Boolean Pointer::operator == (const Pointer& tp) const { return (ptr == tp.ptr) ? True : False; } //////////////////////////////////////////////// template Boolean Pointer::operator != (const Pointer& tp) const { return (ptr != tp.ptr)? True : False; } //////////////////////////////////////////////// template T& Pointer::operator *() const { return *ptr; } //////////////////////////////////////////////// template T* Pointer::operator ->() const { return ptr; } //////////////////////////////////////////////// //template //Pointer::operator T*() // { // return ptr; // } //////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'polC2.c' then echo shar: will not over-write existing file "'polC2.c'" else cat << \SHAR_EOF > 'polC2.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////// //File POLC2.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 14 Feb 1995 V0.1e(bug fix in transformation) ////////////////////////////////////////// #include #include #include #include #include ////////////////////////////////////////// #include //////////////////////////////////////////// PolarRectangle::PolarRectangle( const Point& A, const Point& B, const Point& C) :Geometry(2) { if(C==B) { TheCenter=A; } else { real dp = (C-B)*(A-B); Error(dp==0, "Error: trying to construct a polar rectangle with centre at infinity"); TheCenter = (A+(A-B)*((C-B)*((C+B)/2-A))/dp); }; TheInnerRadius=(TheCenter-A).Length(); TheOuterRadius=(TheCenter-B).Length(); Point BB(B-TheCenter), CC(C-TheCenter); TheSmallAngle=atan2(BB.Y(),BB.X()); TheBigAngle=atan2(CC.Y(),CC.X()); if (TheBigAngle<=TheSmallAngle) TheBigAngle += 2*M_PI; } /////////////////////////////////////////////////// PolarRectangle::PolarRectangle(const Point& O, real r1, real r2, real t1, real t2) : Geometry(2) { TheCenter = O; if (r1 > r2) { TheInnerRadius = r2; TheOuterRadius = r1; } else { TheInnerRadius = r1; TheOuterRadius = r2; }; TheSmallAngle = t1; TheBigAngle = t2; } ///////////////////////////////////////////////////// real PolarRectangle::InnerRadius() const { return TheInnerRadius; } //////////////////////////////////////////////////// real PolarRectangle::OuterRadius() const { return TheOuterRadius; } /////////////////////////////////////////////////// real PolarRectangle::SmallAngle() const { return TheSmallAngle; } ///////////////////////////////////////////////////// real PolarRectangle::BigAngle() const { return TheBigAngle; } //////////////////////////////////////////////////// const Point& PolarRectangle::Center() const { return TheCenter; } //////////////////////////////////////////////////// //Processor* //PolarRectangle::DefaultProcessor() //const //{ //return new PolarRectangle_Processor; //} //////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'polC2itf.c' then echo shar: will not over-write existing file "'polC2itf.c'" else cat << \SHAR_EOF > 'polC2itf.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////////// //File polC2itf.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ////////////////////////////////////////////// #include #include ////////////////////////////////////////////// POLAR_RECTANGLE::POLAR_RECTANGLE (const Point& A, const Point& B,const Point& C) { StoreAtomic(new PolarRectangle(A,B,C),new PolarRectangle_Processor); } ////////////////////////////////////////////// POLAR_RECTANGLE::POLAR_RECTANGLE (const Point& O, real r1, real r2, real t1, real t2) { StoreAtomic(new PolarRectangle(O,r1,r2,t1,t2),new PolarRectangle_Processor); } ////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'polC2prc.c' then echo shar: will not over-write existing file "'polC2prc.c'" else cat << \SHAR_EOF > 'polC2prc.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// //File polC2prc.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// #include #include #include #include #include #include #include //////////////////////////////////////////////////////// void PolarRectangle_Processor::Process( Stack& Offspring) { PolarRectangle& G = Geometry(); Point P1(G.InnerRadius(),G.SmallAngle()), P2(G.OuterRadius(),G.SmallAngle()), P3(G.OuterRadius(),G.BigAngle()); AtomicRegion* A ; A= (AtomicRegion*) PARALLELOGRAM(P2,P1,P3); Integrand I1(LocalIntegrand(),new Translation(G.Center())); A->LocalIntegrand(new Integrand(I1, new PolarToRectangular)); Offspring.Push(A); } ///////////////////////////////////////////////// PolarRectangle_Processor::PolarRectangle_Processor() :Processor() { } ///////////////////////////////////////////////// Processor* PolarRectangle_Processor::NewCopy() const { return new PolarRectangle_Processor(*this); } //////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'ps.c' then echo shar: will not over-write existing file "'ps.c'" else cat << \SHAR_EOF > 'ps.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : ps.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// #include ///////////////////////////////////////////////////////// ParabolicSegment::ParabolicSegment(const Point& a, const Point& b, const Point& p) :Geometry(2),TheA(a),TheB(b),TheP(p) { } ///////////////////////////////////////////////////////// const Point& ParabolicSegment::A() const { return TheA; } ////////////////////////////////////////////////////////// const Point& ParabolicSegment::B() const { return TheB; } ////////////////////////////////////////////////////////// const Point& ParabolicSegment::P() const { return TheP; } ////////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'psitf.c' then echo shar: will not over-write existing file "'psitf.c'" else cat << \SHAR_EOF > 'psitf.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : psitf.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// #include #include #include #include ///////////////////////////////////////////////////////// PARABOLIC_SEGMENT::PARABOLIC_SEGMENT(const Point& A, const Point& B, const Point& P) :USERINTERFACE() { Point p(-1,0),q(0,1),r(1,0); TRIANGLE T(p,q,r); StoreAtomic ( new ParabolicSegment(A,B,P), new PassTheBuck ( (AtomicRegion*) T ) ); } ////////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'rule.c' then echo shar: will not over-write existing file "'rule.c'" else cat << \SHAR_EOF > 'rule.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// /////////////////////////////////////////////// //File rule.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 30 Jan 1996 V0.1g(no longer compare signed and unsigned) ///////////////////////////////////// #include //////////////////////////////////// template Rule::Rule() :ReferenceCounting() { } //////////////////////////////////////////////// template Rule::~Rule() { } ///////////////////////////////////////////////// template void Rule::Apply(Integrand& F,GEOMETRY& G, real& i, real&d) { } /////////////////////////////////////////////////// template void Rule::ApplyWithDiffs(Integrand& F,GEOMETRY& G, real& r, real&e, Vector& D) { for (unsigned int i= 0; i 'refcount.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////////// //File refcount.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(unused parameter removed) ///////////////////////////////////////////// #include ////////////////////////////////////////////// ReferenceCounting::ReferenceCounting() { numref = 0; } ////////////////////////////////////////////// ReferenceCounting::ReferenceCounting(const ReferenceCounting&) { //numref isn't copied! numref = 0; } ///////////////////////////////////////////// ReferenceCounting& ReferenceCounting::operator= (const ReferenceCounting&) { //numref isn't copied! return *this; } //////////////////////////////////////////// void ReferenceCounting::Refer () { numref++; } //////////////////////////////////////////// void ReferenceCounting::UnRefer() { numref--; } /////////////////////////////////////////////// unsigned int ReferenceCounting::NumberOfReferences() const { return numref; } /////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'regcoll.c' then echo shar: will not over-write existing file "'regcoll.c'" else cat << \SHAR_EOF > 'regcoll.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////// //File regcoll.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ////////////////////////////////////////////////// #include #include /////////////////////////////////////////////////// void REGION_COLLECTION::LocalIntegrand(Integrand* ip) { SCR_ptr->IteratorReset(); while(!SCR_ptr->IteratorAtEnd()) { SCR_ptr->IteratorNext()->LocalIntegrand(ip); }; } /////////////////////////////////////////////////// void REGION_COLLECTION::LocalIntegrand(Function f) { LocalIntegrand(new Integrand(f)); } /////////////////////////////////////////////////// REGION_COLLECTION& REGION_COLLECTION::operator+= (const COMPOUND_REGION& C) { SCR_ptr->Push( C.NewCopy()); return *this; } ////////////////////////////////////////////////// REGION_COLLECTION REGION_COLLECTION::operator+ (const COMPOUND_REGION& C) { REGION_COLLECTION r; r+= (*this); r+= C; return r; } /////////////////////////////////////////////////// REGION_COLLECTION::REGION_COLLECTION() :COMPOUND_REGION() { SCR_ptr = new Stack; } ///////////////////////////////////////////////// REGION_COLLECTION::REGION_COLLECTION(const REGION_COLLECTION& rc) :COMPOUND_REGION(rc),SCR_ptr(rc.SCR_ptr) { } ////////////////////////////////////////////////////// void REGION_COLLECTION::Preprocess() { SCR_ptr->IteratorReset(); while(!SCR_ptr->IteratorAtEnd()) { COMPOUND_REGION* C =SCR_ptr->IteratorNext(); real OldIntegral = C->Integral(); real OldError = C->AbsoluteError(); C->Preprocess(); LocalInfo().Integral() += C->Integral()-OldIntegral; LocalInfo().AbsoluteError ()+= C->AbsoluteError()-OldError; }; // if all parts are hopeless then the result is // hopeless too: SCR_ptr->IteratorReset(); while (!SCR_ptr->IteratorAtEnd()) { COMPOUND_REGION* C = SCR_ptr->IteratorNext(); if(!C->Hopeless()) return; }; LocalInfo().Hopeless() = True; } //////////////////////////////////////////////////// void REGION_COLLECTION::Improve() { real MaxCompoundError = 0; COMPOUND_REGION* MaxCompoundErrorAtRegion =0; SCR_ptr->IteratorReset(); while (!SCR_ptr->IteratorAtEnd()) { COMPOUND_REGION* C = SCR_ptr->IteratorNext(); real e =C->MaxAtomicError(); if (e > MaxCompoundError && !C->Hopeless()) { MaxCompoundError = e; MaxCompoundErrorAtRegion = C; }; }; LocalInfo().Integral() -= MaxCompoundErrorAtRegion->Integral(); LocalInfo().AbsoluteError() -= MaxCompoundErrorAtRegion->AbsoluteError(); MaxCompoundErrorAtRegion->Process(); LocalInfo().Integral() += MaxCompoundErrorAtRegion->Integral(); LocalInfo().AbsoluteError() += MaxCompoundErrorAtRegion->AbsoluteError(); // if all parts are hopeless then the result is // hopeless too: SCR_ptr->IteratorReset(); while (!SCR_ptr->IteratorAtEnd()) { COMPOUND_REGION* C = SCR_ptr->IteratorNext(); if(!C->Hopeless()) return; }; LocalInfo().Hopeless() = True; } ///////////////////////////////////////////////////// real REGION_COLLECTION::MaxAtomicError() const { real MaxError=0; SCR_ptr->IteratorReset(); while(!SCR_ptr->IteratorAtEnd()) { real m = SCR_ptr->IteratorNext()->MaxAtomicError(); if(m > MaxError) { MaxError = m; }; }; return MaxError; } ///////////////////////////////////////////////////// COMPOUND_REGION* REGION_COLLECTION::NewCopy() const { return new REGION_COLLECTION(*this); } /////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'reginfo.c' then echo shar: will not over-write existing file "'reginfo.c'" else cat << \SHAR_EOF > 'reginfo.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// //File reginfo.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Nov 1994 V0.1d(re-ordering of member initializers) ///////////////////////////////////////////////////////// #include //////////////////////////////////////////////////////// RegionInfo::RegionInfo() :ReferenceCounting(), TheIntegral(0), TheAbsoluteError(0), IsHopeless(False) { } ///////////////////////////////////////////////////////// Boolean RegionInfo::Hopeless() const { return IsHopeless; } //////////////////////////////////////////////////////////// Boolean& RegionInfo::Hopeless() { return IsHopeless; } ///////////////////////////////////////////////////////////// real RegionInfo::Integral() const { return TheIntegral; } ////////////////////////////////////////////////////////// real& RegionInfo::Integral() { return TheIntegral; } //////////////////////////////////////////////////////// real RegionInfo::AbsoluteError() const { return TheAbsoluteError; } /////////////////////////////////////////////////////////// real& RegionInfo::AbsoluteError() { return TheAbsoluteError; } //////////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'region.c' then echo shar: will not over-write existing file "'region.c'" else cat << \SHAR_EOF > 'region.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////////// //File region.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ////////////////////////////////////////////// #include #include #include #include ///////////////////////////////////////////// real Region::AbsoluteError() const { return RI_ptr->AbsoluteError(); } /////////////////////////////////////////////// real Region::Integral() const { return RI_ptr->Integral(); } /////////////////////////////////////////////// Boolean Region::operator< (const Region& r) const { return (Boolean)(AbsoluteError() < r.AbsoluteError()); } /////////////////////////////////////////////// Boolean Region::operator<=(const Region& r) const { return (Boolean)(AbsoluteError() <= r.AbsoluteError()); } /////////////////////////////////////////////// Boolean Region::operator>(const Region& r) const { return (Boolean)(AbsoluteError() > r.AbsoluteError()); } /////////////////////////////////////////////// Boolean Region::operator>=(const Region& r) const { return (Boolean)(AbsoluteError() >= r.AbsoluteError()); } /////////////////////////////////////////////// RegionInfo& Region::LocalInfo() { return *RI_ptr; } //////////////////////////////////////////////// Region::Region() :RI_ptr( new RegionInfo) { } //////////////////////////////////////////////// Boolean Region::Hopeless() const { return RI_ptr->Hopeless(); } //////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'regproc.c' then echo shar: will not over-write existing file "'regproc.c'" else cat << \SHAR_EOF > 'regproc.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// /////////////////////////////////////////////// //File regproc.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) /////////////////////////////////////////////// #include #include /////////////////////////////////////////////// template Processor::Processor() :ReferenceCounting() { } /////////////////////////////////////////////// template Processor::~Processor() { } //////////////////////////////////////////// template Integrand& Processor::LocalIntegrand() const { return (*(A_ptr->I_ptr)); } /////////////////////////////////////////// template GEOMETRY& Processor::Geometry() const { return (*(A_ptr->G_ptr)); } /////////////////////////////////////////// template void Processor::LocalAtomic(Atomic* a) { A_ptr = a; } //////////////////////////////////////////// template Atomic& Processor::LocalAtomic() const { return *A_ptr; } ////////////////////////////////////////////// template real& Processor::Integral() { return A_ptr->LocalRegionInfo()->Integral(); } ////////////////////////////////////////////////// template real& Processor::AbsoluteError() { return A_ptr->LocalRegionInfo()->AbsoluteError(); } ///////////////////////////////////////////////// template RegionInfo& Processor::LocalRegionInfo() const { return *(A_ptr->LocalRegionInfo()); } //////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 's_adapt.c' then echo shar: will not over-write existing file "'s_adapt.c'" else cat << \SHAR_EOF > 's_adapt.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////// //File s_adapt.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(typedef introduced, code from .c to .h) ////////////////////////////////////////////// #include #include #include #include ///////////////////////////////////////////// //template //SimpleAdaptive::SimpleAdaptive(const Pointer& R, // const Pointer& D) // :Processor(), // TimesCalled(0), // Diffs(2), // TheRule(R), // TheDivisor(D) // { // } /////////////////////////////////////////////// template SimpleAdaptive::SimpleAdaptive(Rule* R, SameShapeDivisor* D) :Processor(), TimesCalled(0), Diffs(2), TheRule(R), TheDivisor(D) { } /////////////////////////////////////////////// template SimpleAdaptive* SimpleAdaptive::Descendant() const { SimpleAdaptive* r = new SimpleAdaptive(TheRule,TheDivisor); return r; } //////////////////////////////////////////////// template void SimpleAdaptive::Process( Stack& Offspring) { TimesCalled ++; if (TimesCalled == 1) { TheRule->ApplyWithDiffs(LocalIntegrand(),Geometry(),Integral(), AbsoluteError(),Diffs); Offspring.MakeEmpty(); return; }; if(TimesCalled == 2) { real NewVolume = Geometry().Volume()/TheDivisor->NumberOfParts(); Stack Parts; Vector DiffOrder(Diffs.Size()); if (Diffs[0]>Diffs[1]) { DiffOrder[0] = 1 ; DiffOrder[1] = 2; } else { DiffOrder[0] = 2; DiffOrder[1] =1; }; TheDivisor->Apply (Geometry(),Parts,DiffOrder); unsigned int N = Parts.Size(); for (unsigned int i =0;iVolume(NewVolume); Processor* p = Descendant(); Atomic* a = new Atomic(g,p); a->LocalIntegrand(&LocalIntegrand()); Offspring.Push(a); }; return; }; Error(TimesCalled > 2, "SimpleAdaptive : more than two calls of Process()"); } /////////////////////////////////////////////// template Processor* SimpleAdaptive::NewCopy() const { return new SimpleAdaptive(*this); } ///////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'samediv.c' then echo shar: will not over-write existing file "'samediv.c'" else cat << \SHAR_EOF > 'samediv.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////// //File samediv.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////// #include ///////////////////////////////////////////////// template SameShapeDivisor::SameShapeDivisor() :Divisor() { } ////////////////////////////////////////////////// template SameShapeDivisor::~SameShapeDivisor() { } ////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'semistrp.c' then echo shar: will not over-write existing file "'semistrp.c'" else cat << \SHAR_EOF > 'semistrp.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //////////////////////////////////////////// //File semistrp.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////// #include ////////////////////////////////////////////// SemiInfiniteStrip::SemiInfiniteStrip(const Point& a,const Point& b) :Geometry(2),TheA(a),TheB(b) { } //////////////////////////////////////////// const Point& SemiInfiniteStrip::A() const { return TheA; } /////////////////////////////////////////// const Point& SemiInfiniteStrip::B() const { return TheB; } /////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'semstitf.c' then echo shar: will not over-write existing file "'semstitf.c'" else cat << \SHAR_EOF > 'semstitf.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //////////////////////////////////////////////// //File stripitf.c ////////////////////////////////////////////// #include #include #include #include ////////////////////////////////////////////// SEMI_INFINITE_STRIP::SEMI_INFINITE_STRIP(const Point& a,const Point& b) :USERINTERFACE() { Point or(0,0),one(1,0); INFINITE_STRIP I(or,one); StoreAtomic(new SemiInfiniteStrip(a,b), new PassTheBuck((AtomicRegion*)I)); } /////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'set.c' then echo shar: will not over-write existing file "'set.c'" else cat << \SHAR_EOF > 'set.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// /////////////////////////////////////////////////////// //File set.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ////////////////////////////////////////////////////// #include #include /////////////////////////////////////////////////////// template Set::Set() :ReferenceCounting() { Number = 0; } //////////////////////////////////////////////////////////// template Set::~Set() { } /////////////////////////////////////////////////////// template unsigned int Set::Size() const { return(Number); } //////////////////////////////////////////////////////////// template Boolean Set::Empty() const { return (Number == 0)? True : False ; } ///////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'stack.c' then echo shar: will not over-write existing file "'stack.c'" else cat << \SHAR_EOF > 'stack.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// /////////////////////////////////////////////////////// //File stack.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 30 Jan 1996 V0.1g(no longer compare signed and unsigned) ////////////////////////////////////////////////////// #include #include #include //////////////////////////////////////////////////////////// template Stack::Stack () :ReferenceCounting() { TheTop = new SElement; Error(!TheTop,"Stack:Allocation Failed"); TheTop ->Next =TheTop; Number = 0; } //////////////////////////////////////////////////////////// template void Stack::Push( T* r) { TheTop->Contents = r; SElement* w1 = TheTop; SElement* w2 = w1->Next; w1->Next = new SElement; Error(!w1->Next,"Stack:Allocation Failed"); w1->Next->Contents = TheTop->Contents; w1->Next->Next = w2; Number++; } //////////////////////////////////////////////////////////// template void Stack::Merge (Stack& r) { if(&r == this) return; SElement *w = r.TheTop->Next; for (unsigned int i =0; iContents); w->Contents = 0; w=w->Next; }; r.MakeEmpty(); } //////////////////////////////////////////////////////////// template T* Stack::Pop() { Error(Number==0,"Attempt to pop empty stack"); Number--; T* R=(TheTop->Next->Contents); SElement *w =TheTop->Next; TheTop->Next = TheTop->Next->Next; delete w; return R; } ///////////////////////////////////////////////////// template T* Stack::Top() const { Error(Number==0,"Attempt to access top of empty Stack"); return (TheTop->Next->Contents); } //////////////////////////////////////////////////////////// //template //ostream& //operator<<(ostream& os,const Stack& s) //{ //os << "Stack\n"; //SElement *w = s.TheTop->Next; //for (int i =0; iContents); //w=w->Next; //}; //return os; //} //////////////////////////////////////////////////////////// template void Stack::MakeEmpty() { if (Number == 0) return; SElement* w1 = TheTop->Next; SElement* w2 = w1 ->Next; for (unsigned int i=0 ;iContents; delete w1; w1 = w2; w2 = w1->Next; }; TheTop->Next = TheTop; Number = 0; } ////////////////////////////////////////////////////////// template Stack::~Stack () { MakeEmpty(); delete TheTop; } ////////////////////////////////////////////////////////// template unsigned int Stack::Size() const { return Number; } ////////////////////////////////////////////////////// template Boolean Stack::Empty() const { return (Number == 0) ? True : False ; } ////////////////////////////////////////////////////// template void Stack::IteratorReset() { Current = TheTop->Next; } //////////////////////////////////////////////////// template Boolean Stack::IteratorAtEnd() const { return (Current == TheTop) ? True : False; } //////////////////////////////////////////////////// template T* Stack::IteratorNext() { T*r = Current->Contents; Current = Current->Next; return r; } ///////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'strip.c' then echo shar: will not over-write existing file "'strip.c'" else cat << \SHAR_EOF > 'strip.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //////////////////////////////////////////// //File strip.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////// #include #include #include ////////////////////////////////////////////// InfiniteStrip::InfiniteStrip(const Point& a,const Point& b) :Geometry(2),TheA(a),TheB(b) { } //////////////////////////////////////////// const Point& InfiniteStrip::A() const { return TheA; } /////////////////////////////////////////// const Point& InfiniteStrip::B() const { return TheB; } /////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'stripitf.c' then echo shar: will not over-write existing file "'stripitf.c'" else cat << \SHAR_EOF > 'stripitf.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //////////////////////////////////////////////// //File stripitf.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ////////////////////////////////////////////// #include #include #include #include ////////////////////////////////////////////// INFINITE_STRIP::INFINITE_STRIP(const Point& a,const Point& b) :USERINTERFACE() { PLANE P; StoreAtomic(new InfiniteStrip(a,b), new PassTheBuck((AtomicRegion*)P)); } /////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'sttosmst.c' then echo shar: will not over-write existing file "'sttosmst.c'" else cat << \SHAR_EOF > 'sttosmst.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////// //File sttosmt.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) //////////////////////////////////////////////// #include #include #include #include //////////////////////////////////////////// void IStoSIS::Transform(real& w, Point& p) { // cout << p; SemiInfiniteStrip& s = *SIS_ptr; Point D = s.B()- s.A(); Point C(-D.Y(),D.X()); // if (p.Y() > 600) // goed voor double // if (p.Y() > 60) if (p.Y() > log(REAL_MAX)*6.0/7.0) { w = 0; return; }; C = C/C.Length(); w *= D.Length()*exp(p.Y()); p = s.A() + exp(p.Y())*C + p.X()*D; // cout << p << endl; } /////////////////////////////////////////////////// IStoSIS::IStoSIS(SemiInfiniteStrip* g) : Transformation(),SIS_ptr(g) { } ////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'translat.c' then echo shar: will not over-write existing file "'translat.c'" else cat << \SHAR_EOF > 'translat.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////////// //File translat.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(unused parameter removed) //////////////////////////////////////////////// #include /////////////////////////////////////////////// Translation::Translation( const Point& Offset) :Transformation(),TheOffset(Offset) { } ///////////////////////////////////////////// void Translation::Transform (real &, Point& p) { p += TheOffset; } ///////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'trnsfrm.c' then echo shar: will not over-write existing file "'trnsfrm.c'" else cat << \SHAR_EOF > 'trnsfrm.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// //////////////////////////////////////////////////////// //File trnsfrm.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) //////////////////////////////////////////////////////// #include //////////////////////////////////////////////////////// Transformation::Transformation() :ReferenceCounting() { } ///////////////////////////////////////////////////////// Transformation::~Transformation() { } //////////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'userint.c' then echo shar: will not over-write existing file "'userint.c'" else cat << \SHAR_EOF > 'userint.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ////////////////////////////////////////////////// //File userint.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 9 Sep 1994 V0.1a(operator added) // 10 Sep 1994 V0.1b(initialisation of Int_ptr added) // 25 Jan 1996 V0.1f(typedef introduced, code from .c to .h) /////////////////////////////////////////////////// #include #include /////////////////////////////////////////////////// template USERINTERFACE::USERINTERFACE() :COMPOUND_REGION() { SAR_ptr = new Stack; HAR_ptr = new Heap; HopelessAR_ptr = new Stack; Int_ptr = (Pointer) (0); } ////////////////////////////////////////////////// template USERINTERFACE::USERINTERFACE(const USERINTERFACE& u) :COMPOUND_REGION(u) { SAR_ptr = u.SAR_ptr; HAR_ptr = u.HAR_ptr; HopelessAR_ptr = u.HopelessAR_ptr; Int_ptr = u.Int_ptr; } /////////////////////////////////////////////////// template USERINTERFACE::~USERINTERFACE() { } /////////////////////////////////////////////////// template void USERINTERFACE::Use(Processor* rp) { Error(SAR_ptr-> Size() != 1, "Attempt to specify region processor for multiple regions" ); Atomic* A =(Atomic*)(SAR_ptr->Top()); A->Use(rp); } ////////////////////////////////////////////////// template void USERINTERFACE ::StoreAtomic (GEOMETRY* g, Processor* p) { Atomic* A = new Atomic(g,p); SAR_ptr->Push(A); } ////////////////////////////////////////////////// //template //void //USERINTERFACE ::StoreAtomic (GEOMETRY* g) //{ //Atomic* A = new Atomic(g); //SAR_ptr->Push(A); //} ////////////////////////////////////////////////// template void USERINTERFACE::Preprocess() { while(!SAR_ptr->Empty()) { AtomicRegion* A; A = SAR_ptr->Pop(); Stack Offspring; A->Process(Offspring); if( Offspring.Empty()) { if (!A->Hopeless()) { (*HAR_ptr) += A; } else { HopelessAR_ptr->Push( A); }; LocalInfo().Integral() += A->Integral(); LocalInfo().AbsoluteError () += A->AbsoluteError(); } else { delete A; SAR_ptr->Merge(Offspring); }; }; if (HAR_ptr->Empty()) { LocalInfo().Hopeless() = True; }; } ///////////////////////////////////////////////////// template void USERINTERFACE::Improve() { // (*this) shouldn't be Hopeless() AtomicRegion* A = HAR_ptr->Get(); //HAR_ptr->Print(); //cout << A->Integral()<<" "<AbsoluteError()<Integral(); LocalInfo().AbsoluteError() -= A->AbsoluteError(); Stack Offspring; A->Process(Offspring); if( Offspring.Empty()) { if (!A->Hopeless()) { (*HAR_ptr) += A; } else { HopelessAR_ptr->Push( A); }; LocalInfo().Integral() += A->Integral(); LocalInfo().AbsoluteError() += A->AbsoluteError(); } else { delete A; SAR_ptr->Merge(Offspring); Preprocess(); }; if (HAR_ptr->Empty()) { LocalInfo().Hopeless() = True; }; } ////////////////////////////////////////////////////// template void USERINTERFACE::LocalIntegrand(Integrand* ip) { if (Int_ptr == (Pointer) (0)) Int_ptr = ip; else { Error(!(*Int_ptr == *ip), "Attempt to modify integrand during integration"); } // Error(!HAR_ptr->Empty(), // "Attempt to modify integrand during integration"); if ( !(SAR_ptr->Empty()) ) { SAR_ptr->IteratorReset(); while(!SAR_ptr->IteratorAtEnd()) { SAR_ptr->IteratorNext()->LocalIntegrand(ip); }; } } ////////////////////////////////////////////////////// template void USERINTERFACE::LocalIntegrand(Function f) { LocalIntegrand(new Integrand(f)); } /////////////////////////////////////////////////////// template REGION_COLLECTION USERINTERFACE::operator+( const COMPOUND_REGION& C) { REGION_COLLECTION r; r += (*this); r += C; return r; } ////////////////////////////////////////////////////// template real USERINTERFACE::MaxAtomicError() const { real MaxError=0; if (!HAR_ptr->Empty()) { AtomicRegion* t = HAR_ptr->Look(); MaxError = t->AbsoluteError(); }; return MaxError; } //////////////////////////////////////////////////////// template COMPOUND_REGION* USERINTERFACE::NewCopy() const { return new USERINTERFACE(*this); } /////////////////////////////////////////////////////// //template //USERINTERFACE::operator AtomicRegion*() // { // Error (SAR_ptr->Empty(), // "converting empty compound region to atomic."); // return SAR_ptr->Pop(); // } //////////////////////////////////////////////////// SHAR_EOF fi # end of overwriting check if test -f 'vector.c' then echo shar: will not over-write existing file "'vector.c'" else cat << \SHAR_EOF > 'vector.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////// //File vector.c // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////// #include #include #include #include //////////////////////////////////////////////////// template Vector::Vector(unsigned int s) { TheSize =s; if (s>0) { Contents = new T[TheSize]; Error(!Contents,"Vector:allocation failed"); }; } ////////////////////////////////////////////////////// template Vector::Vector() { TheSize = 0; } ////////////////////////////////////////////////////// template Vector::~Vector() { if (TheSize>0) delete [] Contents; } ////////////////////////////////////////////////////// template Vector::Vector(const Vector& v) { TheSize = v.TheSize; if (TheSize ==0) { Contents = 0; return; }; Contents = new T[TheSize]; Error(!Contents,"Vectorcopyconst:allocation failed"); for (unsigned int i =0;i Vector::Vector( unsigned int s,T* v) { TheSize = s; Contents = new T[TheSize]; for (unsigned int i =0;i const T& Vector::operator[](unsigned int i) const { Error( i>=TheSize,"arrayindex constraint violation"); return Contents[i]; } ////////////////////////////////////////////////////// template T& Vector::operator[](unsigned int i) { Error( i>=TheSize,"array index constraint violation"); return Contents[i]; } ////////////////////////////////////////////////////// template Vector& Vector::operator=(const Vector& v) { if (TheSize == 0) { TheSize = v.TheSize; Contents = new T[TheSize]; Error(!Contents,"Vectorassign:allocation failed"); }; Error( (TheSize != v.TheSize),"lengths of arrays incompatible"); for (unsigned int i =0;i Boolean Vector::operator==(const Vector& v) const { if (TheSize !=v.TheSize) { return False; } else { Boolean b = True; for (unsigned int i=0;i Boolean Vector::operator!=(const Vector& v) const { return (Boolean)!( (*this) == v); } /////////////////////////////////////////////////// template unsigned int Vector::Size() const { return TheSize; } ////////////////////////////////////////////// //template //ostream& //operator << (ostream& os,const Vector& v) //{ //os << "Vector"; //for (unsigned int i=0;i 'vstack.c' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////// //File vstack.cpp // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////// #include #include #include #include #include template VectorStack::VectorStack() :Vector() { } /////////////////////////////////////////////////// template VectorStack::VectorStack(const VectorStack& v) :Vector(v) { } /////////////////////////////////////////////////// template VectorStack& VectorStack::operator=(const VectorStack& v) { if (TheSize == 0) { TheSize = v.TheSize; Contents = new T[TheSize]; Error(!Contents,"Vectorassign:allocation failed"); }; Error( (TheSize != v.TheSize),"lengths of arrays incompatible"); for (unsigned int i =0;i void VectorStack::operator += (const T& t) { T* New = new T[TheSize+1]; for(unsigned int i=0;i 'C2.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : C2.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Parallelogram // ------------------------------------------------- // // BASECLASSES: // Geometry // // PURPOSE: // the geometry of a 2D parallelogram // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1)Parallelogram(const Point& A, // const Point& B, // const Point& C) // ------------------------------- // constructs a parallelogram with vertices // A, B, C and D= B+C-A. // // SELECTORS: // 1) const Point& Vertex (int i ) const // ------------------------------------- // returns the i-th vertex. 0<=i<3 // referring to the constructor, i=0 returns A, // i=1 B and i=2 C. D can't be retrieved. // // 2) real Volume() const // ---------------------- // // 3) Processor* DefaultProcessor()const // ---------------------------------------------------- // // // MODIFIERS: // 1) void Volume(real) // -------------------- // informs the par. about its volume, in order to // avoid computation of it // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// #ifndef C2_H #define C2_H ///////////////////////////////////////////////////////// #include #include #include #include #include #include ///////////////////////////////////////////////////////// class Parallelogram : public Geometry { public: Parallelogram (const Point&,const Point&, const Point&); const Point& Vertex(int)const ; real Volume ()const ; void Volume(real); private: Vector Vertices; real TheVolume; Boolean TheVolumeKnown; void ComputeVolume(); }; ///////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'C2dv2.h' then echo shar: will not over-write existing file "'C2dv2.h'" else cat << \SHAR_EOF > 'C2dv2.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : C2dv2.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(long lines split) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Parallelogram_Divide2 // ------------------------------------------------- // // BASECLASSES: // SameShapeDivisor // // PURPOSE: // to cut a Parallelogram in 2 new ones // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Parallelogram_Divide4() // ------------------------ // // SELECTORS: // 1) int NumberOfParts() const // ---------------------------- // returns 2 // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) void Apply(const Parallelogram& P, Stack& S // , const Vector& DiffOrder) // ---------------------------------------------------------- // divides P by halving its sides. the new parts are // returned in S. If DiffOrder[0] > DiffOrder[1] then P // is divided by halving the edge {Vertex(0),Vertex(1)} // otherwise the edge {Vertex(0),Vertex(2)} is halved. // ///////////////////////////////////////////////////////// #ifndef C2DV2_H #define C2DV2_H ////////////////////////////////////////// #include #include //////////////////////////////////////// class Parallelogram_Divide2 :public SameShapeDivisor { public: Parallelogram_Divide2(); void Apply(const Parallelogram&, Stack&, const Vector&); int NumberOfParts() const {return 2;}; }; ////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'C2dv4.h' then echo shar: will not over-write existing file "'C2dv4.h'" else cat << \SHAR_EOF > 'C2dv4.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : C2dv4.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(long lines split) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Parallelogram_Divide4 // ------------------------------------------------- // // BASECLASSES: // SameShapeDivisor // // PURPOSE: // Divides a Parallelogram in 4 new ones. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Parallelogram_Divide4() // ------------------------ // // SELECTORS: // 1) int NumberOfParts() const // ---------------------------- // returns 4 // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) void Apply(const Parallelogram& P, Stack& S // , const Vector& DiffOrder) // ---------------------------------------------------------- // divides P by halving its sides. the new parts are // returned in S,DiffOrder isn't used. // ///////////////////////////////////////////////////////// #ifndef C2DV4_H #define C2DV4_H ////////////////////////////////////////// #include #include //////////////////////////////////////// class Parallelogram_Divide4 :public SameShapeDivisor { public: Parallelogram_Divide4(); void Apply(const Parallelogram&, Stack&, const Vector&); int NumberOfParts() const {return 4;}; }; ////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'C2interf.h' then echo shar: will not over-write existing file "'C2interf.h'" else cat << \SHAR_EOF > 'C2interf.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : C2interf.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS PARALLELOGRAM // ------------------------------------------------- // // BASECLASSES: // USERINTERFACE // // PURPOSE: // End-user interface to a parallelogram. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) PARALLELOGRAM(const Point& A, // const Point& B, // const Point& C) // ------------------------------ // constructs a parallelogram with 4 vertices // A, B, C, and D=B+C-A // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// // DEFINITION OF CLASS RECTANGLE // ------------------------------------------------- // // BASECLASSES: // USERINTERFACE // // PURPOSE: // End-user interface to a parallelogram. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) RECTANGLE(const Point& A, // const Point& B, // const Point& C) // ------------------------------ // constructs a parallelogram with 4 vertices // A, B, C, and D=B+C-A // AB should be orthogonal to BC // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef C2INTERF_H #define C2INTERF_H /////////////////////////////////////////////////// #include #include /////////////////////////////////////////////////// class PARALLELOGRAM : public USERINTERFACE { public: PARALLELOGRAM(const Point&,const Point&,const Point&); }; ////////////////////////////////////////////////// class RECTANGLE : public USERINTERFACE { public: RECTANGLE(const Point&,const Point&,const Point&); }; ////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'C2prc.h' then echo shar: will not over-write existing file "'C2prc.h'" else cat << \SHAR_EOF > 'C2prc.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : C2prc.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(typedef introduced) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Parallelogram_Processor // ------------------------------------------------- // // BASECLASSES: // Processor // // PURPOSE: // A processor for two-dimensional parallelograms. // first a degree 13 rule is applied to the region // Fourth order divided differences along the axes are // computed. If they're very much different, the region // is cut in two, otherwise it is cut in four. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Parallelogram_Processor(); // ----------------------------- // // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) void Process(Stack&); // -------------------------------------------------- // see class Processor // // 2) virtual Processor* NewCopy() const=0 // ------------------------------------------------- // // makes a new copy (using the copy constructor) and // returns a pointer to it. ///////////////////////////////////////////////////////// #ifndef C2PRC_H #define C2PRC_H ////////////////////////////////////////////// #include #include #include #include #include ///////////////////////////////////////////// class Parallelogram_Processor : public Processor { public: typedef Rule RuleParallelogram; typedef SameShapeDivisor SameShapeDivisorParallelogram; Parallelogram_Processor(); void Process(Stack&); Processor* NewCopy() const; protected: static Pointer TheRule; static Pointer TheDivisor4; static Pointer TheDivisor2; unsigned int TimesCalled; Parallelogram_Processor* Descendant() const; Vector Diffs; }; ///////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'C2rule13.h' then echo shar: will not over-write existing file "'C2rule13.h'" else cat << \SHAR_EOF > 'C2rule13.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : C2rule13.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(long lines split) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Parallelogram_Rule13 // ------------------------------------ // // BASECLASSES: // Rule // // // PURPOSE: // A degree 13 rule for a rectangle. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // None // SELECTORS: // 1) int Degree() const // --------------------- // returns 13 // // 2) int NumberOfPoints(int ) const // -------------------------------------- // returns 37. // // MODIFIERS: // None // OPERATORS: // None // SPECIAL: // 1) ApplyWithDiffs(Integrand & I, // Parallelogram& H,real& Result,real& Error // Vector& D) // ------------------------------------------------- // Input parameters: // I: Integrand // H: rectangle to be integrated. H.Dimension() // should be 2. // Output parameters: // Result: approximation to the integral // Error: absolute error estimation // D: Fourth order divided differences in each direction // D[0] refers to {Vertex(0),Vertex(1)}; // D[1] refers to {Vertex(0),Vertex(2)}; // // /////////////////////////////////////////////////////////// #ifndef C2RULE13_H #define C2RULE13_H ///////////////////////////////////////// #include #include ////////////////////////////////////////// class Parallelogram_Rule13 : public Rule { public: Parallelogram_Rule13(); void ApplyWithDiffs(Integrand&,Parallelogram&,real& Result, real& Error,Vector&); int NumberOfPoints() const {return 37;}; int Degree () const {return 13;}; }; //////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'C2toS2.h' then echo shar: will not over-write existing file "'C2toS2.h'" else cat << \SHAR_EOF > 'C2toS2.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : C2toS2.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// //////////////////////////////////////////////////////// // DEFINITION OF CLASS PolarToRectangular // ------------------------------- // // BASECLASSES: // Transformation // // // PURPOSE: // implements a transformation from polar to // rectangular coordinates // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) PolarToRectangular() // ------------------------ // // SELECTORS: // None // MODIFIERS: // None // OPERATORS: // None // SPECIAL: // 1) void Transform (real& w, Point& p) // --------------------------------------- // Multiplies w by the Jacobian at p and then replaces p by // the transformed point. // /////////////////////////////////////////////////////////// #ifndef C2TOS2_H #define C2TOS2_H //////////////////////////////////////////////////////// #include #include /////////////////////////////////////////////////////// class PolarToRectangular :public Transformation { public: PolarToRectangular(); void Transform (real &w, Point& p); }; //////////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'C2togr.h' then echo shar: will not over-write existing file "'C2togr.h'" else cat << \SHAR_EOF > 'C2togr.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : C2togr.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS C2toGR // ------------------------------------------------- // // BASECLASSES: // Transformation // // PURPOSE: // transformation from parallelogram to generalized // rectangle // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) C2toGR(GeneralizedRectangle*) // ------------ // The target region has to be supplied // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) void Transform(real & w, Point & p) // -------------------------------------- // multiplies w by the Jacobian at p and then // replaces p by the transformed point // ///////////////////////////////////////////////////////// #ifndef C2TOGR_H #define C2TOGR_H ///////////////////////////////////////////////////////// #include #include #include #include /////////////////////////////////////////////////// class C2toGR : public Transformation { public: C2toGR( GeneralizedRectangle*); void Transform(real& w, Point& p); private: Pointer GR_ptr; }; ////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'E2.h' then echo shar: will not over-write existing file "'E2.h'" else cat << \SHAR_EOF > 'E2.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : E2.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Plane // ---------------------------- // // BASECLASSES: // Geometry // // PURPOSE: // implements the geometry of a plane // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Plane() // ---------------------------- // constructs a plane with center=(0,0) and the unit // on both coordinate axis = 1. // // 2) Plane(const Point& center) // --------------------------------------------------- // Constructs a plane given an integrand an a center point. // the unit on both axis = 1. // // 3) Plane(const Point& center, // const real& xscale, const real& yscale) // ---------------------------------------------------- // same as above, but now the scales can be set. // // // SELECTORS: // 1) real ScaleX() const // --------------------------- // returns a scale factor for the X coordinate. // // 2) real ScaleX() const // --------------------------- // returns a scale factor for the X coordinate. // // 3) const Point& Center() const // ------------------------------ // // 4) Processor* DefaultProcessor() const // --------------------------------------------- // // MODIFIERS: // None // OPERATORS: // None // SPECIAL: // None // /////////////////////////////////////////////////////////// #ifndef E2_H #define E2_H ////////////////////////////////////////////////// #include #include #include #include ////////////////////////////////////////////////// class Plane : public Geometry { public: Plane (); Plane (const Point&); Plane (const Point&, real, real); real ScaleX() const ; real ScaleY() const ; const Point& Center()const; private: real xscale,yscale; Point TheCenter; }; ////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'E2adapt.h' then echo shar: will not over-write existing file "'E2adapt.h'" else cat << \SHAR_EOF > 'E2adapt.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : E2adapt.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Nov 1994 V0.1d(re-ordering of member declarations) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS PlaneAdaptive // ------------------------------------------------- // // BASECLASSES: // Processor // // PURPOSE: // during the first call of Process() a degree 13 rule // is applied to the plane. during the second call // the plane is divided into a CIRCLE and an OUT_CIRCLE // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) PlaneAdaptive() // ---------------- // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) void Process( Stack&) // ------------------------------------------------------- // see Processor<> // // 2) virtual Processor* NewCopy() const=0 // ------------------------------------------------- // // makes a new copy (using the copy constructor) and // returns a pointer to it. ///////////////////////////////////////////////////////// #ifndef E2ADAPT_H #define E2ADAPT_H ///////////////////////////////////////////////////// #include #include #include //////////////////////////////////////////////////// class PlaneAdaptive: public Processor { public: PlaneAdaptive(); void Process(Stack&); Processor* NewCopy() const; private: static void Rule(Integrand&,Plane&,real&,real&,real&); unsigned int TimesCalled; real HalfValueRadius; } ; ///////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'E2interf.h' then echo shar: will not over-write existing file "'E2interf.h'" else cat << \SHAR_EOF > 'E2interf.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : E2interf.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS PLANE // ------------------------------------------------- // // BASECLASSES: // USERINTERFACE // // PURPOSE: // End-user interface to planes // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1)PLANE() // -------- // // 2)PLANE(const Point& Center) // ---------------------------- // Center indicates where in the plane the // activity is the greatest. // // 3)PLANE(const Point& Center, // real ScaleX, real ScaleY) // ------------------------------------ // same as 2) but with an indication of scales. // // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef E2INTERF_H #define E2INTERF_H //////////////////////////////////////////////// #include #include #include #include //////////////////////////////////////////////// class PLANE : public USERINTERFACE { public: PLANE(); PLANE(const Point&); PLANE(const Point&, real, real); }; //////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'E2sec.h' then echo shar: will not over-write existing file "'E2sec.h'" else cat << \SHAR_EOF > 'E2sec.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : E2sec.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS PlaneSector // ------------------------------------------------- // // BASECLASSES: // Geometry // // PURPOSE: // the geometry of a plane sector // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) PlaneSector(const Point& A, const Point& B, // const Point& C) // ------------------------------------------------- // constructs a PlaneSector. AB should not be // perpendicular to BC. // // 2) PlaneSector(const Point& O,real r,real theta1,real,theta2) // ------------------------------------------------ // // SELECTORS: // 1) const Point& Center() const // ------------------------------ // // 2) real InnerRadius() const // --------------------------- // // 3) real SmallAngle() const // -------------------------- // // 4) real BigAngle() const // ------------------------ // // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef E2SEC_H #define E2SEC_H ///////////////////////////////////////// #include #include #include ///////////////////////////////////////// class PlaneSector : public Geometry { public: PlaneSector( const Point& A, const Point& B, const Point& C); PlaneSector( const Point& O,real r,real theta1,real theta2); const Point& Center() const; real InnerRadius() const; real OuterRadius() const; real SmallAngle () const; real BigAngle () const; private: Point TheCenter; real TheInnerRadius, TheSmallAngle, TheBigAngle; }; ////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'E2secitf.h' then echo shar: will not over-write existing file "'E2secitf.h'" else cat << \SHAR_EOF > 'E2secitf.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : E2secitf.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS PLANE_SECTOR // ------------------------------------------------- // // BASECLASSES: // USERINTERFACE // // PURPOSE: // End-user interface to PlaneSectors // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) PLANE_SECTOR(const Point& A, // const Point& B, // const Point& C) // --------------------------------- // constructs a plane sector with vertices A,B,C // AB shouldn't be perpendicular to BC // // 2) PLANE_SECTOR(const Point& O,real r,real theta1,real theta2) // --------------------------------------------------------------- // // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef E2SECITF_H #define E2SECITF_H ///////////////////////////////////////// #include #include ///////////////////////////////////////// class PLANE_SECTOR : public USERINTERFACE { public: PLANE_SECTOR(const Point&,const Point&, const Point&); PLANE_SECTOR(const Point&,real,real,real); }; ///////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'E2secprc.h' then echo shar: will not over-write existing file "'E2secprc.h'" else cat << \SHAR_EOF > 'E2secprc.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : E2secprc.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS PlaneSector_Processor // ------------------------------------------------- // // BASECLASSES: // Processor // // PURPOSE: // transforms the plane sector into a semi-infinite strip // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1)PlaneSector_Processor() // ---------------------------- // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) void Process(Stack&) // ------------------------------------------------- // see Processor<> // // 2) virtual Processor* NewCopy() const=0 // ------------------------------------------------- // // makes a new copy (using the copy constructor) and // returns a pointer to it. ///////////////////////////////////////////////////////// #ifndef E2SECPRC_H #define E2SECPRC_H ////////////////////////////////////////////// #include #include ///////////////////////////////////////////// class PlaneSector_Processor: public Processor { public: PlaneSector_Processor(); void Process(Stack&); Processor* NewCopy() const; }; ///////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'E2tostrp.h' then echo shar: will not over-write existing file "'E2tostrp.h'" else cat << \SHAR_EOF > 'E2tostrp.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : E2tostrp.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS E2toIS // ------------------------------------------------- // // BASECLASSES: // Transformation // // PURPOSE: // transformation from plane to infinite strip // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) E2toIS(InfiniteStrip*) // ------------ // The target region has to be supplied // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) void Transform(real & w, Point & p) // -------------------------------------- // multiplies w by the Jacobian at p and then // replaces p by the transformed point // ///////////////////////////////////////////////////////// #ifndef E2TOSTRP_H #define E2TOSTRP_H ///////////////////////////////////////////////////////// #include #include #include #include /////////////////////////////////////////////////// class E2toIS : public Transformation { public: E2toIS( InfiniteStrip*); void Transform(real& w, Point& p); private: Pointer IS_ptr; }; ////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'S2.h' then echo shar: will not over-write existing file "'S2.h'" else cat << \SHAR_EOF > 'S2.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : S2.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Circle // -------------------------------- // // BASECLASSES: // Geometry // // PURPOSE: // Circle is a 2D circle with arbitrary center and // radius. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Circle(const Point& Center, real Radius) // -------------------------------- // defines the region. // // 2) Circle( const Point& Center, Point Boundary) // -------------------------------- // defines the region using its center and a point on the boundary. // SELECTORS: // 1) const Point& Center()const // ------------------------------ // // 2) real Radius() const // ----------------------- // // 3) real Volume() const // ---------------------- // // 4) Processor* DefaultProcessor()const // --------------------------------------------- // // MODIFIERS: // None // OPERATORS: // None // SPECIAL: // None // /////////////////////////////////////////////////////////// #ifndef S2_H #define S2_H ///////////////////////////////////////// #include #include #include #include ///////////////////////////////////////// class Circle : public Geometry { public: Circle(const Point& Center,real Radius); Circle(const Point& Center,const Point& Boundary); real Volume()const ; const Point& Center()const; real Radius() const; private: Point TheCenter; real TheRadius; }; ////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'S2adapt.h' then echo shar: will not over-write existing file "'S2adapt.h'" else cat << \SHAR_EOF > 'S2adapt.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : S2adapt.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Nov 1994 V0.1d(re-ordering of member declarations) // 25 Jan 1996 V0.1f(typedef introduced) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS CircleAdaptive // ------------------------------------------------- // // BASECLASSES: // Processor // // PURPOSE: // A circle processor. First a rule is // applied to the circle. Afterwards the circle is // divided into a central circle and some // polar rectangles. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1)CircleAdaptive(Rule*) // ------------------------------- // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) void Process( Stack) // ------------------------------------------------- // see class Processor // // 2) virtual Processor* NewCopy() const=0 // ------------------------------------------------- // // makes a new copy (using the copy constructor) and // returns a pointer to it. ///////////////////////////////////////////////////////// #ifndef S2ADAPT_H #define S2ADAPT_H ///////////////////////////////////////////////// #include #include #include #include ///////////////////////////////////////////////// class CircleAdaptive : public Processor { public: typedef Rule RuleCircle; CircleAdaptive( Rule * ); void Process(Stack& ); Processor* NewCopy() const; private: Pointer< RuleCircle > TheRule; CircleAdaptive* Descendant()const; unsigned int TimesCalled; unsigned int GenerationNumber; }; /////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'S2interf.h' then echo shar: will not over-write existing file "'S2interf.h'" else cat << \SHAR_EOF > 'S2interf.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : S2interf.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS CIRCLE // ------------------------------------------------- // // BASECLASSES: // USERINTERFACE // // PURPOSE: // end-user interface to circles // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) CIRCLE(const Point& Center, const Point& B) // ---------------------------------------------- // constructs a circle with Center as its origin // and B a point on the boundary. // // 2) CIRCLE(const Point& Center, real Radius) // ------------------------------------------- // // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef S2INTERF_H #define S2INTERF_H //////////////////////////////////////////////// #include #include //////////////////////////////////////////////// class CIRCLE : public USERINTERFACE { public: CIRCLE(const Point&,const Point&); CIRCLE(const Point&, real); }; //////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'S2rule13.h' then echo shar: will not over-write existing file "'S2rule13.h'" else cat << \SHAR_EOF > 'S2rule13.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : S2rule13.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Circle_Rule13 // ------------------------------------ // // BASECLASSES: // Rule // // // PURPOSE: // A degree 13 rule for a circle. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1)Circle_Rule13() // ------------------ // // SELECTORS: // 1) int Degree() const // --------------------- // returns 13 // // 2) int NumberOfPoints() const // -------------------------------------- // returns 36. // // MODIFIERS: // None // OPERATORS: // None // SPECIAL: // 1) Apply(Integrand& I,Circle& H, // real& Result,real& Error) // ------------------------------------------------- // Inputparameters: // I: the integrand // H: circle to be integrated. H.Dimension() // should be 2. // Outputparameters: // Result: approximation to the integral // Error: absolute error estimation // /////////////////////////////////////////////////////////// #ifndef S2RULE13_H #define S2RULE13_H ///////////////////////////////////////// #include #include ////////////////////////////////////////// class Circle_Rule13 : public Rule { public: Circle_Rule13(); void Apply(Integrand&,Circle&,real& Result ,real& Error); int NumberOfPoints() const {return 36;}; int Degree () const {return 13;}; }; //////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'T2.h' then echo shar: will not over-write existing file "'T2.h'" else cat << \SHAR_EOF > 'T2.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : T2.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Triangle // ------------------------------------------------- // // BASECLASSES: // Geometry // // PURPOSE: // implements the geometry of a simple triangle // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Triangle (const Point&,const Point&,const Point&) // ---------------------------------------------------- // constructs a 2D Triangle given its 3 vertices // // SELECTORS: // 1) const Point& Vertex(int i) const // ----------------------------------- // returns the i-th vertex, 0<=i<3 // // 2) real Volume() const // ----------------------- // // 3) Processor* DefaultProcessor() const // ------------------------------------------------ // // MODIFIERS: // 1) void Volume(real) // -------------------- // informs the triangle about its volume, to avoid // future computations of it // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef T2_H #define T2_H ////////////////////////////////////////////////// #include #include #include #include #include #include ////////////////////////////////////////////////// class Triangle : public Geometry { public : Triangle(const Point&,const Point&,const Point&); const Point& Vertex (int) const; real Volume() const; void Volume(real); private: Vector Vertices; real TheVolume; Boolean TheVolumeKnown; void ComputeVolume(); }; //////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'T2dv4.h' then echo shar: will not over-write existing file "'T2dv4.h'" else cat << \SHAR_EOF > 'T2dv4.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : T2dv4.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Triangle_Divide4 // ------------------------------------------ // // BASECLASSES: // SameShapeDivisor // // // PURPOSE: // provides a means to cut Triangles in 4. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Triangle_Divide4() // --------------------- // // SELECTORS: // 1) NumberOfParts() const // ------------------------ // returns 4 // // MODIFIERS: // None // OPERATORS: // None // SPECIAL: // 1) void Apply(Triangle& H, // Stack& S,const Vector& D) // -------------------------------- // divides H into parts and returns them in S // /////////////////////////////////////////////////////////// #ifndef T2DV4_H #define T2DV4_H ////////////////////////////////////////// #include #include //////////////////////////////////////// class Triangle_Divide4 :public SameShapeDivisor { public: Triangle_Divide4(); void Apply(const Triangle&, Stack&, const Vector&); int NumberOfParts() const {return 4;}; }; ////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'T2interf.h' then echo shar: will not over-write existing file "'T2interf.h'" else cat << \SHAR_EOF > 'T2interf.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : T2interf.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS TRIANGLE // ---------------------------- // // BASECLASSES: // USERINTERFACE // // PURPOSE: // an end-user interface to Triangle // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1)TRIANGLE(const Point& , const Point&, const Point&) // --------------------------------------------------- // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef T2INTERF_H #define T2INTERF_H /////////////////////////////////////////////////// #include #include /////////////////////////////////////////////////// class TRIANGLE : public USERINTERFACE { public: TRIANGLE(const Point&,const Point&,const Point&); }; ////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'T2rule13.h' then echo shar: will not over-write existing file "'T2rule13.h'" else cat << \SHAR_EOF > 'T2rule13.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : T2rule13.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Triangle_Rule13 // ------------------------------------ // // BASECLASSES: // Rule // // // PURPOSE: // A degree 13 rule for a rectangle. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1)Triangle_Rule13() // ------------------- // // SELECTORS: // 1) int Degree() const // --------------------- // returns 13 // // 2) int NumberOfPoints() const // -------------------------------------- // returns 37. // // MODIFIERS: // None // OPERATORS: // None // SPECIAL: // 1) Apply(Integrand& I,Triangle& H,real& Result,real& // Error) // ------------------------------------------------- // Input parameters: // I: the integrand // H: Triangle to be integrated. // Output parameters: // Result: approximation to the integral // Error: absolute error estimation // /////////////////////////////////////////////////////////// #ifndef T2_RULE13 #define T2_RULE13 /////////////////////////////////////////// #include #include /////////////////////////////////////////// class Triangle_Rule13 :public Rule { public: Triangle_Rule13(); void Apply(Integrand&,Triangle& ,real&,real& ); int Degree() const {return 13;}; int NumberOfPoints () const {return 37;}; }; /////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'T2tops.h' then echo shar: will not over-write existing file "'T2tops.h'" else cat << \SHAR_EOF > 'T2tops.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : T2tops.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Nov 1994 V0.1d(re-ordering of member declarations) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS C2toGR // ------------------------------------------------- // // BASECLASSES: // Transformation // // PURPOSE: // transformation from triangle to parabolic segment // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) T2toPS(ParabolicSegment* g) // ------------ // the target region has to be supplied // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) void Transform(real & w, Point & p) // -------------------------------------- // multiplies w by the Jacobian at p and then // replaces p by the transformed point // ///////////////////////////////////////////////////////// #ifndef T2TOPS_H #define T2TOPS_H ///////////////////////////////////////////////////////// #include #include #include #include /////////////////////////////////////////////////// class T2toPS : public Transformation { public: T2toPS( ParabolicSegment*); void Transform(real& w, Point& p); private: Point P,M,H; real a,k; }; ////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'atomic.h' then echo shar: will not over-write existing file "'atomic.h'" else cat << \SHAR_EOF > 'atomic.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : atomic.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(typedef introduced) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Atomic // ------------------------------------------------- // // BASECLASSES: // AtomicRegion // // PURPOSE: // provides a base class to all atomic regions. // provides a means for constructing them, as well // as for altering their integrand or processor // provides a method for processing them // // TEMPLATES: // it should be instantiated with a class GEOMETRY // derived from Geometry // this GEOMETRY should have a member // Processor* DefaultProcessor() const. // // METHODS: // CONSTRUCTORS: // 1) Atomic(GEOMETRY* G, Processor* P ) // ------------------------------------------ // constructs an atomic region with *G as its geometry // and *P as its processor // // // SELECTORS: // None // // MODIFIERS: // 1) Use(Processor* P) // ----------------------------- // to change the processor to be used // // 2) LocalIntegrand(Integrand* I) // ------------------------------- // to change the integrand // // OPERATORS: // None // // SPECIAL: // 1) Process( Stack& Offspring) // ------------------------------------------- // attempts to compute an integral and an error // estimate. possible offspring is returned. // ///////////////////////////////////////////////////////// #ifndef ATOMIC_H #define ATOMIC_H //////////////////////////////////////////// #include #include ////////////////////////////////////////// template class Atomic : public AtomicRegion { friend class Processor; public: typedef Processor ProcessorGEOMETRY; Atomic(GEOMETRY*, Processor*); void Use(Processor*); void Process(Stack& Offspring); void LocalIntegrand(Integrand*); private: Pointer G_ptr; Pointer< ProcessorGEOMETRY> RP_ptr; Pointer I_ptr; RegionInfo* LocalRegionInfo() ; }; /////////////////////////////////////////////// #include #ifdef TEMPLATEINCLUDE #include #endif /////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'atomreg.h' then echo shar: will not over-write existing file "'atomreg.h'" else cat << \SHAR_EOF > 'atomreg.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : atomreg.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS AtomicRegion // -------------------------------- // // BASECLASSES: // Region // // PURPOSE: // common base class to all Atomic<> regions, merely // to be able to group them in a single set. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) AtomicRegion() // ----------------- // // SELECTORS: // None // // MODIFIERS: // 1) void LocalIntegrand(Integrand*) // ---------------------------------- // to change the integrand // // // OPERATORS: // None // // SPECIAL: // 1) void Process(Stack& Offspring) // ----------------------------------------------- // attempts to compute integral and error over // the region. possible Offspring is returned. // ///////////////////////////////////////////////////////// #ifndef ATOMREG_H #define ATOMREG_H /////////////////////////////////////////////// #include #include #include /////////////////////////////////////////////// class AtomicRegion : public Region { public: AtomicRegion(); virtual void LocalIntegrand(Integrand*)=0; virtual void Process(Stack& Offspring)=0; virtual ~AtomicRegion(); }; ///////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'boolean.h' then echo shar: will not over-write existing file "'boolean.h'" else cat << \SHAR_EOF > 'boolean.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : boolean.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// #ifndef BOOLEAN_H #define BOOLEAN_H ///////////////////////////////////////////////// #include ///////////////////////////////////////////////// enum Boolean {False, True}; extern ostream& operator<<(ostream&,const Boolean&); ////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'chrono.h' then echo shar: will not over-write existing file "'chrono.h'" else cat << \SHAR_EOF > 'chrono.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : chrono.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 28 Mar 1996 V0.1h(long instead of int) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Chrono // -------------------------- // // BASECLASSES: // Counter // // PURPOSE: // Chrono implements a simple stop-watch; it can be used for // all sorts of timings. At the moment it will only give // useful results when compiled with -DGETRUSAGE on a // system that has a getrusage() system call. If // GETRUSAGE is not defined, Read() will always return 0. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Chrono() // ----------- // Default constructor. The stop-watch isn't running after // construction. // SELECTORS: // 1) unsigned long Read() // ---------------- // Read reads out the time in milliseconds. Currently it // is accurate up to one millisecond. // MODIFIERS: // 1) void Start() // --------------- // Start() makes the stop-watch running. Successive calls // of Start() have no effect. // 2) void Stop() // --------------- // Stops the stop-watch. After Stop(), Read() will always // read out the same value, until the stop-watch is started // again. Stopping a stopped stop-watch has no effect. // 3) void Reset() // --------------- // After a call of Reset(), Read() will read out zero, // until the stop-watch is started again. A running // stop-watch should not be Reset(). // // OPERATORS: // None // SPECIAL: // None ////////////////////////////////////////////////////////// #ifndef CHRONO_H #define CHRONO_H ////////////////////////////////////////////////////////// #include #include ////////////////////////////////////////////////////////// class Chrono :public Counter { public: Chrono(); void Start(); void Stop(); void Reset(); unsigned long Read(); private: long Time; long OldTime; Boolean Running; long times_(); }; ///////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'compreg.h' then echo shar: will not over-write existing file "'compreg.h'" else cat << \SHAR_EOF > 'compreg.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : compreg.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS COMPOUND_REGION // ------------------------------------------------- // // BASECLASSES: // Region // // PURPOSE: // groups regions and their eventual offspring. applies // the global adaptive algorithm. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) COMPOUND_REGION() // ------------------- // an empty compound region is created. the integral // and error over it will be 0. calls of Process() // will have no effect. // // 2) COMPOUNDERGION(const COMPOUND_REGION& C) // ------------------------------------------ // implements sharing semantics !! // // SELECTORS: // None // // MODIFIERS: // 1) void LocalIntegrand (Integrand* I) // ------------------------------------ // establishes *I as the integrand to be integrated // on all subregions that are contained in *this. // When subsequent calls are made, only the last one // has effect. It's an error to call this function // after the first call of Process(). // // // 2) void Process() // ----------------- // performs one step in the global adaptive algorithm. // the first call of Process() will compute an initial // approximation; subsequent calls will try to improve // this // // OPERATORS: // // 1) COMPOUND_REGION& operator= // (const COMPOUND_REGION& C) // --------------------------------- // implements sharing semantics !! // // SPECIAL: // None // // NOTE: The other public members are not to be // used by normal clients. ///////////////////////////////////////////////////////// #ifndef COMPREG_H #define COMPREG_H ///////////////////////////////////////////// #include #include #include #include #include ///////////////////////////////////////////// ///////////////////////////////////////////// class COMPOUND_REGION : public Region { public: virtual void LocalIntegrand(Integrand*)=0; void Process(); COMPOUND_REGION(); virtual ~COMPOUND_REGION(); virtual void Preprocess()=0; virtual void Improve()=0; virtual real MaxAtomicError()const=0; virtual COMPOUND_REGION* NewCopy()const =0; private: enum Status {Virgin,Active}; Status TheStatus; }; /////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'counter.h' then echo shar: will not over-write existing file "'counter.h'" else cat << \SHAR_EOF > 'counter.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : counter.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 28 Mar 1996 V0.1h(long instead of int) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Counter // --------------------------- // // BASECLASSES: // None // // // PURPOSE: // Counter is a pure virtual base class for implementing // stop-watch-like classes. // // TEMPLATES: // None // METHODS: // CONSTRUCTORS: // None // // SELECTORS: // 1) virtual unsigned long Read()=0 // -------------------------- // Read reads out the counter // MODIFIERS: // 1) virtual void Start()=0 // ------------------------- // Start() makes the stop-watch running. Successive calls // of Start() have no effect. // 2) virtual void Stop()=0 // ------------------------- // Stops the stop-watch. After Stop(), Read() will always // read out the same value, until the stop-watch is started // again. Stopping a stopped stop-watch has no effect. // 3) virtual void Reset()=0 // ------------------------- // After a call of Reset(), Read() will read out zero, // until the stop-watch is started again. A running // stop-watch should not be Reset(). // // OPERATORS: // None // SPECIAL: // None /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// #ifndef COUNTER_H #define COUNTER_H ////////////////////////////////////////////// class Counter { public: virtual void Start()=0; virtual void Stop()=0; virtual void Reset()=0; virtual unsigned long Read()=0; }; ////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'cubpack.h' then echo shar: will not over-write existing file "'cubpack.h'" else cat << \SHAR_EOF > 'cubpack.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : cubpack.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // PURPOSE: // an include file for the end-user ///////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include SHAR_EOF fi # end of overwriting check if test -f 'div.h' then echo shar: will not over-write existing file "'div.h'" else cat << \SHAR_EOF > 'div.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : div.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Divisor // --------------------------- // // BASECLASSES: // ReferenceCounting // // // PURPOSE: // Divisor is a pure virtual base class for implementing // dividing-procedures. Information on the number of // parts the divisor produces, can be retrieved. // // TEMPLATES: // The type of region T which has to be divided is // templated. Currently it is assumed that the parts // after division also are of type T. T should be // derived from class Region. // // METHODS: // CONSTRUCTORS: // 1) Divisor() // ------------ // // SELECTORS: // 1) virtual int NumberOfParts() const=0 // --------------------------------------------------- // returns the number of parts the divisor produces. // // MODIFIERS: // None // OPERATORS: // None // SPECIAL: // None /////////////////////////////////////////////////////////// #ifndef DIV_H #define DIV_H ///////////////////////////////////////// #include ////////////////////////////////////////// template class Divisor: public ReferenceCounting { public: Divisor(); virtual int NumberOfParts() const =0; virtual ~Divisor(); }; /////////////////////////////////////////// #include #ifdef TEMPLATEINCLUDE #include #endif ////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'error.h' then echo shar: will not over-write existing file "'error.h'" else cat << \SHAR_EOF > 'error.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : error.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // PURPOSE // void Error(Boolean b,char* message) is an error // checking and reporting routine. if b is true then // message is printed on stderr and the program is // aborted. ///////////////////////////////////////////////////////// #ifndef ERROR_H #define ERROR_H //////////////////////////////////////// #include #include #include //////////////////////////////////////// inline void Error(int b,char* message) { if (b) { cerr << message < 'eval_ctr.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : eval_ctr.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 28 Mar 1996 V0.1h(long instead of int) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS EvaluationCounter // ------------------------------------- // // BASECLASSES: // Counter // // // PURPOSE: // EvaluationCounter acts as a kind of stop-watch // counting the number of Integrand evaluations // during the time it's running. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) EvaluationCounter() // ---------------------- // Default constructor. The stop-watch isn't running after // construction. // SELECTORS: // 1) unsigned long Read() // ---------------- // Read reads out the number of // IntegrandEvaluations made since Start() was // called. This value remains constant after Stop() is // called. // MODIFIERS: // 1) void Start() // --------------- // Start() makes the stop-watch running. Successive calls // of Start() have no effect. // 2) void Stop() // --------------- // Stops the stop-watch. After Stop(), Read() will always // read out the same value, until the stop-watch is started // again. Stopping a stopped stop-watch has no effect. // 3) void Reset() // --------------- // After a call of Reset(), Read() will read out zero, // until the stop-watch is started again. A running // stop-watch should not be Reset(). // // 4) void Reset(unsigned long value) // ---------------------------------- // allows you to reset the counter to some other // value than zero. Counting will start from this value. // // OPERATORS: // None // SPECIAL: // None /////////////////////////////////////////////////////////// #ifndef EVAL_CTR_H #define EVAL_CTR_H ///////////////////////////////// #include #include //////////////////////////////////////////////// class EvaluationCounter : public Counter { public: EvaluationCounter(); void Start(); void Stop(); void Reset(); void Reset(unsigned long); unsigned long Read(); private: long Strt; long End; unsigned long Bias; Boolean Running; }; //////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'function.h' then echo shar: will not over-write existing file "'function.h'" else cat << \SHAR_EOF > 'function.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : function.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // PURPOSE: // mapping from a Point to a real ///////////////////////////////////////////////////////// #ifndef FUNCTION_H #define FUNCTION_H ///////////////////////////////////////////////////////// #include #include ///////////////////////////////////////////////////////// typedef real (*Function)(const Point&); ///////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'geometry.h' then echo shar: will not over-write existing file "'geometry.h'" else cat << \SHAR_EOF > 'geometry.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : geometry.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Geometry // ------------------------------------------------- // // BASECLASSES: // ReferenceCounting // // PURPOSE: // common base for all geometries // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Geometry( unsigned int Dim) // ------------------------------ // the Dimension must be provided. // // SELECTORS: // 1) unsigned int Dimension() const // --------------------------------- // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef GEOMETRY_H #define GEOMETRY_H ///////////////////////////////////////////////////////// #include ////////////////////////////////////////////////// class Geometry : public ReferenceCounting { public: Geometry (unsigned int Dim); unsigned int Dimension()const; private: unsigned int TheDimension; }; ////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'gr.h' then echo shar: will not over-write existing file "'gr.h'" else cat << \SHAR_EOF > 'gr.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : gr.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Nov 1994 V0.1d(re-ordering of member declarations) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Generalized Rectangle // ----------------------------------------- // // BASECLASSES: // Geometry // // PURPOSE: // implements a generalized rectangle // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) GeneralizedRectangle(Function f, // const Point& A, const Point& B) // --------------------------------------------------- // constructs a generalized rectangle with two points // and a function; f(P) is the length of the // perpendicular to // the boundary from a point P on the line AB. // // SELECTORS: // 1) const Point& A() const // ------------------------- // returns the point A (see constructor) // // 2) const Point& B() const // ------------------------- // returns the point B (see constructor) // // 3) real Boundary(const Point& P)const // ------------------------------------- // evaluates the boundary function at P(see constructor) // // 4) Processor* // DefaultProcessor() const // ----------------------------------- // // MODIFIERS: // None // // OPERATORS: // None // SPECIAL: // None // /////////////////////////////////////////////////////////// #ifndef gr2_H #define gr2_H ////////////////////////////////////////////////// #include #include #include #include ////////////////////////////////////////////////// class GeneralizedRectangle : public Geometry { public: GeneralizedRectangle (Function, const Point&,const Point&); const Point& A() const; const Point& B() const; real Boundary(const Point&) const; private: const Function TheBoundary; Point TheA; Point TheB; }; ////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'gritf.h' then echo shar: will not over-write existing file "'gritf.h'" else cat << \SHAR_EOF > 'gritf.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : gritf.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS GENERALIZED_RECTANGLE // ------------------------------------------------- // // BASECLASSES: // USERINTERFACE // // PURPOSE: // End-user interface to Generalized Rectangles // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) GENERALIZED_RECTANGLE(Function f, // const Point& A, const Point& B) // --------------------------------------------------- // constructs a generalized rectangle with two points // and a function; f(P) is the length of the // perpendicular to // the boundary from a point P on the line AB. // // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef GRITF_H #define GRITF_H //////////////////////////////////////////// #include #include //////////////////////////////////////////// class GENERALIZED_RECTANGLE : public USERINTERFACE { public: GENERALIZED_RECTANGLE(Function, const Point&,const Point&); }; //////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'gs.h' then echo shar: will not over-write existing file "'gs.h'" else cat << \SHAR_EOF > 'gs.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : gs.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Generalized Sector // ----------------------------------------- // // BASECLASSES: // Geometry // // PURPOSE: // implements a generalized sector // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) GeneralizedSector(Function f, // real alpha, real beta, const Point& Center) // --------------------------------------------------- // the region is bounded by 2 straight lines going // through Center and having an angle of alpha and // beta respectively with the positive X-axis. a // third boundary line is provided by f, which denotes // the distance from the Center to the boundary for // all angles between alpha and beta. // // SELECTORS: // 1) real Alpha() const // ------------------------- // returns alpha (see constructor) // // 2) real Beta() const // ------------------------- // returns beta (see constructor) // // 3) real Boundary(real P)const // ------------------------------------- // evaluates the boundary function at P(see constructor) // // 4) const Point& Center() const // ------------------------------- // MODIFIERS: // None // // OPERATORS: // None // SPECIAL: // None // /////////////////////////////////////////////////////////// #ifndef GS_H #define GS_H ////////////////////////////////////////////////// #include #include ////////////////////////////////////////////////// typedef real (*RealFunction)(real); ////////////////////////////////////////////////// class GeneralizedSector : public Geometry { public: GeneralizedSector (real(*)(real), real,real,const Point&); real Alpha() const; real Beta() const; real Boundary(real) const; RealFunction Boundary() const; const Point& Center() const; private: Point TheCenter; real TheAlpha,TheBeta; real(*TheBoundary)(real); }; ////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'gsitf.h' then echo shar: will not over-write existing file "'gsitf.h'" else cat << \SHAR_EOF > 'gsitf.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : gritf.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS GENERALIZED_SECTOR // ------------------------------------------------- // // BASECLASSES: // USERINTERFACE // // PURPOSE: // End-user interface to Generalized Rectangles // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) GENERALIZED_SECTOR(real (*F) real, // real Alpha, real Beta, const Point& Center) // --------------------------------------------------- // the region is bounded by 2 straight lines going // through Center and having an angle of alpha and // beta respectively with the positive X-axis. a // third boundary line is provided by f, which denotes // the distance from the Center to the boundary for // all angles between alpha and beta. // // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef GSITF_H #define GSITF_H //////////////////////////////////////////// #include #include //////////////////////////////////////////// class GENERALIZED_SECTOR : public USERINTERFACE { public: GENERALIZED_SECTOR( real(*)(real), real,real,const Point&); }; /////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'gsprc.h' then echo shar: will not over-write existing file "'gsprc.h'" else cat << \SHAR_EOF > 'gsprc.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : gsprc.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS GeneralizedSector_Processor // ------------------------------------------------- // // BASECLASSES: // Processor // // PURPOSE: // transforms the generalized sector into a rectangle // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1)GeneralizedSector_Processor() // ---------------------------- // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) void Process(Stack&) // ------------------------------------------------- // see Processor<> // // 2) virtual Processor* NewCopy() const=0 // ------------------------------------------------- // // makes a new copy (using the copy constructor) and // returns a pointer to it. ///////////////////////////////////////////////////////// #ifndef GSPRC_H #define GSPRC_H ////////////////////////////////////////////// #include #include ///////////////////////////////////////////// class GeneralizedSector_Processor : public Processor { public: GeneralizedSector_Processor(); void Process(Stack&); Processor* NewCopy() const ; }; ///////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'heap.h' then echo shar: will not over-write existing file "'heap.h'" else cat << \SHAR_EOF > 'heap.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : heap.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Heap // ------------------------ // // BASECLASSES: // Set // // // PURPOSE: // implements a heap. elements can be added and the // largest element can be accessed. // // TEMPLATES: // The type T of the elements is templated. T must // provide a T* NewCopy() as well as relational // operators <,>,<= and >= // // METHODS: // CONSTRUCTORS: // 1) Heap() // --------- // default constructor // SELECTORS: // 1) T* Look() // ------------ // returns a pointer to the largest element. this // element is not removed from the heap. No copy // is made, so modifications of the element are // potentially dangerous. // MODIFIERS: // 1) T* Get() // ----------- // returns a pointer to the largest element. this // element is removed from the heap. // // 2) void Clear() // -------------- // makes the heap empty and destroys all of its // elements // // OPERATORS: // 1) void operator+=(T* R) // ------------------------------ // Puts a pointer to *R into the heap. // // 2) void operator+=(Heap& H) // ------------------------------ // puts all elements of H in the heap. no copies are // made and the state of H is not defined afterwards. // // SPECIAL: // None // NOTE: // Heap uses a class SubHeap in its implementation. // This class should be thought of as being local to // Heap. However the current compiler we used did not // support nested classes within templates. Direct use // of SubHeap is not recommended, since it will // eventually become local to Heap. /////////////////////////////////////////////////////////// #ifndef HEAP_H #define HEAP_H #include ////////////////////////////////////////////// #include #include #include ///////////////////////////////////////////// template class SubHeap : public Set { public: SubHeap(); ~SubHeap(); T* Get(); T* Look() ; T* Swap( T*); T* Bottom() ; void Clear(); void operator +=( T*); Boolean Saturated() const; void Print() const ; int LeftChild(int) const; int RightChild(int) const; int FatherOfChild(int) const; private: #ifdef SOLARIS T* Contents[256]; SubHeap* Children[256]; #else T* Contents[CAPACITY+1]; SubHeap* Children[CAPACITY+1]; #endif int ActiveChild; int LastChild; }; //////////////////////////////////////////// template class Heap : public Set { public: Heap(); ~Heap(); T* Get(); T* Look() ; void Clear(); void operator+= ( T*); void operator+= (Heap&); void Print() const; private: SubHeap TheSubHeap; }; //////////////////////////////////////////// #ifdef TEMPLATEINCLUDE #include #endif #endif SHAR_EOF fi # end of overwriting check if test -f 'integran.h' then echo shar: will not over-write existing file "'integran.h'" else cat << \SHAR_EOF > 'integran.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : integran.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 8 Sep 1994 V0.1a(operator added) // 25 Jan 1996 V0.1f(typedef introduced) // 28 Mar 1996 V0.1h(long instead of int) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Integrand // ----------------------------- // // BASECLASSES: // ReferenceCounting // // PURPOSE: // implements an integrand class. Apart from evaluating // integrands, it takes care of counting the number of // evaluations and it permits the integrand to be // transformed. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Integrand( Function f) // --------------------------------- // constructs the Integrand. The function to be // integrated is f. // // 2) Integrand( const Integrand& I) // --------------------------------- // copy constructor // // 3) Integrand( const Integrand& I, // const Transformation& T) // -------------------------------------- // constructs a new Integrand by applying T to I // // 4) Integrand() // -------------- // constructs an Integrand without the function // to be integrated being known. an evaluation of // this Integrand results in an error. // // SELECTORS: // 1)static long NumberOfEvaluations() // ---------------------------------- // returns the total number of function evaluations // since the program was started. // See also class EvaluationCounter. // // MODIFIERS: // None // OPERATORS: // 1) real operator() (const Point& p) // ------------------------------------- // evaluates the Integrand at Point p. // // SPECIAL: // None /////////////////////////////////////////////////////////// #ifndef INTEGRAN_H #define INTEGRAN_H #include #include #include #include #include #include #include /////////////////////////////////////////////////////// class Integrand : public ReferenceCounting { public: typedef Pointer< Transformation > PointerTransformation; Integrand(); Integrand(Function); Integrand(const Integrand&,Transformation* ); Integrand(const Integrand&); real operator()(const Point&); Boolean operator==(const Integrand&) const; static long NumberOfEvaluations(); private: static long Number; Function TheFunction; VectorStack< PointerTransformation > AppliedTransformations; }; #endif SHAR_EOF fi # end of overwriting check if test -f 'integrat.h' then echo shar: will not over-write existing file "'integrat.h'" else cat << \SHAR_EOF > 'integrat.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : integrat.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 28 Mar 1996 V0.1h(DefaultMaxEval = unsigned long) ///////////////////////////////////////////////////////// // PURPOSE: // Integrate is the algorithm controller of Cubpack++. // 4 different versions are supplied: // // 1)real Integrate( // Function f, // COMPOUND_REGION& TheCollection, // real RequestedAbsolute, // real RequestedRelative, // unsigned long MaxEval, // ); // ----------------------------------------------- // input parameters: // RequestedAbsolute: absolute error request // RequestedRelative: relative error request // MaxEval: bound on the number of function // evaluations. // f:the integrand // return value: // the approximation of the integral is returned // in-out parameters: // TheCollection: collection of regions over which the // integration is to take place. // On return, TheCollection.Integral() // will contain an approximation of the // integral. // // // 2)real Integrate( // COMPOUND_REGION& TheCollection, // real RequestedAbsolute, // real RequestedRelative, // unsigned long MaxEval, // ); // ----------------------------------------------- // input parameters: // RequestedAbsolute: absolute error request // RequestedRelative: relative error request // MaxEval: bound on the number of function // evaluations. // return value: // the approximation of the integral is returned // in-out parameters: // TheCollection: collection of regions over which the // integration is to take place. // Before the call of Integrate() // a local integrand must have been // specified for all members of TheCollection // On return, TheCollection.Integral() // will contain an approximation of the // integral. // // // 3)void Integrate( // Function f, // COMPOUND_REGION& TheCollection, // real& Integral, // real& AbsErr, // real RequestedAbsolute, // real RequestedRelative, // unsigned long MaxEval, // ); // ----------------------------------------------- // input parameters: // RequestedAbsolute: absolute error request // RequestedRelative: relative error request // MaxEval: bound on the number of function // evaluations. // f:the integrand // output parameters: // Integral: approximation of the integral // AbsError: estimate of the error // in-out parameters: // TheCollection: collection of regions over which the // integration is to take place. // On return, TheCollection.Integral() // will contain an approximation of the // integral. // // // 4)void Integrate( // COMPOUND_REGION& TheCollection, // real& Integral, // real& AbsErr, // real RequestedAbsolute, // real RequestedRelative, // unsigned long MaxEval, // ); // ----------------------------------------------- // input parameters: // RequestedAbsolute: absolute error request // RequestedRelative: relative error request // MaxEval: bound on the number of function // evaluations. // output parameters: // Integral: approximation of the integral // AbsError: estimate of the error // in-out parameters: // TheCollection: collection of regions over which the // integration is to take place. // Before the call of Integrate() // a local integrand must have been // specified for all members of TheCollection // On return, TheCollection.Integral() // will contain an approximation of the // integral. /////////////////////////////////////////////////////// #include #ifndef INTEGRAT_H #define INTEGRAT_H const unsigned long DefaultMaxEval = 100000; const real DefaultAbsErrReq = 0.0; const real DefaultRelErrReq = DEFAULT_REL_ERR_REQ; extern real Integrate( Function f, COMPOUND_REGION& R, real AbsErrReq = DefaultAbsErrReq, real RelErrReq = DefaultRelErrReq, unsigned long MaxEval = DefaultMaxEval); extern real Integrate( COMPOUND_REGION& R, real AbsErrReq = DefaultAbsErrReq, real RelErrReq = DefaultRelErrReq, unsigned long MaxEval = DefaultMaxEval); extern void Integrate( Function f, COMPOUND_REGION& R, real& Integral, real& AbsError, Boolean& Success, real AbsErrReq , real RelErrReq , unsigned long MaxEval ); extern void Integrate( COMPOUND_REGION& R, real& Integral, real& AbsError, Boolean& Success, real AbsErrReq , real RelErrReq , unsigned long MaxEval ); #endif SHAR_EOF fi # end of overwriting check if test -f 'invert.h' then echo shar: will not over-write existing file "'invert.h'" else cat << \SHAR_EOF > 'invert.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : invert.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Invert // -------------------------- // // BASECLASSES: // Transformation // // // PURPOSE: // Inverts with respect to a given (arbitrary) circle // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Invert(Circle* ) // -------------------- // // SELECTORS: // None // MODIFIERS: // None // OPERATORS: // None // SPECIAL: // 1) void Transform (real& w, Point& p) // --------------------------------------- // Multiplies w by the Jacobian at p and then replaces p by // the transformed point. // /////////////////////////////////////////////////////////// #ifndef INVERT_H #define INVERT_H //////////////////////////////////////////////////////// #include #include #include /////////////////////////////////////////////////////// class Invert :public Transformation { public: Invert(Circle*); void Transform (real &w, Point& p); private: Pointer C_ptr; real RadiusSq; }; //////////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'outS2.h' then echo shar: will not over-write existing file "'outS2.h'" else cat << \SHAR_EOF > 'outS2.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : outS2.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS OutCircle // ------------------------------------------------- // // BASECLASSES: // Circle // // PURPOSE: // the complement of a circle // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) OutCircle(const Point& C, const Point& B) // -------------------------------------------- // the complement of a circle centred at C and having // B as a point on its boundary. // // 2) OutCircle(const Point& C,real Radius) // ---------------------------------------- // the complement of a circle centred at C and having // Radius as its radius. // // SELECTORS: // 1) Processor* DefaultProcessor() const // ------------------------------------------------- // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef OUTS2_H #define OUTS2_H //////////////////////////////////////////////// #include /////////////////////////////////////////////// class OutCircle : public Circle { public: OutCircle(const Point&,const Point&); OutCircle(const Point&,real); }; //////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'outS2itf.h' then echo shar: will not over-write existing file "'outS2itf.h'" else cat << \SHAR_EOF > 'outS2itf.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : outS2itf.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS OUT_CIRCLE // ------------------------------------------------- // // BASECLASSES: // USERINTERFACE // // PURPOSE: // end-user interface to OutCircle // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) OUT_CIRCLE(const Point& Center, const Point& B) // ---------------------------------------------- // constructs a OutCircle with Center as its origin // and B a point on the boundary. // // 2) OUT_CIRCLE(const Point& Center, real Radius) // ------------------------------------------- // // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef OUTS2ITF_H #define OUTS2ITF_H //////////////////////////////////////////////// #include #include #include //////////////////////////////////////////////// class OUT_CIRCLE : public USERINTERFACE { public: OUT_CIRCLE(const Point&,const Point&); OUT_CIRCLE(const Point&, real); }; //////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'passbuck.h' then echo shar: will not over-write existing file "'passbuck.h'" else cat << \SHAR_EOF > 'passbuck.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : passbuck.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS PassTheBuck // ------------------------------------------------- // // BASECLASSES: // Processor // // PURPOSE: // a processor for all regions that are immediately // transformed into new ones. // // TEMPLATES: // FROM: the new region, an Atomic<> // TO: the present Geometry // VIA: a Transformation from FROM to TO; it should have // a constructor with a TO* as its only argument. // // METHODS: // CONSTRUCTORS: // 1) PassTheBuck(AtomicRegion*) // --------------------- // The new region must be provided . // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) void Process(Stack&) // ------------------------------------------------- // see Processor<> // // 2) virtual Processor* NewCopy() const=0 // ------------------------------------------------- // // makes a new copy (using the copy constructor) and // returns a pointer to it. ///////////////////////////////////////////////////////// #ifndef PASSBUCK_H #define PASSBUCK_H /////////////////////////////////////////// #include #include /////////////////////////////////////////// template class PassTheBuck : public Processor { public: PassTheBuck(AtomicRegion*); void Process(Stack&); Processor* NewCopy() const; private: AtomicRegion* AR_ptr; }; ////////////////////////////////////////// #include #ifdef TEMPLATEINCLUDE #include #endif ////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'patchlevel.h' then echo shar: will not over-write existing file "'patchlevel.h'" else cat << \SHAR_EOF > 'patchlevel.h' #define PATCHLEVEL 6 SHAR_EOF fi # end of overwriting check if test -f 'point.h' then echo shar: will not over-write existing file "'point.h'" else cat << \SHAR_EOF > 'point.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : point.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(file name changed) ///////////////////////////////////////////////////////// #ifndef POINT_H #define POINT_H ////////////////////////////////////// #include /////////////////////////////////////// typedef Point_2D Point; ///////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'point2D.h' then echo shar: will not over-write existing file "'point2D.h'" else cat << \SHAR_EOF > 'point2D.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : point2D.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(file name changed) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Point_2D // ------------------------- // // BASECLASSES: // None // // PURPOSE: // Implements 2-dimensional points. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Point_2D() // ---------- // default constructor. // the point must be initialized afterwards with an // assignment. // // 2) Point_2D(const Point_2D&) // ---------------------- // copy constructor // // 3) Point_2D(const real, const real) // ------------------------------------ // constructor. Two Cartesian coordinates are given. // // 4) Point_2D (int l) // --------------------- // constructs a point of dimension l, l must be 2 // // SELECTORS: // 1) real X()const // -------------------- // returns the first component of the Point_2D. // // 2) real Y() const // -------------------- // returns the second component of the Point_2D. // // 3) real R()const // -------------------- // returns the first component of the Point_2D. // not to be confused with Length() // // 4) real Theta() const // ------------------------ // returns the second component of the Point_2D. // not to be confused with Angle() // // 5) real operator[] (int i) const // -------------------------------- // returns the i-th component. 0<=i<=1. // // 6) real Length() const // ---------------------- // returns the length of the vector from (0,0) to point. // // 7) real Angle() const // ----------------------- // returns the angle (in [0, 2pi) ) between the // vector and positive X-axis // // 8) Point_2D Proj(const Point_2D& d) const // ----------------------------------------- // returns the projection of the point on a // line with direction d // // 9) int Size() const // -------------------- // returns the dimension of the point. (=2) // // MODIFIERS: // 1) real& X() // ------------ // returns the first component of the Point_2D. // // 2) real& Y() // ------------ // returns the second component of the Point_2D. // // 3) real& R() // ----------- // returns the first component of the Point_2D. // not to be confused with Length() // // 4) real& Theta() // ---------------- // returns the second component of the Point_2D. // not to be confused with Angle() // // 5) real& operator[] (int i) // ---------------------------- // returns the i-th component. 0<=i<=1. // // OPERATORS: // 1)Point_2D& operator=(const Point_2D&); // -------------------------------- // assignment operator // // 2)Point_2D operator+(const Point_2D&) const; // -------------------------------- // point addition // // 3)Point_2D operator-(const Point_2D&) const; // -------------------------------- // point subtraction // // 4)Point_2D operator-() const; // -------------------------------- // multiplication by -1 // // 5)Point_2D operator*( const real) const; // -------------------------------- // multiplication with scalar // // 6)Point_2D operator/(const real) const; // -------------------------------- // division by scalar // // 7)real operator*(const Point_2D& ) const; // -------------------------------- // dot-product of two point // // 8)Point_2D& operator+=(const Point_2D&); // -------------------------------- // addition and assignment // // 9)Point_2D& operator-=(const Point_2D&); // -------------------------------- // subtraction and assignment // // 10)Point_2D& operator*=(real); // -------------------------------- // scalar multiply and assignment // // 11)Point_2D& operator/=(real); // -------------------------------- // division and assignment // // 12)Boolean operator==(const Point_2D&); // --------------------------------------- // // 13)Boolean operator!=(const Point_2D&); // --------------------------------------- // // SPECIAL: // 1) friend Point_2D operator*(real d,const Point_2D& p) // ---------------------------------------------------- // product of the point with the scalar d // // 2) friend ostream& operator<<(ostream&,const Point_2D&p) // -------------------------------------------------------- // output function /////////////////////////////////////////////////////////// #ifndef _2DPOINT_H #define _2DPOINT_H ///////////////////////////////////////////////////////// // IMPORT FOR INTERFACE ///////////////////////////////////////////////////////// #include #include // introduction class Point_2D; static Point_2D operator*(real,const Point_2D&); static ostream& operator<<(ostream&,const Point_2D& ); ///////////////////////////////////////////////////////// // EXPORT ///////////////////////////////////////////////////////// class Point_2D { friend Point_2D operator*(real,const Point_2D&); friend ostream& operator<<(ostream&,const Point_2D& ); public: Point_2D(const Point_2D&); Point_2D(const real, const real); Point_2D(int n); Point_2D(); ~Point_2D(); Point_2D& operator=(const Point_2D&); Point_2D operator+(const Point_2D&) const; Point_2D operator-(const Point_2D&) const; Point_2D operator-() const; Point_2D operator*( const real) const; Point_2D operator/(const real) const; real operator*(const Point_2D& ) const; Point_2D& operator+=(const Point_2D&); Point_2D& operator-=(const Point_2D&); Point_2D& operator*=(real); Point_2D& operator/=(real); real X() const; real Y() const; real R() const; real Theta() const; real operator[](int i) const; real& X() ; real& Y() ; real& R() ; real& Theta() ; real& operator[](int i) ; real/* in[0,2pi] */ Angle() const; real Length() const; Boolean operator == (const Point_2D&) const; Boolean operator != (const Point_2D&) const; int Size() const; Point_2D Proj(const Point_2D& p)const; private: real x,y; }; ///////////////////////////////////////////// //INLINE DEFINITIONS ///////////////////////////////////////////// #include #include #include ////////////////////////////////////////////////////// inline Point_2D& Point_2D::operator=(const Point_2D& v) { x = v.x; y = v.y; return *this; } /////////////////////////////////////////////// inline Point_2D operator*(real d ,const Point_2D& v) { Point_2D r(v); r.x *= d; r.y *= d; return r; } ///////////////////////////////////////////////// inline real Point_2D::X() const { return x; } //////////////////////////////////////////////////// inline real Point_2D::Y() const { return y; } //////////////////////////////////////////////////// inline real Point_2D::R() const { return x; } //////////////////////////////////////////////////// inline real Point_2D::Theta() const { return y; } ///////////////////////////////////////////////// inline real& Point_2D::X() { return x; } //////////////////////////////////////////////////// inline real& Point_2D::Y() { return y; } //////////////////////////////////////////////////// inline real& Point_2D::R() { return x; } //////////////////////////////////////////////////// inline real& Point_2D::Theta() { return y; } //////////////////////////////////////////////////// inline real Point_2D::Angle() const { real Return; if (x==0) { Return = M_PI-M_PI/2*sign(y); }; if (x<0) { Return = M_PI + atan(y/x); } else { real a=2*M_PI +atan(y/x); Return = (a>=2*M_PI) ? a-2*M_PI : a; }; return Return ; } ///////////////////////////////////////////////////// inline ostream& operator<< (ostream& os,const Point_2D& p) { os<< "Point_2D(" <x) //{ //return y*sqrt((x/y)*(x/y)+1); //} //else //{ //return x*sqrt((y/x)*(y/x)+1); //}; } //////////////////////////////////////////////////// inline real Point_2D::operator *(const Point_2D& v) const { real inprod =x*v.x+y*v.y; return inprod; } //////////////////////////////////////////////////// inline Point_2D& Point_2D::operator +=(const Point_2D& v) { x += v.x; y += v.y; return (*this); } /////////////////////////////////////////////////// inline Point_2D& Point_2D::operator -=(const Point_2D& v) { x -= v.x; y -= v.y; return (*this); } /////////////////////////////////////////////////// inline Point_2D& Point_2D::operator *=(real d) { x *=d; y *=d; return (*this); } /////////////////////////////////////////////////// inline Point_2D& Point_2D::operator /=(real d) { Error(d==0,"Point_2D:division by zero error"); x /= d; y /= d; return (*this); } /////////////////////////////////////////////////// inline real Point_2D::operator[](int i) const { return i ? y : x; } /////////////////////////////////////////////// inline real& Point_2D::operator[](int i) { return i ? y : x; } /////////////////////////////////////////////// inline Boolean Point_2D::operator==(const Point_2D& v) const { int b = (x == v.x)&&(y == v.y); return (Boolean) b; } //////////////////////////////////////////////////// inline Boolean Point_2D::operator!=(const Point_2D& v) const { int b = (x != v.x)||(y != v.y); return (Boolean) b; } //////////////////////////////////////////////////// inline int Point_2D::Size() const { return 2; } ////////////////////////////////////////////////// inline Point_2D Point_2D::Proj(const Point_2D& v) const { Point_2D r(v); r *= (*this) *v; r /= (*this) * (*this); return r; } ////////////////////////////////////////////////// inline Point_2D::Point_2D(int n) { Error(n != 2, "a Point_2D should be two-dimensional"); } ///////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'pointer.h' then echo shar: will not over-write existing file "'pointer.h'" else cat << \SHAR_EOF > 'pointer.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : pointer // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 14 Sep 1994 V0.1c(inlines removed) // 25 Jan 1996 V0.1f(code moved from .c to .h) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Pointer // ------------------------------------------------- // // BASECLASSES: // None // // PURPOSE: // a device for storing pointers, managing reference // counts to the pointed objects and controlling the // deletion of the pointed objects . Once a T* // has been stored as a Pointer you can use it // as if C++ had garbage collection. // some compilers have problems converting // Pointers to normal pointers. // // TEMPLATES: // a Pointer stores a T*. T should be derived from // ReferenceCounting // ///////////////////////////////////////////////////////// #ifndef POINTER_H #define POINTER_H ///////////////////////////////////////////////////// #include ///////////////////////////////////////////////////// template class Pointer { public: Pointer(); Pointer(const Pointer&); Pointer(T* tp); Pointer& operator=(const Pointer& tp); Pointer& operator=(T* tp); Boolean operator==(const Pointer& tp) const; Boolean operator!=(const Pointer& tp) const; T& operator* () const; T* operator->() const; T& operator [](int i) const; operator T*(){return ptr;} ~Pointer(); private: T* ptr; }; ///////////////////////////////////////////////////// #include #ifdef TEMPLATEINCLUDE #include #endif ///////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'polC2.h' then echo shar: will not over-write existing file "'polC2.h'" else cat << \SHAR_EOF > 'polC2.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : polC2.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS PolarRectangle // ------------------------------------------------- // // BASECLASSES: // Geometry // // PURPOSE: // the geometry of a polar rectangle // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) PolarRectangle(const Point& A, const Point& B, // const Point& C) // ------------------------------------------------- // constructs a Polar rectangle. AB should not be // perpendicular to BC. // // 2) PolarRectangle(const Point& O, real R1, real R2, // real Theta1, real Theta2) // --------------------------------------------------- // // SELECTORS: // 1) const Point& Center() const // ------------------------------ // // 2) real InnerRadius() const // --------------------------- // // 3) real OuterRadius() const // --------------------------- // // 4) real SmallAngle() const // -------------------------- // // 5) real BigAngle() const // ------------------------ // // 6)Processor DefaultProcessor() const // ----------------------------------------------------- // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef POLC2_H #define POLC2_H ///////////////////////////////////////// #include #include #include #include ///////////////////////////////////////// class PolarRectangle : public Geometry { public: PolarRectangle( const Point& A, const Point& B, const Point& C); PolarRectangle( const Point& O, real r1, real r2, real theta1,real theta2); const Point& Center() const; real InnerRadius() const; real OuterRadius() const; real SmallAngle () const; real BigAngle () const; private: Point TheCenter; real TheInnerRadius, TheOuterRadius, TheSmallAngle, TheBigAngle; }; ////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'polC2itf.h' then echo shar: will not over-write existing file "'polC2itf.h'" else cat << \SHAR_EOF > 'polC2itf.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : polC2itf.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS POLAR_RECTANGLE // ------------------------------------------------- // // BASECLASSES: // USERINTERFACE // // PURPOSE: // End-user interface to PolarRectangles // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) POLAR_RECTANGLE(const Point& A, // const Point& B, // const Point& C) // --------------------------------- // constructs a polar rectangle with vertices A,B,C // AB shouldn't be perpendicular to BC // // 2) POLAR_RECTANGLE( const& Point& O, // real r1, real r2, real theta1,real theta2) // ---------------------------------------------- // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef POLC2ITF_H #define POLC2ITF_H ///////////////////////////////////////// #include #include ///////////////////////////////////////// class POLAR_RECTANGLE : public USERINTERFACE { public: POLAR_RECTANGLE(const Point&,const Point&, const Point&); POLAR_RECTANGLE(const Point&,real,real,real,real); }; ///////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'polC2prc.h' then echo shar: will not over-write existing file "'polC2prc.h'" else cat << \SHAR_EOF > 'polC2prc.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : polC2prc.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS PolarRectangle_Processor // ------------------------------------------------- // // BASECLASSES: // Processor // // PURPOSE: // transforms the polar rectangle into a rectangle // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1)PolarRectangle_Processor() // ---------------------------- // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) void Process(Stack&) // ------------------------------------------------- // see Processor<> // // 2) virtual Processor* NewCopy() const=0 // ------------------------------------------------- // // makes a new copy (using the copy constructor) and // returns a pointer to it. ///////////////////////////////////////////////////////// #ifndef POLC2PRC_H #define POLC2PRC_H ////////////////////////////////////////////// #include #include ///////////////////////////////////////////// class PolarRectangle_Processor: public Processor { public: PolarRectangle_Processor(); void Process(Stack&); Processor* NewCopy() const; }; ///////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'ps.h' then echo shar: will not over-write existing file "'ps.h'" else cat << \SHAR_EOF > 'ps.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : ps.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS ParabolicSegment // ------------------------------------------------- // // BASECLASSES: // Geometry // // PURPOSE: // the geometry of a parabolic segment // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) ParabolicSegment(const Point& A, const Point& B, // const Point& P) // --------------------------------------------------- // the region is bounded by the straight line AB and the // parabolic arc through A and B such that AP and BP are // tangents // // // SELECTORS: // 1) const Point& A() const // -------------------------- // // 1) const Point& B() const // -------------------------- // // 1) const Point& P() const // -------------------------- // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef PS_H #define PS_H ///////////////////////////////////////////////////////// #include #include ///////////////////////////////////////////////////////// class ParabolicSegment : public Geometry { public: ParabolicSegment(const Point&,const Point&,const Point&); const Point& A() const; const Point& B() const; const Point& P() const; private: Point TheA; Point TheB; Point TheP; }; ///////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'psitf.h' then echo shar: will not over-write existing file "'psitf.h'" else cat << \SHAR_EOF > 'psitf.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : psitf.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS PARABOLIC_SEGMENT // ------------------------------------------------- // // BASECLASSES: // USERINTERFACE // // PURPOSE: // end-user interface to a parabolic segment. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) PARABOLIC_SEGMENT(const Point& A, // const Point& B, // const Point& P) // ------------------------------------- // the region is bounded by the straight line AB // and the parabolic arc through A and B such that // AP and BP are tangents. // // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef PSITF_H #define PSITF_H ///////////////////////////////////////////////////////// #include #include ///////////////////////////////////////////////////////// class PARABOLIC_SEGMENT : public USERINTERFACE { public: PARABOLIC_SEGMENT(const Point& A,const Point& B,const Point& p); }; //////////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'real.h' then echo shar: will not over-write existing file "'real.h'" else cat << \SHAR_EOF > 'real.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : real.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// #ifndef REAL_H #define REAL_H ///////////////////////////////////////////////////////// #include #ifdef FLOAT typedef float real; #define REAL_MAX FLT_MAX #define REAL_MIN FLT_MIN #define REAL_EPSILON FLT_EPSILON #define REAL_MAX_EXP FLT_MAX_EPS #define DEFAULT_REL_ERR_REQ (1.0e-4) #else typedef double real; #define REAL_MAX DBL_MAX #define REAL_MIN DBL_MIN #define REAL_EPSILON DBL_EPSILON #define REAL_MAX_EXP DBL_MAX_EXP #define DEFAULT_REL_ERR_REQ (1.0e-6) #endif ///////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'refcount.h' then echo shar: will not over-write existing file "'refcount.h'" else cat << \SHAR_EOF > 'refcount.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : refcount.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS ReferenceCounting // ------------------------------------------------- // // BASECLASSES: // None // // PURPOSE: // provides a means to count references to an object. // it is to be used preferably together with // class Pointer<>, which automatically calls // Refer() and Unrefer() wherever necessary. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) ReferenceCounting() // ---------------------- // initialises the reference count to zero. // // 2) ReferenceCounting(const ReferenceCounting&) // ---------------------------------------------- // also initialises the count to zero // // SELECTORS: // 1) unsigned int NumberOfReferences() const // ------------------------------------------ // // MODIFIERS: // 1) void Refer() // --------------- // increments the reference count. // // 2) void UnRefer() // ----------------- // decrements the reference count // // OPERATORS: // 1) ReferenceCounting& operator= // (const ReferenceCounting&) // ------------------------------------------------- // resets the reference count. // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef REFCOUNT_H #define REFCOUNT_H /////////////////////////////////////////////////// class ReferenceCounting { public: ReferenceCounting(); ReferenceCounting(const ReferenceCounting&); void Refer(); void UnRefer(); ReferenceCounting& operator=(const ReferenceCounting&); unsigned int NumberOfReferences()const; private: unsigned int numref; }; //////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'regcoll.h' then echo shar: will not over-write existing file "'regcoll.h'" else cat << \SHAR_EOF > 'regcoll.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : regcoll.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Jan 1996 V0.1f(typedef introduced) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS REGION_COLLECTION // ------------------------------------------------- // // BASECLASSES: // COMPOUND_REGION // // PURPOSE: // groups regions and their eventual offspring. applies // the global adaptive algorithm. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) REGION_COLLECTION() // ---------------------- // // 2) REGION_COLLECTION(const REGION_COLLECTION&) // ---------------------------------------------- // // SELECTORS: // None // // MODIFIERS: // 1) LocalIntegrand(Integrand* I) // ------------------------------ // sets the local integrand of all members to I // only to be called before Process(). // // 2) LocalIntegrand(Function F) // ------------------------------ // sets the local integrand of all members to F // only to be called before Process(). // // OPERATORS: // 1) REGION_COLLECTION operator+(const COMPOUND_REGION&) // ---------------------------------------------------- // // 2) REGION_COLLECTION& operator+=(const COMPOUND_REGION&) // ---------------------------------------------------- // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef REGCOLL_H #define REGCOLL_H ///////////////////////////////////////////// #include #include #include #include #include #include ///////////////////////////////////////////// class REGION_COLLECTION : public COMPOUND_REGION { public: typedef Stack < COMPOUND_REGION> StackCOMPOUND_REGION; void LocalIntegrand(Integrand*); void LocalIntegrand(Function); REGION_COLLECTION& operator+=(const COMPOUND_REGION&) ; REGION_COLLECTION operator+(const COMPOUND_REGION&) ; REGION_COLLECTION(); REGION_COLLECTION(const REGION_COLLECTION&); protected: Pointer < StackCOMPOUND_REGION > SCR_ptr; void Preprocess(); void Improve(); real MaxAtomicError()const; COMPOUND_REGION* NewCopy()const; }; /////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'reginfo.h' then echo shar: will not over-write existing file "'reginfo.h'" else cat << \SHAR_EOF > 'reginfo.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : reginfo.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS RegionInfo // ------------------------------------------------- // // BASECLASSES: // ReferenceCounting // // PURPOSE: // to store integral and error of a specific region // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) RegionInfo() // --------------- // after construction Integral() and AbsoluteError() // will both return zero // // SELECTORS: // 1) real Integral() const // ------------------------ // // 2) real AbsoluteError() const // ----------------------------- // 3) Boolean Hopeless() const // --------------------------- // // MODIFIERS: // 1) real& Integral() // -------------------- // // 2) real& AbsoluteError() // ------------------------ // // 3) Boolean& Hopeless() // ---------------------- // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef REGINFO_H #define REGINFO_H ////////////////////////////////////////// #include #include #include ////////////////////////////////////////// class RegionInfo : public ReferenceCounting { public : RegionInfo(); real Integral()const; real& Integral(); real AbsoluteError()const; real& AbsoluteError(); Boolean Hopeless() const; Boolean& Hopeless() ; private: real TheIntegral; real TheAbsoluteError; Boolean IsHopeless; }; ///////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'region.h' then echo shar: will not over-write existing file "'region.h'" else cat << \SHAR_EOF > 'region.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : region.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Region // ------------------------------------------------- // // BASECLASSES: // None // // PURPOSE: // base class for all regions, providing storage for // integral and error approximations // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Region() // ----------- // // SELECTORS: // 1) real Integral() const // ----------------------- // // 2) real AbsoluteError() const // ----------------------------- // // 3) Boolean Hopeless() const // --------------------------- // // MODIFIERS: // None // // OPERATORS: // 1) Boolean operator<(const Region&)const // ---------------------------------------- // compares the absolute errors // // 2) Boolean operator>(const Region&)const // ---------------------------------------- // compares the absolute errors // // 3) Boolean operator<=(const Region&)const // ---------------------------------------- // compares the absolute errors // // 4) Boolean operator>=(const Region&)const // ---------------------------------------- // compares the absolute errors // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef REGION_H #define REGION_H ////////////////////////////////////////////////// #include #include #include #include ///////////////////////////////////////////////// class Region { public: Region(); real Integral() const; real AbsoluteError() const ; Boolean Hopeless()const; Boolean operator<(const Region&) const; Boolean operator<=(const Region&) const; Boolean operator>(const Region&) const; Boolean operator>=(const Region&) const; protected : RegionInfo& LocalInfo(); private: Pointer RI_ptr; }; /////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'rule.h' then echo shar: will not over-write existing file "'rule.h'" else cat << \SHAR_EOF > 'rule.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : rule.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Rule // ------------------------ // // BASECLASSES: // ReferenceCounting // // // PURPOSE: // provides a pure virtual base class as a common // interface to all rules. // // TEMPLATES: // T: type of region on which the rule has to be // applied. T should be derived from // class Region . // // METHODS: // CONSTRUCTORS: // None // SELECTORS: // 1) int Degree() const // --------------------- // returns the degree of the formula // // 2) int NumberOfPoints() const // ------------------------------------------ // returns the number of points the rule uses. // this might depend on Dimension // // MODIFIERS: // None // OPERATORS: // None // SPECIAL: // 1) Apply(Integrand& I,T& H,real& Result,real& // Error) // ------------------------------------------------- // Input parameters: // I: the integrand // H: Region to be integrated. H.Dimension() // should be 2. // Output parameters: // Result: approximation to the integral // Error: absolute error estimation // // 2) ApplyWithDiffs(Integrand& I,T& H,real& Result,real& // Error,Vector& D) // ------------------------------------------------- // Input parameters: // I: the integrand // H: Region to be integrated. H.Dimension() // should be 2. // Output parameters: // Result: approximation to the integral // Error: absolute error estimation // D: order of indices regarding a higher order difference. /////////////////////////////////////////////////////////// #ifndef RULE_H #define RULE_H ///////////////////////////////////////// #include #include #include ////////////////////////////////////////// template class Rule : public ReferenceCounting { public: Rule(); virtual void ApplyWithDiffs(Integrand&,GEOMETRY&,real&,real&,Vector&) ; virtual void Apply(Integrand&,GEOMETRY&,real&,real&); virtual int Degree() const =0; virtual int NumberOfPoints () const =0; virtual ~Rule(); }; ////////////////////////////////////////// #include #ifdef TEMPLATEINCLUDE #include #endif ////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'regproc.h' then echo shar: will not over-write existing file "'regproc.h'" else cat << \SHAR_EOF > 'regproc.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : regproc.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Processor // ------------------------------------------------- // // BASECLASSES: // ReferenceCounting // // PURPOSE: // abstract base class for region processors. these // either compute an integral or an error over a given // GEOMETRY or convert it to another GEOMETRY. // the processor has access to the GEOMETRY through // a pointer to an atomic region. // // TEMPLATES: // the GEOMETRY that the Processor is meant to operate // on must be specified as a template argument. // // METHODS: // CONSTRUCTORS: // 1) Processor() // -------------- // // SELECTORS: // None // // MODIFIERS: // 1) void LocalAtomic(Atomic* G) // ------------------------------------------- // specifies the AtomicRegion to process // this should happen before the first call of Process() // // // OPERATORS: // None // // SPECIAL: // 1) virtual void Process( Stack& Offspring) // ----------------------------------------------------- // after a call of Process() one of the following // statements will be true: // I) Offspring is empty. // The processor will have computed new // values for integral and error. // They will be stored in the RegionInfo // of the atomic region, possibly along // with some other information like // hopelessness. // II)Offspring is non-empty. // The region has produced // offspring and can be deleted. // // 2) virtual Processor* NewCopy() const=0 // ------------------------------------------------- // // makes a new copy (using the copy constructor) and // returns a pointer to it. ///////////////////////////////////////////////////////// #ifndef REGPROC_H #define REGPROC_H //////////////////////////////////////////// #include #include #include #include #include #include ///////////////////////////////////////////// template class Atomic; template class Processor: public ReferenceCounting { public: Processor(); void LocalAtomic(Atomic* ); virtual Processor* NewCopy() const=0; virtual void Process( Stack& Offspring)=0; virtual ~Processor(); protected: Integrand& LocalIntegrand() const; GEOMETRY& Geometry() const; real& Integral(); real& AbsoluteError(); Atomic& LocalAtomic() const; RegionInfo& LocalRegionInfo() const; private: Atomic* A_ptr; }; ///////////////////////////////////////////// #include #ifdef TEMPLATEINCLUDE #include #endif ///////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 's_adapt.h' then echo shar: will not over-write existing file "'s_adapt.h'" else cat << \SHAR_EOF > 's_adapt.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : s_adapt.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 25 Nov 1994 V0.1d(re-ordering of member declarations) // 25 Jan 1996 V0.1f(typedef introduced, code from .c to .h) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS SimpleAdaptive // ------------------------------------------------- // // BASECLASSES: // Processor // // PURPOSE: // Simple Adaptive means applying a rule once // (during the first call of Process()) // and then cutting the region into subregions with // the same shape as the original (during the second // call of Process()). // // TEMPLATES: // the Geometry T to work with // // METHODS: // CONSTRUCTORS: // 1) SimpleAdaptive( Rule* , // SameShapeDivisor* ) // ------------------------------------------------- // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) void Process(Stack&) // ------------------------------------------------- // see Processor // // 2) virtual Processor* NewCopy() const=0 // ------------------------------------------------- // // makes a new copy (using the copy constructor) and // returns a pointer to it. ///////////////////////////////////////////////////////// #ifndef S_ADAPT_H #define S_ADAPT_H /////////////////////////////////////////// #include #include #include /////////////////////////////////////////// template class SimpleAdaptive : public Processor { public: typedef Rule RuleGEOMETRY; typedef SameShapeDivisor SameShapeDivisorGEOMETRY; SimpleAdaptive(const Pointer &R, const Pointer& D) :Processor(), TimesCalled(0), Diffs(2), TheRule(R), TheDivisor(D) { } SimpleAdaptive(Rule*, SameShapeDivisor*); void Process( Stack& Offspring); Processor* NewCopy() const; protected: SimpleAdaptive* Descendant() const; unsigned int TimesCalled; Vector Diffs; Pointer TheRule; Pointer TheDivisor; }; ///////////////////////////////////////////////// #include #ifdef TEMPLATEINCLUDE #include #endif ///////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'samediv.h' then echo shar: will not over-write existing file "'samediv.h'" else cat << \SHAR_EOF > 'samediv.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : samediv.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS SameShapeDivisor // ------------------------------------------------- // // BASECLASSES: // Divisor // // PURPOSE: // a divisor that produces parts of the same shape as // the original // // TEMPLATES: // T, the Geometry to be divided. // // METHODS: // CONSTRUCTORS: // 1) SameShapeDivisor() // --------------------- // // SELECTORS: // 1) virtual int NumberOfParts() const // ------------------------------- // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) virtual void Apply( const T& , // Stack& Offspring) // -------------------------------------------------- // performs the division // ///////////////////////////////////////////////////////// #ifndef SAMEDIV_H #define SAMEDIV_H //////////////////////////////////////////// #include #include #include //////////////////////////////////////////// template class SameShapeDivisor : public Divisor { public: SameShapeDivisor(); virtual int NumberOfParts() const =0; virtual void Apply( const GEOMETRY&,Stack&,const Vector&)=0; virtual ~SameShapeDivisor(); }; ///////////////////////////////////////////// #include #ifdef TEMPLATEINCLUDE #include #endif ///////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'semistrp.h' then echo shar: will not over-write existing file "'semistrp.h'" else cat << \SHAR_EOF > 'semistrp.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : semistrp.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS SemiInfiniteStrip // ----------------------------------------- // // BASECLASSES: // Geometry // // PURPOSE: // implements a semi-infinite strip // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) SemiInfiniteStrip( // const Point& A, const Point& B) // --------------------------------------------------- // the region lies to the left of AB // // SELECTORS: // 1) const Point& A() const // ------------------------- // returns the point A (see constructor) // // 2) const Point& B() const // ------------------------- // returns the point B (see constructor) // // MODIFIERS: // None // // OPERATORS: // None // SPECIAL: // None // /////////////////////////////////////////////////////////// #ifndef SEMISTRP_H #define SEMISTRP_H ////////////////////////////////////////////////// #include #include ////////////////////////////////////////////////// class SemiInfiniteStrip : public Geometry { public: SemiInfiniteStrip ( const Point&,const Point&); const Point& A() const; const Point& B() const; private: Point TheA; Point TheB; }; ////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'semstitf.h' then echo shar: will not over-write existing file "'semstitf.h'" else cat << \SHAR_EOF > 'semstitf.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : semstitf.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS SEMI_INFINITE_STRIP // ------------------------------------------------- // // BASECLASSES: // USERINTERFACE // // PURPOSE: // End-user interface to semi-infinite strips // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) SEMI_INFINITE_STRIP( // const Point& A, const Point& B) // --------------------------------------------------- // the region will be to the left of AB. // // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef SEMSTITF_H #define SEMSTITF_H //////////////////////////////////////////// #include #include //////////////////////////////////////////// class SEMI_INFINITE_STRIP : public USERINTERFACE { public: SEMI_INFINITE_STRIP(const Point&,const Point&); }; //////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'set.h' then echo shar: will not over-write existing file "'set.h'" else cat << \SHAR_EOF > 'set.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : set.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Set // ----------------------- // // BASECLASSES: // ReferenceCounting // // // PURPOSE: // provides a pure virtual base class for all // collection classes. // // TEMPLATES: // the type T of the Set elements is templated. it // should have a method T* NewCopy () defined. // // METHODS: // CONSTRUCTORS: // 1) Set() // -------- // Default constructor // // SELECTORS: // 1) virtual T* Look() =0 // ------------------------ // returns a pointer to an element of the Set. // // 2) int NumberOfElements() const // -------------------------------- // returns the number of elements in the set. // // MODIFIERS: // 1) virtual T* Get()=0 // ----------------------- // returns a pointer to an element of the Set and // removes them. // // 2) virtual void Clear()=0 // --------------------------- // removes all of the elements // // OPERATORS: // 1) virtual void operator+=(T*) =0 // ------------------------------------------- // adds a reference to an element to the set // // SPECIAL: // None /////////////////////////////////////////////////////////// #ifndef SET_H #define SET_H #include #include #include template class Set: public ReferenceCounting { public: Set(); virtual ~Set(); virtual void Clear()=0; virtual T* Get () =0; virtual T* Look() =0; virtual void operator+=( T*) =0; unsigned int Size() const; Boolean Empty() const; protected: int Number; }; #ifdef TEMPLATEINCLUDE #include #endif #endif SHAR_EOF fi # end of overwriting check if test -f 'stack.h' then echo shar: will not over-write existing file "'stack.h'" else cat << \SHAR_EOF > 'stack.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : stack.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Stack // ------------------------- // // BASECLASSES: // ReferenceCounting // // PURPOSE: // implements a stack. an iterator over all the elements // is provided. // // TEMPLATES: // The type T of the elements to be stacked is // templated. T should have T* NewCopy() defined. // // // METHODS: // CONSTRUCTORS: // 1) Stack() // ----------- // default constructor // // SELECTORS: // 1) T* Top() const // ----------------- // returns a pointer to the top-element of the stack. // this element is not removed so modifications of it // are potentially dangerous. // not to be called when Size() == 0 // // 2) Boolean Empty() const // -------------------------- // // 3) unsigned int Size() const // ------------------------------ // // 4) Boolean IteratorAtEnd() const // --------------------------------- // returns True if the iterator has passed the // bottom element of the Stack or if Size() == 0 // // MODIFIERS: // 1) T* Pop() // ----------- // gets the top-element of the stack. it is removed. // not to be called when Size() == 0 // // 2) void MakeEmpty() // --------------- // Empties the Stack // // 3) IteratorReset() // ------------------ // a subsequent call of IteratorNext() will return the // top of the stack, unless the stack is empty. // // 4) T* IteratorNext() // -------------------- // advances the iterator and returns the next element. // not to be called when IteratorAtEnd() // // 5) void Push(T* t) // ---------------------------- // pushes a pointer to *t on the stack // // 6) void Merge(Stack& S) // ------------------------------- // pushes all elements of S on the Stack. The order in // which they are pushed is not defined. The state of // S afterwards is not defined. // // OPERATORS: // None // SPECIAL: // None /////////////////////////////////////////////////////////// #ifndef SELEMENT #define SELEMENT template< class T> struct SElement { SElement* Next; T* Contents; }; #endif /////////////////////////////////////////////////// #ifndef STACK_H #define STACK_H /////////////////////////////////////////////////// #include #include #include /////////////////////////////////////////////////// template class Stack :public ReferenceCounting { public: Stack(); ~Stack(); void MakeEmpty(); Boolean Empty () const; void Push (T*); T* Pop(); T* Top()const; void Merge (Stack& Source); void IteratorReset(); Boolean IteratorAtEnd() const; T* IteratorNext(); unsigned int Size() const; private: SElement* TheTop; SElement* Current; unsigned int Number; }; ///////////////////////////////////////////////// #include #ifdef TEMPLATEINCLUDE #include #endif #endif SHAR_EOF fi # end of overwriting check if test -f 'strip.h' then echo shar: will not over-write existing file "'strip.h'" else cat << \SHAR_EOF > 'strip.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : strip.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS InfiniteStrip Rectangle // ----------------------------------------- // // BASECLASSES: // Geometry // // PURPOSE: // implements an infinite strip // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) GeneralizedRectangle( // const Point& A, const Point& B) // --------------------------------------------------- // the line segment AB is the diameter of the strip // // SELECTORS: // 1) const Point& A() const // ------------------------- // returns the point A (see constructor) // // 2) const Point& B() const // ------------------------- // returns the point B (see constructor) // // MODIFIERS: // None // // OPERATORS: // None // SPECIAL: // None // /////////////////////////////////////////////////////////// #ifndef STRIP_H #define STRIP_H ////////////////////////////////////////////////// #include #include ////////////////////////////////////////////////// class InfiniteStrip : public Geometry { public: InfiniteStrip ( const Point&,const Point&); const Point& A() const; const Point& B() const; private: Point TheA; Point TheB; }; ////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'stripitf.h' then echo shar: will not over-write existing file "'stripitf.h'" else cat << \SHAR_EOF > 'stripitf.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : stripitf.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS INFINITE_STRIP // ------------------------------------------------- // // BASECLASSES: // USERINTERFACE // // PURPOSE: // End user interface to infinite strips // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) INFINITE_STRIP( // const Point& A, const Point& B) // --------------------------------------------------- // AB will be the diameter of the strip // // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef STRIPITF_H #define STRIPITF_H //////////////////////////////////////////// #include #include //////////////////////////////////////////// class INFINITE_STRIP : public USERINTERFACE { public: INFINITE_STRIP(const Point&,const Point&); }; //////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'sttosmst.h' then echo shar: will not over-write existing file "'sttosmst.h'" else cat << \SHAR_EOF > 'sttosmst.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : sttosmst.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS E2toIS // ------------------------------------------------- // // BASECLASSES: // Transformation // // PURPOSE: // transformation from strip to semistrip // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) IStoSIS(SemiInfiniteStrip*) // ------------ // The target region has to be supplied // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // None // // SPECIAL: // 1) void Transform(real & w, Point & p) // -------------------------------------- // multiplies w by the Jacobian at p and then // replaces p by the transformed point // ///////////////////////////////////////////////////////// #ifndef STTOSMST_H #define STTOSMST_H ///////////////////////////////////////////////////////// #include #include #include #include /////////////////////////////////////////////////// class IStoSIS : public Transformation { public: IStoSIS( SemiInfiniteStrip*); void Transform(real& w, Point& p); private: Pointer SIS_ptr; }; ////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'templist.h' then echo shar: will not over-write existing file "'templist.h'" else cat << \SHAR_EOF > 'templist.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : templist.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // PURPOSE: // to enumerate the compilers that need inclusion of // template implementations ///////////////////////////////////////////////////////// #ifndef TEMPLIST_H #define TEMPLIST_H #ifdef __GNUG__ #define TEMPLATEINCLUDE #endif #ifdef __TCPLUSPLUS__ #define TEMPLATEINCLUDE #endif #ifdef __DECCXX #define TEMPLATEINCLUDE #endif #endif SHAR_EOF fi # end of overwriting check if test -f 'tools.h' then echo shar: will not over-write existing file "'tools.h'" else cat << \SHAR_EOF > 'tools.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : tools.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // PURPOSE : this file contains some simple tools ////////////////////////////////////////////////// #ifndef TOOLS_H #define TOOLS_H #include /////////////////////////////////////////////////////// inline real min (real a,real b) { return (ab) ? a : b ; } inline real sign (real x) { return (x>0) ? 1.0 : -1.0; } /////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'translat.h' then echo shar: will not over-write existing file "'translat.h'" else cat << \SHAR_EOF > 'translat.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : translat.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Translation // ------------------------------- // // BASECLASSES: // Transformation // // // PURPOSE: // implements translations. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Translation(const Point& Offset) // ----------------------------------- // constructs the translation by specifying the // Offset that has to be added by T() // // SELECTORS: // None // MODIFIERS: // None // OPERATORS: // None // SPECIAL: // 1) void Transform (real& w, Point& p) // --------------------------------------- // Leaves w unchanged and replaces p by p+Offset. // /////////////////////////////////////////////////////////// #ifndef TRANSLAT_H #define TRANSLAT_H //////////////////////////////////////////////////////// #include #include /////////////////////////////////////////////////////// class Translation :public Transformation { public: Translation( const Point& Offset); //Translation::T(p) ADDS Offset to p void Transform(real& w, Point& p); private: Point TheOffset; }; //////////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'trnsfrm.h' then echo shar: will not over-write existing file "'trnsfrm.h'" else cat << \SHAR_EOF > 'trnsfrm.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : trnsfrm.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Transformation // ---------------------------------- // // BASECLASSES: // ReferenceCounting // // // PURPOSE: // a pure virtual base class providing a common interface // to all transformations. // // TEMPLATES: // None // // METHODS: // CONSTRUCTORS: // 1) Transformation() // -------------------- // // SELECTORS: // None // MODIFIERS: // None // OPERATORS: // None // SPECIAL: // 1) virtual void Transform (real& w, Point& p) // ----------------------------------------------- // Multiplies w by the Jacobian at p and then replaces p by // the transformed point. // /////////////////////////////////////////////////////////// #ifndef TRNSFRM_H #define TRNSFRM_H #include #include class Transformation: public ReferenceCounting { public: Transformation(); virtual void Transform (real& w, Point& p) =0; virtual ~Transformation(); }; #endif SHAR_EOF fi # end of overwriting check if test -f 'userint.h' then echo shar: will not over-write existing file "'userint.h'" else cat << \SHAR_EOF > 'userint.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : userint.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) // 8 Sep 1994 V0.1a(operator added) // 25 Jan 1996 V0.1f(typedef introduced, code from .c to .h) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS USERINTERFACE // ------------------------------------------------- // // BASECLASSES: // COMPOUND_REGION // // PURPOSE: // base class for end-user interfaces to geometries // // TEMPLATES: // a specific GEOMETRY (derived from Geometry) // must be provided // // METHODS: // CONSTRUCTORS: // 1) USERINTERFACE() // ------------------ // // 2) USERINTERFACE(const USERINTERFACE&) // ------------------------------------------------ // // SELECTORS: // None // // MODIFIERS: // 1) void Use(Processor* P) // ----------------------------------- // forces P to be used for Process()ing. // // 2) LocalIntegrand(Integrand* I) // ------------------------------ // sets the local integrand of all members to I // only to be called before Process(). // // 3) LocalIntegrand(Function F) // ------------------------------ // sets the local integrand of all members to F // only to be called before Process(). // // // OPERATORS: // 1) REGION_COLLECTION operator+(const COMPOUND_REGION&) // ----------------------------------------------------- // // SPECIAL: // 1)operator AtomicRegion*() // --------------------------- // conversion to an AtomicRegion. The USERINTERFACE // can't be used after a call of this operator. // ///////////////////////////////////////////////////////// #ifndef USERINT_H #define USERINT_H ///////////////////////////////////////////////// #include #include #include #include #include #include #include #include ///////////////////////////////////////////////// template class USERINTERFACE : public COMPOUND_REGION { public: typedef Stack StackAtomicRegion; typedef Heap HeapAtomicRegion; USERINTERFACE(); USERINTERFACE(const USERINTERFACE&); ~USERINTERFACE(); void Use( Processor*); REGION_COLLECTION operator+(const COMPOUND_REGION&); void LocalIntegrand(Integrand*); void LocalIntegrand(Function); operator AtomicRegion* () { Error (SAR_ptr->Empty(), "converting empty compound region to atomic."); return SAR_ptr->Pop(); } protected: Pointer< StackAtomicRegion> HopelessAR_ptr; Pointer< StackAtomicRegion> SAR_ptr; Pointer< HeapAtomicRegion > HAR_ptr; Pointer< Integrand > Int_ptr; void StoreAtomic(GEOMETRY*,Processor*); //void StoreAtomic(GEOMETRY*); void Preprocess(); void Improve(); real MaxAtomicError() const; COMPOUND_REGION* NewCopy() const; }; ////////////////////////////////////////////////// #include #ifdef TEMPLATEINCLUDE #include #endif /////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'vector.h' then echo shar: will not over-write existing file "'vector.h'" else cat << \SHAR_EOF > 'vector.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : vector.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS Vector // -------------------------- // // BASECLASSES: // None // // // PURPOSE: // implements vectors of arbitrary length. // // TEMPLATES: // The type T of the elements is templated. T can be any // class with a copy constructor, a default constructor // and an assignment operator. // // METHODS: // CONSTRUCTORS: // 1) Vector() // ------------- // default constructor. the length is not defined so // the Vector must be initialized afterwards by an // assignment operation. use before this assignment // will result in an error. // // 2) Vector(const Vector&) // ----------------------- // copy constructor. // // 3) Vector(unsigned int n) // --------------------------- // constructs a vector of length n; // // 4) Vector(unsigned int n,T* p) // ------------------- // assumes p is pointing to a classical C array and // copies its elements. if the array has not the // expected dimension n, an error might occur . // // // SELECTORS: // 1) unsigned int Size() const // ---------------- // returns the length of a vector. // // MODIFIERS: // None // OPERATORS: // 1) Vector& operator=(const Vector&) // ----------------------------------------- // assignment operator. Sizes must be equal, // unless the lefthandside hasn't got // a Size. // // 2) Boolean operator ==(const Vector&) // ------------------------------------- // equality operator. Sizes must be equal // // 3) Boolean operator !=(const Vector&) // ------------------------------------- // !(==). Sizes must be equal // // 4) T& operator[](unsigned int) const // --------------------------- // selects the ith component. 0<=i ///////////////////////////////////////////////// template class Vector { public: Vector(); Vector(unsigned int length); Vector(unsigned int,T*); Vector(const Vector&); T& operator[](unsigned int) ; const T& operator[](unsigned int) const; Vector& operator=(const Vector&); Boolean operator == (const Vector&) const; Boolean operator != (const Vector&) const; ~Vector(); unsigned int Size() const; protected: unsigned int TheSize; T* Contents; }; /////////////////////////////////////////////////// #include #ifdef TEMPLATEINCLUDE #include #endif #endif SHAR_EOF fi # end of overwriting check if test -f 'vstack.h' then echo shar: will not over-write existing file "'vstack.h'" else cat << \SHAR_EOF > 'vstack.h' ///////////////////////////////////////////////////////// // // // Cubpack++ // // // // A Package For Automatic Cubature // // // // Authors : Ronald Cools // // Dirk Laurie // // Luc Pluym // // // ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// // File : vstack.h // History: // (date) (version) // 19 Aug 1994 V0.1 (first limited distribution) ///////////////////////////////////////////////////////// // DEFINITION OF CLASS VectorStack // ------------------------------------------------- // // BASECLASSES: // Vector // // PURPOSE: // implements a stack of elements T, with individual // access possible. // // TEMPLATES: // The type T of the elements to be stacked is // templated. They must have a copy constructor // // METHODS: // CONSTRUCTORS: // 1) VectorStack() // ----------------- // creates an empty VectorStack // // 2) VectorStack(const VectorStack& V) // ------------------------------------- // // SELECTORS: // None // // MODIFIERS: // None // // OPERATORS: // 1) void operator+=(const T& t) ; // ------------------------------ // pushes a copy of t on top of the stack. // // SPECIAL: // None // ///////////////////////////////////////////////////////// #ifndef VSTACK_H #define VSTACK_H ///////////////////////////////////////////////// #include #include ///////////////////////////////////////////////// template class VectorStack: public Vector { public: VectorStack(); VectorStack(const VectorStack&); VectorStack& operator=(const VectorStack&); void operator+=(const T&); }; /////////////////////////////////////////////////// #include #ifdef TEMPLATEINCLUDE #include #endif /////////////////////////////////////////////////////// #endif SHAR_EOF fi # end of overwriting check if test -f 'makefile' then echo shar: will not over-write existing file "'makefile'" else cat << \SHAR_EOF > 'makefile' CC = gcc CFLAGS = -x c++ -I. # COPTIONS = -DEGTRUSAGE COPTIONS = libdir = -L. libs = -lcubpack -lm -lg++ MYTESTPROG = main.o .c.o: ; $(CC) $(CFLAGS) -c $*.c chrono.o: chrono.c $(CC) $(CFLAGS) $(COPTIONS) -c chrono.c OBJS = \ point2D.o \ C2.o \ C2dv2.o \ C2dv4.o \ C2interf.o \ C2prc.o \ C2rule13.o \ C2toS2.o \ C2togr.o \ E2tostrp.o \ E2.o \ E2adapt.o \ E2interf.o \ E2sec.o \ E2secitf.o \ E2secprc.o \ S2.o \ S2adapt.o \ S2interf.o \ S2rule13.o \ T2.o \ T2dv4.o \ T2interf.o \ T2rule13.o \ T2tops.o \ atomreg.o \ boolean.o \ chrono.o \ compreg.o \ eval_ctr.o \ geometry.o \ gr.o \ gritf.o \ gs.o \ gsitf.o \ gsprc.o \ integran.o \ integrat.o \ invert.o \ outS2.o \ outS2itf.o \ polC2.o \ polC2itf.o \ polC2prc.o \ ps.o \ psitf.o \ refcount.o \ regcoll.o \ reginfo.o \ region.o \ semstitf.o \ semistrp.o \ sttosmst.o \ strip.o \ stripitf.o \ translat.o \ trnsfrm.o all:: libcubpack.a libcubpack.a: $(OBJS) ar ru libcubpack.a $(OBJS) ranlib libcubpack.a tst: $(MYTESTPROG) $(CC) $(MYTESTPROG) $(libdir) $(libs) -o tst clean: /bin/rm -f *.o tst core SHAR_EOF fi # end of overwriting check if test -f 'main.c' then echo shar: will not over-write existing file "'main.c'" else cat << \SHAR_EOF > 'main.c' // Example 28 from ditamo #include #include real f(const Point& p) { real y=p.Y(); return 1/(y*y); } int main () { Point A(2,-1), B(1,-1); SEMI_INFINITE_STRIP langelat(A,B); real Integral_est, Error_est; Boolean Success; EvaluationCounter TikTak; TikTak.Start(); cout.setf(ios::scientific,ios::floatfield); do { Integrate(f,langelat,Integral_est,Error_est,Success,0,0.5e-7,10000); cout <<"The integral is " << Integral_est; cout <<" with estimated absolute error " << Error_est << endl; cout <<"The real error is " << Integral_est - 1 < 'userman.ps' %!PS-Adobe-2.0 %%Creator: dvips 5.58 Copyright 1986, 1994 Radical Eye Software %%Title: userman.dvi %%Pages: 23 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%EndComments %DVIPSCommandLine: dvips -o userman.ps userman.dvi %DVIPSParameters: dpi=300, comments removed %DVIPSSource: TeX output 1996.05.31:1334 %%BeginProcSet: tex.pro /TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N /X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} forall round exch round exch]setmatrix}N /@landscape{/isls true N}B /@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ /nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ /sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ 128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N /rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup /base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff .1 sub]{ch-image}imagemask restore}B /D{/cc X dup type /stringtype ne{]} if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin 0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict /eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X /IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for 65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V {}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7 getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false} ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail {dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{ 4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{ p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p a}B /bos{/SS save N}B /eos{SS restore}B end %%EndProcSet %%BeginProcSet: special.pro TeXDict begin /SDict 200 dict N SDict begin /@SpecialDefaults{/hs 612 N /vs 792 N /ho 0 N /vo 0 N /hsc 1 N /vsc 1 N /ang 0 N /CLIP 0 N /rwiSeen false N /rhiSeen false N /letter{}N /note{}N /a4{}N /legal{}N}B /@scaleunit 100 N /@hscale{@scaleunit div /hsc X}B /@vscale{@scaleunit div /vsc X}B /@hsize{/hs X /CLIP 1 N}B /@vsize{/vs X /CLIP 1 N}B /@clip{ /CLIP 2 N}B /@hoffset{/ho X}B /@voffset{/vo X}B /@angle{/ang X}B /@rwi{ 10 div /rwi X /rwiSeen true N}B /@rhi{10 div /rhi X /rhiSeen true N}B /@llx{/llx X}B /@lly{/lly X}B /@urx{/urx X}B /@ury{/ury X}B /magscale true def end /@MacSetUp{userdict /md known{userdict /md get type /dicttype eq{userdict begin md length 10 add md maxlength ge{/md md dup length 20 add dict copy def}if end md begin /letter{}N /note{}N /legal{} N /od{txpose 1 0 mtx defaultmatrix dtransform S atan/pa X newpath clippath mark{transform{itransform moveto}}{transform{itransform lineto} }{6 -2 roll transform 6 -2 roll transform 6 -2 roll transform{ itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll curveto}}{{ closepath}}pathforall newpath counttomark array astore /gc xdf pop ct 39 0 put 10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack}if}N /txpose{pxs pys scale ppr aload pop por{noflips{pop S neg S TR pop 1 -1 scale}if xflip yflip and{pop S neg S TR 180 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip not and{pop S neg S TR pop 180 rotate ppr 3 get ppr 1 get neg sub neg 0 TR}if yflip xflip not and{ppr 1 get neg ppr 0 get neg TR}if}{noflips{TR pop pop 270 rotate 1 -1 scale}if xflip yflip and{TR pop pop 90 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip not and{TR pop pop 90 rotate ppr 3 get ppr 1 get neg sub neg 0 TR}if yflip xflip not and{TR pop pop 270 rotate ppr 2 get ppr 0 get neg sub neg 0 S TR}if}ifelse scaleby96{ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copy TR .96 dup scale neg S neg S TR}if}N /cp {pop pop showpage pm restore}N end}if}if}N /normalscale{Resolution 72 div VResolution 72 div neg scale magscale{DVImag dup scale}if 0 setgray} N /psfts{S 65781.76 div N}N /startTexFig{/psf$SavedState save N userdict maxlength dict begin /magscale true def normalscale currentpoint TR /psf$ury psfts /psf$urx psfts /psf$lly psfts /psf$llx psfts /psf$y psfts /psf$x psfts currentpoint /psf$cy X /psf$cx X /psf$sx psf$x psf$urx psf$llx sub div N /psf$sy psf$y psf$ury psf$lly sub div N psf$sx psf$sy scale psf$cx psf$sx div psf$llx sub psf$cy psf$sy div psf$ury sub TR /showpage{}N /erasepage{}N /copypage{}N /p 3 def @MacSetUp}N /doclip{ psf$llx psf$lly psf$urx psf$ury currentpoint 6 2 roll newpath 4 copy 4 2 roll moveto 6 -1 roll S lineto S lineto S lineto closepath clip newpath moveto}N /endTexFig{end psf$SavedState restore}N /@beginspecial{SDict begin /SpecialSave save N gsave normalscale currentpoint TR @SpecialDefaults count /ocount X /dcount countdictstack N}N /@setspecial {CLIP 1 eq{newpath 0 0 moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto closepath clip}if ho vo TR hsc vsc scale ang rotate rwiSeen{rwi urx llx sub div rhiSeen{rhi ury lly sub div}{dup}ifelse scale llx neg lly neg TR }{rhiSeen{rhi ury lly sub div dup scale llx neg lly neg TR}if}ifelse CLIP 2 eq{newpath llx lly moveto urx lly lineto urx ury lineto llx ury lineto closepath clip}if /showpage{}N /erasepage{}N /copypage{}N newpath }N /@endspecial{count ocount sub{pop}repeat countdictstack dcount sub{ end}repeat grestore SpecialSave restore end}N /@defspecial{SDict begin} N /@fedspecial{end}B /li{lineto}B /rl{rlineto}B /rc{rcurveto}B /np{ /SaveX currentpoint /SaveY X N 1 setlinecap newpath}N /st{stroke SaveX SaveY moveto}N /fil{fill SaveX SaveY moveto}N /ellipse{/endangle X /startangle X /yrad X /xrad X /savematrix matrix currentmatrix N TR xrad yrad scale 0 0 1 startangle endangle arc savematrix setmatrix}N end %%EndProcSet TeXDict begin 39158280 55380996 1000 300 300 (/home/ronald/Research/Puk93/Tekst/userman.dvi) @start /Fa 2 65 df<00000000001800000000003C00000000007C0000000000F80000000001F0 0000000003E00000000007C0000000000F80000000001F00000000003E00000000007C00 00000000F80000000001F00000000003E00000000007C0000000000F80000000001F0000 0000003E00000000007C0000000000F80000000001F00000000003E00000000007C00000 00000F80000000001F00000000003E00000000007C0000000000F80000000001F0000000 0003E00000000007C0000000000F80000000001F00000000003E00000000007C00000000 00F80000000001F00000000003E00000000007C0000000000F80000000001F0000000000 3E00000000007C0000000000F80000000000F000000000006000000000002E2E82AB2A> 0 D<600000000000F00000000000F800000000007C00000000003E00000000001F000000 00000F800000000007C00000000003E00000000001F00000000000F800000000007C0000 0000003E00000000001F00000000000F800000000007C00000000003E00000000001F000 00000000F800000000007C00000000003E00000000001F00000000000F800000000007C0 0000000003E00000000001F00000000000F800000000007C00000000003E00000000001F 00000000000F800000000007C00000000003E00000000001F00000000000F80000000000 7C00000000003E00000000001F00000000000F800000000007C00000000003E000000000 01F00000000000F800000000007C00000000003C0000000000182E2E82AB2A>64 D E /Fb 2 52 df<3F00FFC0F3E0F0E0F0E000E000E001E001C007800F001C0038607060 FFC0FFC00B107F8F0F>50 D<1F007F8071C079C071C003C00F800F8001C000E060E0F0E0 F0E0F1C07FC03F000B107F8F0F>I E /Fc 2 122 df<3EF07FF8E3B8C33807380600E600 E618EE38FFF07BE00D0B7E8A11>120 D<3C1C7E1CEE18CC180C381C30183018701CF01F E00FE0006030E073C07F803E000E107F8A10>I E /Fd 7 122 df58 D<0018001800380030003000700060006000E000C001C00180018003800300030007 00060006000E000C000C001C001800380030003000700060006000E000C000C0000D217E 9812>61 D<07DC1FFC3C7C783C703CE038E038E078E078C073E0F3F3F77FFE3E3C100E7F 8D13>97 D<7E007E001C001C003C003C003800380078007FE07FF07C70F838F038E038E0 38E078E070C070E0E0F3C07F803F000D177F960F>I<03F00FF83E3878387000E000E000 E000E000E000E018F0787FF01FC00D0E7F8D0F>I<1F9F003FFF8071F38061E380E1C300 01C00001C00003C00003C000E38300E38700E78E00FFFE007CF800110E7F8D14>120 D<1E03803F0380770380670780E707000F07000E07000E0F001E0E001C0E001C1E001E3E 000FFC0007FC00001C00183C0038780038F0003FE0001F80001114808D11>I E /Fe 2 50 df0 D<0FC00FC03FF03FF07DF87C78707CF0 38E01FE01CC00FC00CC00F800CC007C00CC00FC00CE01FE01C703CF83878F87EF83FF03F F00FC00FC01E0E7E8D23>49 D E /Ff 4 114 df20 DI< 00000003C000000007E00000000EF00000000EF00000001CF00000001CF00000001CF000 0000380000000038000000003800000000780000000078000000007000000000F0000000 00F000000000F000000000E000000001E000000001E000000001E000000001E000000003 C000000003C000000003C000000003C000000007C000000007C000000007800000000780 00000007800000000F800000000F800000000F800000000F000000001F000000001F0000 00001F000000001F000000003F000000003E000000003E000000003E000000003E000000 007E000000007C000000007C000000007C000000007C00000000FC00000000F800000000 F800000000F800000000F800000001F800000001F000000001F000000001F000000001F0 00000001E000000003E000000003E000000003E000000003C000000003C000000003C000 000007C000000007C000000007800000000780000000078000000007800000000F000000 000F000000000F000000000F000000000E000000001E000000001E000000001C00000000 1C000000003C000000003C000000003800000000380000000078000000F070000000F0F0 000000F0E0000000F1E0000000F3C00000007F800000003E00000000245C7E7F17>90 D<00000000060000000006000000000E000000000C000000000C000000001C0000000018 000000001800000000380000000030000000003000000000700000000060000000006000 000000E000000000C000000000C000000001C00000000180000000018000000003800000 00030000000003000000000700000000060000000006000000000E000000000C00000000 0C000000001C000000001800000000180000000038000000003000000000300000000070 000000006000000000600004000060000E0000E0001E0000C0003E0000C0003E0001C000 6F00018000EF000180004F0003800007800300000780030000078007000003C006000003 C006000003C00E000003C00C000001E00C000001E01C000001E018000000F018000000F0 38000000F030000000F0300000007870000000786000000078600000003CE00000003CC0 0000003CC00000001FC00000001F800000001F800000001F800000000F000000000F0000 00000F00000000060000000006000000274B7C812A>113 D E /Fg 10 117 df<000FE000007FF00000F8780001E0780003C078000780780007003000070000 00070000000700000007000000070000000700000007000000FFFFF800FFFFF800070078 000700380007003800070038000700380007003800070038000700380007003800070038 00070038000700380007003800070038000700380007003800070038007FE1FF807FE1FF 80192380A21B>12 D73 D<7FF807FF007FF807FF0007E003F00003E001E00001E001 C00000F003800000F80300000078060000007C0E0000003E0C0000001E180000001F3800 00000FB000000007E000000007E000000003E000000001E000000003F000000003F80000 0007780000000E7C0000000C3E0000001C1E000000181F000000300F8000007007800000 6007C00000C003E00001C001E000038001F000078000F0000FC001FC00FFE007FFC0FFE0 07FFC022227FA125>88 D<01FC0007FF001F0F803E03C03C01C07801E07801E0FFFFE0FF FFE0F00000F00000F00000F00000F000007800007800603C00E03E01C00F83C007FF0001 FC0013157F9416>101 D<1C003E003E003E001C00000000000000000000000000000000 000E00FE00FE001E000E000E000E000E000E000E000E000E000E000E000E000E000E000E 000E00FFC0FFC00A227FA10E>105 D<0E3F80FEFFE0FFE1E01F80F00F00700F00700E00 700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00700E00 70FFE7FFFFE7FF18157F941B>110 D<0E3FC0FEFFE0FFE1F00F80F80F007C0E003C0E00 3E0E001E0E001E0E001E0E001E0E001E0E001E0E003E0E003C0E003C0F007C0F80F80FE1 F00EFFE00E3F800E00000E00000E00000E00000E00000E00000E00000E0000FFE000FFE0 00171F7F941B>112 D<0E7EFEFFFFEF1F8F0F0F0F000F000E000E000E000E000E000E00 0E000E000E000E000E000E00FFF0FFF010157F9413>114 D<1FD83FF87878F038E018E0 18F018F8007F807FE01FF003F8007CC03CC01CE01CE01CF03CF878FFF0CFE00E157E9413 >I<060006000600060006000E000E000E001E003E00FFF8FFF80E000E000E000E000E00 0E000E000E000E000E000E0C0E0C0E0C0E0C0E0C0F1C073807F803E00E1F7F9E13>I E /Fh 1 115 df<0F003FC07FE07FE0FFF0FFF0FFF0FFF07FE07FE03FC00F000C0C8685 0C>114 D E /Fi 1 47 df46 D E /Fj 22 118 df<00F001E003E003C007800F000F001E001E003C003C003C007800780078007800 F800F000F000F000F000F000F000F000F000F000F000F000F000F8007800780078007800 3C003C003C001E001E000F000F00078003C003E001E000F00C2E7EA112>40 DI<001F0000001F0000 003F8000003B8000003B8000007BC0000073C0000071C00000F1E00000E1E00000E0E000 01E0F00001E0F00001C0F00003C0780003C078000380780007803C0007803C0007003C00 0FFFFE000FFFFE000FFFFE001E000F001E000F003C000F803C0007803C000780780007C0 780003C0780003C0F00003E01B207F9F1E>65 DI<003FE000FFF803FFFC07F07C0FC01C1F800C1F0000 3E00003C00007C0000780000780000F80000F00000F00000F00000F00000F00000F00000 F00000F00000F800007800007800007C00003C00003E00001F00001F80060FC00E07F03E 03FFFC00FFF8003FE017227DA01D>II72 DI<003F000000FFC00003FFF00007E1F8000F807C001F003E001E00 1E003C000F003C000F00780007807800078078000780F00003C0F00003C0F00003C0F000 03C0F00003C0F00003C0F00003C0F00003C0F00003C0F80007C078000780780007807800 07803C000F003C000F001E001E001F003E000F807C0007E1F80003FFF00000FFC000003F 00001A227DA021>79 DI82 D<0FF03FFC7FFE783E601F000F000F000F007F0FFF3FFF7E0FF80FF00FF00FF81FFC3F7F FF7FFF3F8F10147E9316>97 D<0007800007800007800007800007800007800007800007 8000078000078000078000078007E7801FFF803FFF803F1F807C0F80780780F80780F007 80F00780F00780F00780F00780F00780F80780780F807C0F803E3F803FFF801FF78007C7 8011207E9F17>100 D<03F0000FFC001FFE003E1F003C0700780700700380FFFF80FFFF 80FFFF80F00000F00000F000007000007800003C03003E0F001FFF0007FE0001F8001114 7F9314>I<07F1F00FFFF01FFFF03E3E007C1F00780F00780F00780F00780F00780F007C 1F003E3E003FFC003FF80037F0003000003800003FFE003FFFC03FFFE07FFFE0F803F0F0 01F0F000F0F000F0F801F07E07E03FFFC01FFF8003FC00141E7F9317>103 DI< F0F0F0F00000000000000000F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F004207D9F 0B>I110 D114 D<0FF03FFC3FFC7C1C780078007C007E003FE03FF01FF803FC007C003C003CC03CF87CFF F87FF01FE00E147F9311>I<1E001E001E001E001E001E00FFF0FFF0FFF01E001E001E00 1E001E001E001E001E001E001E001E001E001E001F601FF00FF00FC00C1A7F9910>II E /Fk 38 122 df<00003FC0FF800000FFE3FFE00001C1EF00E0 000381EE01E0000781FC01E00007001C01C00007003C0000000700380000000F00380000 000E00380000000E00380000000E0078000000FFFFFFFF8001FFFFFFFF80001C00700700 001C00700700001C00F00700001C00E00F00003C00E00E00003800E00E00003800E00E00 003801E01E00003801C01C00007801C01C00007001C01C00007001C03C60007003C038E0 0070038038C000F0038038C000E003803DC000E003801F8000E007800F0000E007000000 01E00700000001C00700000001C00E00000071CE0E0000007B8F1C000000FF1F38000000 7F0FF00000007E07E00000002B29829F28>14 D<000180000380000F00001E00001C0000 380000700000E00000E00001C00003C0000380000700000700000F00000E00000E00001C 00001C00001C000038000038000038000038000070000070000070000070000060000060 0000E00000E00000E00000E00000E00000E00000E0000060000060000070000070000030 00003800003800001C00000C0000112E7AA113>40 D<001C00000C00000E000007000007 000003000003800003800003800003800003800001800001800003800003800003800003 80000380000380000380000700000700000700000700000E00000E00000E00000E00001C 00001C0000380000380000380000700000700000E00001E00001C0000380000780000700 000E00001C0000380000700000E00000112E80A113>I<1C3C3C3C3C0C1C18383070E0C0 C0060E7D840E>44 DI<70F8F8F0F005057B840E>I<000F80 003FE000F0F001C0700380700380380700780F00780F00780E00781E00781E00703C00F0 3C00F03C00F03C00F07801E07801E07801E07801C07003C0F003C0F00380F00780F00700 700F00700E00701C003878001FF0000FC000151F7C9D17>48 D<0000E00000E00000E000 01E00001C00001C00001C0000380000380000780000700000700000E00000E00001C0000 1C0000380000380000700000F30000E70001C700038700078F000F0E001E0E003C0E007F 9E00FFFCC0C0FFC0001F80003C0000380000380000380000780000700000700000700013 277E9D17>52 D<00E03000FFF000FFE001FF800180000180000180000380000300000300 00030000077E0007FF0007C7800703800E03800E03C00003C00003C00007C00007803807 80780780780F80F80F00E01E00E01E00603C0078F8003FE0001F8000141F7C9D17>I<0F 0F1F1F0E0000000000000000000070F8F8F0F008147B930E>58 D<000007000000070000 000F0000000F0000001F0000003F0000003F0000006F0000006F000000CF000000CF0000 018F0000038F0000030F0000060F0000060F00000C0F80000C0780001807800018078000 3FFF80007FFF800060078000C0078000C00780018007800180078003000780070007801F 8007C07FC07FF8FFC07FF81D207E9F22>65 D<0001FE060007FF8E001F83CC007E00FC00 F8007C01F0007C03C0003807C000380F8000380F0000381E0000301E0000303C0000303C 0000007C000000780000007800000078000000F8000000F0000000F0000000F00001C0F0 000180F00001807000038078000300780007003C000E003E001C001F0078000FC1F00007 FFC00000FE00001F217A9F21>67 D<01FFF3FFE001FFF3FFE0001F003E00001E003C0000 1E007C00003E007C00003C007800003C007800003C00F800007C00F800007800F0000078 00F000007801F00000F801F00000FFFFE00000FFFFE00000F003E00001F003E00001E003 C00001E003C00001E007C00003E007C00003C007800003C007800003C00F800007C00F80 0007800F000007800F00000F801F0000FFF9FFF000FFF9FFF000231F7D9E22>72 D<01FFF001FFF0001F00001E00001E00003E00003C00003C00003C00007C000078000078 0000780000F80000F00000F00000F00001F00001E00001E00001E00003E00003C00003C0 0003C00007C0000780000780000F8000FFF800FFF800141F7D9E12>I<0007F0C0001FFD C0007C3F8000F00F8000E0078001C0078003C00300038003000380030003800300038000 0003C0000003E0000003FC000003FF800001FFE00000FFF000001FF8000003F8000000F8 00000078000000380000003800300038003000380070007800700070007000F0007801E0 00FC03C000FF078000CFFF0000C3FC00001A217D9F1A>83 D<00F9C003FFC0078FC00F0F 801E07803C07803C0780780700780700780F00F80F00F00E00F00E00F01E30F01E70F03C 60707C6078FEE03FCFC01F078014147C9317>97 D<07803F803F80070007000F000F000E 000E001E001E001C001CF83FFC3F1E3E0E3C0F780F780F700F700F701FF01FE01EE01EE0 3CE03CE07870F071E03FC01F0010207B9F15>I<007E0003FF0007C3800F07801E07803C 07803C0200780000780000780000F80000F00000F00000F00000F000007003007807003C 3E003FFC000FE00011147C9315>I<0000780003F80003F80000700000700000F00000F0 0000E00000E00001E00001E00001C000F9C003FFC0078FC00F0F801E07803C07803C0780 780700780700780F00F80F00F00E00F00E00F01E30F01E70F03C60707C6078FEE03FCFC0 1F078015207C9F17>I<00FE0003FF0007C7800F03801E01803C03807C0700781F007FFC 007FF000F80000F00000F00000F000007000007003007807003C3E001FFC000FE0001114 7C9315>I<0000F80001FC0003BC00073C00073C000700000700000E00000E00000E0000 0E00000E0001FFE001FFE0001C00001C00001C00003C0000380000380000380000380000 780000700000700000700000700000F00000E00000E00000E00000E00001E00001C00001 C00001C0007380007B8000FF00007F00007C00001629829F0E>I<003E7000FFF001E3F0 03C3E00781E00F01E00F01E01E01C01E01C01E03C03E03C03C03803C03803C07803C0780 3C0F001C1F001E3F000FFF0007CE00000E00001E00001E00001C00703C00787800F8F000 7FE0003F8000141D7E9315>I<01E0000FE0000FE00001C00001C00003C00003C0000380 00038000078000078000070000073F000FFF800FE3800F83C00F01C01F03C01E03801E03 801C03803C07803C0700380700380F00780E38780E30701E30701C70F01EE0F00FC0E007 8015207D9F17>I<00F000F000F000E000000000000000000000000000000F001F803BC0 71C063C06380E380078007000F000F000E001E001C701C603C6038E03DC01F800F000C1F 7D9E0E>I<01E0000FE0000FE00001C00001C00003C00003C00003800003800007800007 80000700000703C00F0FE00F1C600E39E00E71E01EE1E01FC1C01F80001F80003FE0003D F00038F0003878007878E07870C07070C07071C0F07B80F03F80E01F0013207D9F15> 107 D<03C01FC01FC00380038007800780070007000F000F000E000E001E001E001C001C 003C003C00380038007800780070007000F180F380E300E300F7007E003C000A207C9F0C >I<1E0FE0FC003F1FF3FE0077F8778E0063F07E0F0063E03C0700E7C07C0F00C780780E 000780780E000700700E000F00F01E000F00F01C000E00E01C000E00E03C001E01E038E0 1E01E038C01C01C078C01C01C071C03C03C07B803C03C03F003803801E0023147D9325> I<1E0FE03F1FF077F87063F07863E038E7C078C780700780700700700F00F00F00E00E00 E00E01E01E01C71E01C61C03C61C038E3C03DC3C01F83800F018147D931A>I<007E0003 FF8007C7800F03C01E01C03C01E03C01E07801E07801E07803E0F803E0F003C0F003C0F0 0780F00780700F00781E003C7C003FF8000FC00013147C9317>I<03C1F007E7F80EFE3C 0C7C1C0C781E1CF01E18F01E00E01E00E01E01E03E01E03E01C03C01C03C03C07803C078 03C0F003E1E007E3C007FF80073E000700000F00000F00000E00000E00001E00001E0000 FFC000FFC000171D809317>I<1E1F003F3F8077F1C063E3C063C3C0E783C0C783800700 000700000F00000F00000E00000E00001E00001E00001C00001C00003C00003C00003800 0012147D9313>114 D<01FC03FE07870F0F0E0F0E0F1E000F800FF80FFC03FC007E001E 701EF01CF01CF03CF0787FF01FC010147D9313>I<01C003C003C0038003800780078007 00FFF0FFF00F000E000E001E001E001C001C003C003C00380038007870786070E070C079 C03F801F000C1C7C9B0F>I<0F00701F80F03BC0F071C0E063C0E06381E0E381E00781C0 0701C00703C00F03C00E03800E03800E078C0E079C0E0F180E0F180F3FB807FBF003E1E0 16147D9318>I<0F01C01F83E03BC3E071C3E063C1E06380E0E380C00780C00700C00701 C00F01800E01800E01800E03000E03000E07000E0E000F1C0007F80003F00013147D9315 >I<0F0070E01F80F1F03BC0E1F071C0E1F063C0E0F06381E070E381C0600781C0600701 C0600703C0E00F03C0C00E0380C00E0380C00E0381C00E0781800E0783800E0F83000F1F CF0007FDFE0001F0F8001C147D931E>I<07C7801FFFC03CFCE07079E07071E060F1E0E0 E1C000E00000E00001E00001E00001C00001C00073C0E0F3C0C0F381C0F7C180EFC780FF FF007C7C0013147D9315>I<0F00701F80F03BC0E071C0E063C0E06381E0E381C00781C0 0701C00703C00F03800E03800E03800E07800E07000E0F000E0F000F3F0007FE0003EE00 000E00001E00101C00783C0078380078700071E0007FC0001F0000141D7D9316>I E /Fl 10 55 df<038007000F000E001C00380038003800700070007000E000E000E000 E000E000E000E000E000E000E000E000E0007000700070003800380038001C000E000F00 0700038009227E980E>40 DI<003000003000003000003000003000003000003000 003000003000003000003000FFFFFCFFFFFC003000003000003000003000003000003000 00300000300000300000300000300016187E931B>43 D<07C01FF03838701C600C600CE0 0EE00EE00EE00EE00EE00EE00EE00EE00E600C701C701C38381FF007C00F157F9412>48 D<03000F00FF00F700070007000700070007000700070007000700070007000700070007 0007007FF07FF00C157E9412>I<1F803FE071F0E0F8E078E078E0380078007800F000F0 01E003C007800E001C1838187038FFF0FFF0FFF00D157E9412>I<1FE03FF87078703C70 3C003C003C007800F807F007E00078003C001E001EE01EE01EE03E707C7FF81FE00F157F 9412>I<007000F000F001F003F0077006700E701C70187030707070E070FFFEFFFE0070 00700070007003FE03FE0F157F9412>I<70307FF07FE07FC060006000600060006FC07F E078F06070003800380038E038E038E070F0F07FE01F800D157E9412>I<03F00FF81E1C 3C1C781C70007000E080EFF0FFF8F81CF01EE00EE00EE00E600E700E701C3C3C1FF80FE0 0F157F9412>I E /Fm 22 123 df<007E000003FF800007C783000F03C3001E01E3003C 01E7003C00E6007800EE007800EC007800FC00F800F800F000F800F000F000F000E000F0 01E0007003E000780FF0007C3E73803FF87F000FE03E0019147E931D>11 D<0000FE000003FF0000078780000E0380001C038000380380007003800060038000E003 8000C0078001C0070001800E000187FE000387FC000307FC0003001E0003000E0007000F 0006000F0006000F0006000F000E001F000C001E000C001E000C001E001C003C001E003C 001E0078001F00F0003F81E00033FFC00030FF8000300800007000000060000000600000 0060000000E0000000C0000000C0000000C00000001929809F1A>I<003E00007F0000F7 8001C38003C3C00781C00701C00F01C00E03C01E03C01E03C03C03C03C03C03C07C07C07 807FFF807FFF80780F80F80F00F00F00F00F00F01E00F01E00F01C00E03C00E03800E078 00F0F00070E0007BC0003F80001F000012207E9F15>18 D<07FFFF0FFFFF1FFFFF3C3180 703180607380E0638000630000E30000E30000C30001C30001C300038300038380038380 0703800703C00F03C00E0180181480931A>25 D<000F80003FE00078F000E07001C07803 80780380780700780700780700F80F00F80E00F00E00F01E01E01E01E01E03C01F07803F 8F003FFE0039F800380000780000780000700000700000F00000F00000E00000E00000E0 0000151E7F9318>I<060001C00E0003C01C0003E0180003E0380001E0300000E0700E00 C0600E00C0600E00C0600E01C0E01C0180C01C0180C01C0380E0380700E07C0F00F0FC1E 00FFFFFC007FFFF8007FCFF0001F07C0001B1480931C>33 D<70F8F8F87005057C840D> 58 D<70F8FCFC7C0C0C0C1C183870F060060E7C840D>I<00030003000700060006000E00 0C000C001C0018001800380030003000700060006000E000C000C001C001800180018003 80030003000700060006000E000C000C001C0018001800380030003000700060006000E0 00C000C000102D7DA117>61 D<80000000E0000000F80000003E0000000F80000003E000 0000F80000003E0000000F80000003E0000000F80000003E0000000F80000003C0000003 C000000F8000003E000000F8000003E000000F8000003E000000F8000003E000000F8000 003E000000F8000000E0000000800000001A1C7C9823>I<00FFF9FFF000FFF9FFF0000F 801F00000F001E00000F003E00001F003E00001E003C00001E003C00001E007C00003E00 7C00003C007800003C007800003C00F800007C00F800007FFFF000007FFFF000007801F0 0000F801F00000F001E00000F001E00000F003E00001F003E00001E003C00001E003C000 01E007C00003E007C00003C007800003C007800007C00F80007FFCFFF800FFFCFFF80024 1F7E9E26>72 D<00F9C003FFC0078FC00F0F801E07803C07803C0780780700780700780F 00F80F00F00E00F00E00F01E38F01E30F03C30707C7078FE603FCFE01F07C015147E9318 >97 D<07803F803F80070007000F000F000E000E001E001E001C001CF83FFC3F1E3E0E3C 0F780F780F700F700F701FF01FE01EE01EE03CE03CE07870F071E03FC01F0010207E9F14 >I<00FC03FE07C70F0F1E0F3C0F3C04780078007800F800F000F000F000F000F003780F 7C3E3FFC0FE010147E9314>I<00FC03FE07C70F031E033C077C0E783E7FF87FE0F800F0 00F000F000F0007003780F3C3E1FFC0FE010147E9315>101 D<0000FC0001FE0003DE00 039E00079E000700000700000700000700000F00000E00000E0000FFF001FFF0001E0000 1C00001C00001C00001C00003C0000380000380000380000380000380000780000700000 700000700000700000F00000E00000E00000E00001E00001C00071C0007B8000FB80007F 00007E000017297E9F16>I<007000F000F000F000000000000000000000000000000F80 1FC039C071C061C061C0E3C003800780070007000F000E001E381C301C301C701CE01FC0 0F800D1F7F9E10>105 D<1F07E0003F9FF00033FC700071F0780061E0380063E07800E3 C0700003C07000038070000780F0000780E0000700E0000701E0000F01C3800F01C3000E 03C3000E0387001E03CE001E01FC001C00F80019147F931B>110 D<1F0F003FBF8033F9C071F3C061E3C063C3C0E3C3800380000380000780000780000700 000700000F00000F00000E00000E00001E00001E00001C000012147F9315>114 D<07C3C01FFFE03C7E70307CF07038F06078F0E070E000700000700000F00000F00000E0 0000E00071E070F1E060F1C0E0F3E0C0E7E3C07FFF803C3E0014147E931A>120 D<0F80381FC07839E07070E07061E07061C0F0E1C0E003C0E00380E00381E00781C00701 C00701C00703C0070380070780070780079F8003FF0001F700000700000F00080E003C1E 003C3C003C780038F0003FE0001F8000151D7F9316>I<01E06007F0E007FFC00E3F800C 0700000700000E00001C0000380000F00001E0000380000700000E01C01C01801C03803F 8F007FFF00E1FE00C0F80013147E9315>I E /Fn 80 127 df<4010F078F078F078E038 E038E038E038E038E038E038E038E038E0380D0E7B9C18>34 D<078F00078F00078F0007 8F00078F00078F00078F00FFFFE0FFFFE0FFFFE07FFFE00F1E000F1E000F1E000F1E000F 1E000F1E007FFFE0FFFFE0FFFFE0FFFFE01E3C001E3C001E3C001E3C001E3C001E3C001E 3C00131C7E9B18>I<03C0000FF0000FF0001E78001E78001C38001C38001C78001C7BF0 1CF3F01FF3F01FE7800FC7800F87000F0F001F0F003F8E007FDE00FBDE00F1FC00E1FC00 E0F800E0F870F0FC70F9FEF07FFFF03FCFE01F03C0141C7F9B18>38 D<007000F003F007E00F800F001E003E003C007800780070007000F000F000E000E000E0 00E000E000E000F000F00070007000780078003C003E001E000F000F8007E003F000F000 700C24799F18>40 DI<01C00001C00001C00001C000C1C180F1C780F9CF 807FFF001FFC0007F00007F0001FFC007FFF00F9CF80F1C780C1C18001C00001C00001C0 0001C00011147D9718>I<00F00000F00000F00000F00000F00000F00000F00000F000FF FFE0FFFFE0FFFFE0FFFFE000F00000F00000F00000F00000F00000F00000F00000F00013 147E9718>I<3C7E7F7F7F3F0F0F3EFEF8F0080C788518>II<78FCFCFCFC780606778518>I<000380000780000780000F80000F00001F 00001E00001E00003E00003C00007C0000780000780000F80000F00001F00001E00003E0 0003C00003C00007C0000780000F80000F00000F00001F00001E00003E00003C00003C00 007C0000780000F80000F00000F00000E0000011247D9F18>I<01F00007FC000FFE001F 1F001C07003803807803C07001C07001C0E000E0E000E0E000E0E000E0E000E0E000E0E0 00E0E000E0E000E0F001E07001C07001C07803C03803801C07001F1F000FFE0007FC0001 F000131C7E9B18>I<0380038007800F800F803F80FF80FB806380038003800380038003 8003800380038003800380038003800380038003800380FFFEFFFEFFFE0F1C7B9B18>I< 07F8001FFE003FFF807C0FC0F803C0F001E0F001E0F000E0F000E00000E00001E00001E0 0003C00003C0000780000F80001F00003E0000FC0001F80003E00007C0000F80003F00E0 7E00E0FFFFE0FFFFE0FFFFE0131C7E9B18>I<07F8001FFE007FFF807C0FC07803C07801 C07801C00001C00003C00007C0000F8003FF0003FE0003FF80000FC00003C00001E00001 E00000E00000E0F000E0F001E0F001E0F003C0FC0FC07FFF801FFE0007F800131C7E9B18 >I<001F00003F00007F0000770000F70001E70001C70003C7000787000707000E07001E 07003C0700380700780700F00700FFFFF8FFFFF8FFFFF800070000070000070000070000 070000070000FFF800FFF800FFF8151C7F9B18>I<3FFF803FFF803FFF80380000380000 3800003800003800003800003800003800003BFC003FFF003FFF803E07C03803C00001E0 0001E00000E06000E0F000E0F001E0F003E0F007C07C0F807FFF001FFE0007F800131C7E 9B18>I<007E0003FF8007FFC00FC3C01F03C03E03C03C03C0780000780000F00000F3F8 00EFFE00FFFF80FE0F80FC03C0F803E0F001E0F000E0F000E0F000E07000E07801E07803 E03C07C03E0F801FFF000FFE0003F800131C7E9B18>II<03F8000FFE001FFF003E0F803803807001C07001C07001C07001C0 3803803C07801FFF0007FC000FFE001F1F003C07807001C0F001E0E000E0E000E0E000E0 E000E07001C07803C03E0F801FFF000FFE0003F800131C7E9B18>I<03F8000FFE003FFF 007E0F80780780F003C0F003C0E001C0E001E0E001E0F001E0F001E07803E07E0FE03FFF E00FFEE003F8E00001E00001E00001C00003C07807C0780780781F00783F007FFC003FF8 000FE000131C7E9B18>I<78FCFCFCFC78000000000000000078FCFCFCFC780614779318> I<3C7E7E7E7E3C00000000000000003C7E7E7E7E3E1E1E3CFCF8E0071A789318>I<0003 80000F80001F80003F8000FE0001FC0003F8000FE0001FC0003F8000FE0000FC0000FC00 00FE00003F80001FC0000FE00003F80001FC0000FE00003F80001F80000F800003801118 7D9918>I<7FFFC0FFFFE0FFFFE0FFFFE0000000000000000000000000FFFFE0FFFFE0FF FFE07FFFC0130C7E9318>II<00700000F80000F80000D80000D80001DC 0001DC0001DC00018C00038E00038E00038E00038E000306000707000707000707000707 000FFF800FFF800FFF800E03800E03801C01C01C01C0FF8FF8FF8FF8FF8FF8151C7F9B18 >65 DI<01FCE007FFE00FFFE01F07E03E03 E03C01E07801E07800E07000E0F00000F00000E00000E00000E00000E00000E00000E000 00F00000F000007000E07800E07800E03C01E03E03E01F07C00FFF8007FF0001FC00131C 7E9B18>IIII<01F9C007FFC00FFFC01F 0FC03E07C03C03C07803C07801C07001C0F00000F00000E00000E00000E00000E00000E0 1FF0E01FF0F01FF0F001C07003C07803C07803C03C07C03E0FC01F1FC00FFFC007FDC001 F9C0141C7E9B18>III76 DII<0FF8003FFE007FFF00780F00700700F00780E00380E00380E00380E00380E00380 E00380E00380E00380E00380E00380E00380E00380E00380E00380E00380E00380F00780 700700780F007FFF003FFE000FF800111C7D9B18>II<0FF8003FFE007FFF00780F00700700F00780E00380E00380E00380E00380E0 0380E00380E00380E00380E00380E00380E00380E00380E00380E00380E1E380E1E380F0 E78070F700787F007FFF003FFE000FFC00001C00001E00000E00000F0000070000070011 227D9B18>II<07F3801FFF803FFF807C1F 80F80780F00780E00380E00380F00000F000007800007F00003FF0000FFE0001FF80001F C00003C00001E00001E00000E0E000E0E000E0E001E0F003E0FC07C0FFFF80FFFF00E7FC 00131C7E9B18>II