/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:18 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_spolz2 s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include #include #include "p_spolz2.h" /* Program DRSPOLZ2 *>> 2009-10-28 DRZPOLZ2 Krogh Mods to get comples used in single prec. *>> 1996-07-03 DRSPOLZ2 Krogh Set for deriving single precision C vers. *>> 1995-05-28 DRSPOLZ2 Krogh Moved formats up. *>> 1994-08-09 DRSPOLZ2 WVS Removed '0' in format *>> 1991-11-20 DRSPOLZ2 CLL Editing for Fortran 90. *>> 1987-12-09 DRSPOLZ2 Lawson Initial Code. * Conversion should only be done from "D" to "S" for processing to C. *--S replaces "?": DR?POLZ2, ?POLZ2 * Demonstration driver for SPOLZ2. * */ int main( ) { long int i, j, _i, _r; float z[2][2]; static float dc[3][3]; static long n = 2; static int _aini = 1; if( _aini ){ /* Do 1 TIME INITIALIZATIONS! */ { static float _itmp0[] = {1.e0,1.e0,-1.e0}; for (i = 1, _r = 0; i <= 3; i++) { dc[0][i - 1] = _itmp0[_r++]; } } { static float _itmp1[] = {2.e0,-12.e0,26.e0}; for (i = 1, _r = 0; i <= 3; i++) { dc[1][i - 1] = _itmp1[_r++]; } } { static float _itmp2[] = {1.e0,-4.e0,4.e0}; for (i = 1, _r = 0; i <= 3; i++) { dc[2][i - 1] = _itmp2[_r++]; } } _aini = 0; } /*++ CODE for .D. | .C. is active */ /*++ CODE for .S. & ~.C. is inactive * complex Z(2) *++ END */ for (j = 1; j <= 3; j++) { printf(" Degree =%2ld", n); printf("\n Coefficients = "); for (i = 1; i <= 3; i++) { printf("%10.4f", dc[j - 1][i - 1]); } printf(" \n"); spolz2( &dc[j - 1][0], (float*)z ); /*++ CODE for .D. & ~.C. is inactive * print '('' Roots =''/(2(1X:''('',1X,F8.5,'','',1X,F8.5,2X, * * '')'',2X)))', (Z(1,K),Z(2,K),K=1,2) *++ CODE for .S. & ~.C. is inactive * print '('' Roots =''/(2(1X:''('',1X,F8.5,'','',1X,F8.5,2X, * * '')'',2X)))', (Z(K),K=1,2) *++ CODE for .C. is active */ printf("\n Roots =\n ( %8.5f, %8.5f ) ( %8.5f, %8.5f ) ", z[0][0], z[0][1], z[1][0], z[1][1]); printf("\n\n \n"); /*++ End */ } exit(0); } /* end of function */