/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:17 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_smpval s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include #include #include "p_smpval.h" /* program DRSMPVAL * Demonstrates SMPDRV, SMPINT, and SMPVAL. *>> 1997-05-29 DRSMPVAL Krogh Special code for C conversion. *>> 1996-05-28 DRSMPVAL Krogh Added external statement. *>> 1994-10-19 DRSMPVAL Krogh Changes to use M77CON *>> 1993-02-04 DRSMPVAL CLL *>> 1987-12-09 DRSMPVAL Lawson Initial Code. * ------------------------------------------------------------------ *--S replaces "?": DR?MPVAL, ?MPDRV, ?MPINT, ?MPVAL * ------------------------------------------------------------------ *++ Code for .C. is active */ long int n; int main( ) { long int nq, nr; float q[7], r[6], z; static float p[6]={5.e0,2.e0,4.e0,-4.e0,12.e0,16.e0}; /* OFFSET Vectors w/subscript range: 1 to dimension */ float *const P = &p[0] - 1; float *const Q = &q[0] - 1; float *const R = &r[0] - 1; /* end of OFFSET VECTORS */ /*++ End */ /* ------------------------------------------------------------------ */ smpint( p, 3, q, &nq ); smpdrv( q, nq, r, &nr ); z = smpval( q, nq, 6.e0 ) - smpval( q, nq, 4.e0 ); /*++ Code for ~.C. is inactive * print '(21x,''P ='',2f4.0,2x,4f7.2/)', P * print '('' INTEGRAL OF P. Q ='',2f4.0,2x,5f7.2/)', Q * print '('' DERIVATIVE OF Q. R ='',2f4.0,2x,4f7.2/)', R * print '('' DEFINITE INTEGRAL. Z ='',f20.8)', Z *++ Code for .C. is active */ printf(" P =%4.0f%4.0f", p[0], p[1]); for(n=2L; n < (long)(sizeof(p)/sizeof(p[1])); n++) printf("%7.2f", p[n]); printf("\n"); printf(" INTEGRAL OF P. Q =%4.0f%4.0f", q[0], q[1]); for(n=2L; n < (long)(sizeof(q)/sizeof(q[1])); n++) printf("%7.2f", q[n]); printf("\n"); printf(" DERIVATIVE OF Q. R =%4.0f%4.0f", r[0], r[1]); for(n=2L; n < (long)(sizeof(r)/sizeof(r[1])); n++) printf("%7.2f", r[n]); printf("\n"); printf(" DEFINITE INTEGRAL. Z =%20.8f\n", z); exit(0); /*++ End */ } /* end of function */