home *** CD-ROM | disk | FTP | other *** search
- /* General form test program for scientific functions */
-
- /* Routine Tested: MATTRS */
-
- main()
-
- {
- int llr,n;
- static float x[4]={ 1., 0.,
- 1., 0.
- };
-
-
- n = 2;
- llr= 2;
-
- mattrs(n,llr,x); /* call the function */
- printr(x,n,n); /* print the result */
-
- }
-
- /* Routine to print matrices */
-
- printr(a,nrow,ncol)
-
- int nrow,ncol;
- float a[];
-
- {
- int *fp,j,k,ne;
-
- ne=ncol-1;
-
- *fp=fopen("PRN:","w"); /* open the printer */
-
- fprintf(*fp,"Test Results from MATTRS\n\n");
- printf("Test Results from MATTRS\n\n");
-
- for(j = 0; j <= nrow-1 ; j++)
- {
- for(k = j*ncol; k <= j*ncol+ne ; k++)
- {
- fprintf(*fp,"%4.1f ",a[k]);
- printf("%4.1f ",a[k]);
- };
- fprintf(*fp,"\n");
- printf("\n");
- }
- }
-