


    /* EPC Imp to C Translation Release 4 Version Apr 95 */


#include "imptoc.h"

 
main() {
static const int nmax=4;
void testmatrix( void ,void );
int i;
double a [nmax+1] [nmax+1];
double w [nmax+1];
 testmatrix(&a[0] [0] ,nmax);
 fprintf(out_file, "%s", "\nTEST MATRIX EIGENVALUES\n");
 exit(0);
/*%LONG %REAL %FN SQRT(%LONG %REAL ARG)*/
/*!************************************************************************/
/*!*    THIS ROUTINE SCALES WITH A LOOP AND HENCE IS VERY SLOW           **/
/*!*    MUCHFASTER M-C DEPENDENT SCALING IS POSSIBLE                     **/
/*!************************************************************************/
/*%INTEGER I,J,h,n*/
/*%LONG %REAL Y,OLD,NEW,f,ta*/
/*      %IF ARG<0.0 %THEN ARG=-ARG*/
/*      %IF ARG=0 %THEN %RESULT=0.0*/
/*      i=0*/
/*      y=arg*/
/*      y=y/16 %AND i=1+1 %WHILE y>1.0*/
/*      y=y*16.0 %AND i=i-1 %WHILE y<1/16*/
/*      %IF Y>0.34375 %THEN OLD=Y/2+0.4368 %ELSE OLD=Y/2+0.381*/
/*      %CYCLE J=0,1,14*/
/*         NEW=(OLD+Y/OLD)/2*/
/*         %IF MOD(NEW-OLD)<0.000000000000005 %THEN %EXIT*/
/*         OLD=NEW*/
/*      %REPEAT*/
/*      %IF I>0 %THEN NEW=NEW*4.0**i*/
/*      %IF i<0 %THEN new=new/(4.0**imod(i))*/
/*      %RESULT=NEW*/
/*%END*/
static void testmatrix(double *a,int n) {
int i,j;
double t,c,d,f;
 c=((double)((n*(n+1))*((2*n)-5))) / ((double)6);
 d=((double)1) / c;
 a [n] [n]=-d;
 for (i=1; i<=n-1; i++) {
 f=(double)i;
 a [n] [i]=d*f;
 a [i] [n]=a [n] [i];
 a [i] [i]=d*(c-(pow(f,2)));
 for (j=1; j<=i-1; j++) {
 t=(double)j;
 a [j] [i]=-((d*f)*t);
