/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:13 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_dsva s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include #include #include "p_dsva.h" #include /* PARAMETER translations */ #define MMAX 15 #define NMAX 5 #define NMAX2 (NMAX*2) /* end of PARAMETER translations */ int main( ) { long int i, j, m, mdata, n, _i, _r; double d[NMAX], sing[NMAX], work[NMAX2]; static double a[NMAX][MMAX], b[MMAX]; static char names[NMAX][7]={"Earth ","Water ","Air ","Fire ", "Time "}; static long kpvec[4]={1,111111,-1,76}; static int _aini = 1; /* OFFSET Vectors w/subscript range: 1 to dimension */ double *const B = &b[0] - 1; double *const D = &d[0] - 1; long *const Kpvec = &kpvec[0] - 1; double *const Sing = &sing[0] - 1; double *const Work = &work[0] - 1; /* end of OFFSET VECTORS */ if( _aini ){ /* Do 1 TIME INITIALIZATIONS! */ { static double _itmp0[] = {-.13405547e0,-.20162827e0,-.16930778e0, -.18971990e0,-.17387234e0,-.10379475e0,-.15766336e0,-.13346256e0, -.14848550e0,-.13597690e0,-.08779597e0,-.12883867e0,-.10683007e0, -.12011796e0,-.10932972e0,.02058554e0,.00335331e0,-.01641270e0, .00078606e0,.00271659e0,-.03248093e0,-.01876799e0,.00410639e0, -.01405894e0,-.01384391e0,.05967662e0,.06667714e0,.04352153e0, .05740438e0,.05024962e0,.06712457e0,.07352437e0,.04489770e0, .06471862e0,.05876455e0,.08687186e0,.09368296e0,.05672327e0, .08141043e0,.07302320e0,.02149662e0,.06222662e0,.07213486e0, .06200069e0,.05570931e0,.06687407e0,.10344506e0,.09153849e0, .09508223e0,.08393667e0,.15879069e0,.18088339e0,.11540692e0, .16160727e0,.14796479e0,.17642887e0,.20361830e0,.13057860e0, .18385729e0,.17005549e0,.11414080e0,.17259611e0,.14816471e0, .16007466e0,.14374096e0,.07846038e0,.14669563e0,.14365800e0, .14003842e0,.12571177e0,.10803175e0,.16994623e0,.14971519e0, .15885312e0,.14301547e0}; for (i = 1, _r = 0; i <= 15; i++) { for (j = 1; j <= 5; j++) { a[j - 1][i - 1] = _itmp0[_r++]; } } } { static double _itmp1[] = {-.4361e0,-.3437e0,-.2657e0,-.0392e0, .0193e0,.0747e0,.0935e0,.1079e0,.1930e0,.2058e0,.2606e0,.3142e0, .3529e0,.3615e0,.3647e0}; for (i = 1, _r = 0; i <= 15; i++) { B[i] = _itmp1[_r++]; } } _aini = 0; } /*>> 1996-06-27 DRDSVA Krogh Special code for C conversion. *>> 1996-05-28 DRDSVA Krogh Removed implicit statement. *>> 1994-10-19 DRDSVA Krogh Changes to use M77CON *>> 1989-03-07 DRDSVA CLL * Demo driver for DSVA, Singular Value Analysis. * * Mar 1987, C. L. Lawson & S. Y. Chiu, JPL. This sample problem * taken from the book, Solving Least Squares Problems, * Prentice-Hall, 1974, by C. L. Lawson and R. J. Hanson. * ------------------------------------------------------------------ *--D replaces "?": DR?SVA, ?SVA * ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ * */ m = MMAX; n = NMAX; mdata = m; printf(" DRDSVA.. Demonstrate Singular Value Analysis\n Listing of input matrix, A, and vector, B, follows..\n"); /*++ Code for ~.C. is inactive * print '(/(5F12.7,F13.4))', * * ((A(I,J),J=1,N),B(I),I=1,M) *++ Code for .C. is active */ for (i = 1; i <= m; i++){ printf("\n"); for (j = 1; j <= n; j++) printf("%12.7f", a[j - 1][i - 1]); printf("%13.4f", B[i]);} printf(" \n\n\n \n"); printf(" \n\n\n \n"); /*++ End * */ dsva( (double*)a, MMAX, m, n, mdata, b, sing, kpvec, (char*)names ,7, 1, d, work ); exit(0); } /* end of function */