/* tsv2val.c CCMATH mathematics library source code. * * Copyright (C) 2000 Daniel A. Atkinson All rights reserved. * This code may be redistributed under the terms of the GNU library * public license (LGPL). ( See the lgpl.license file for details.) * ------------------------------------------------------------------------ */ /* Test: sv2val Uses: matprt Input file: svd?.dat with ? -> 1 to 7 */ #include "ccmath.h" #include char fma[]=" %11.6f",fme[]=" %14.7f"; void main(int na,char **av) { int i,j,m,n; double *a,*d; double *p,*q; FILE *fin; if(na!=2){ printf("para: file_in\n"); exit(-1);} fin=fopen(*++av,"r"); fscanf(fin,"%d %d",&m,&n); if(m>n) */ i=sv2val(d,a,m,n); if(i== -1){ printf("error: m < n\n"); exit(-1);} printf(" sval:\n"); matprt(d,1,n,fme); } /* Test output dim: 6 x 3 a-in: 1.500000 0.500000 8.200000 2.000000 1.000000 -3.000000 1.000000 -2.000000 -6.000000 4.500000 -3.000000 2.000000 0.700000 11.000000 -1.000000 1.200000 -0.500000 1.000000 sval: 11.7105726 10.8589905 5.3023406 */