/* tlsqsv.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: lsqsv Uses: svdlsq eigen Test input: lsqsv.dat */ #include "ccmath.h" void main(int na,char **av) { double x,dx,f,t,ssq; double *a,*b,*c,*d,*v,*var,*p; int n,m,i,j; FILE *fp; if(na!=2){ printf("para: in_file\n"); exit(-1);} fp=fopen(*++av,"r"); fscanf(fp,"%d %d %lf",&n,&m,&dx); a=(double *)calloc(m*n,sizeof(double)); b=(double *)calloc(m,sizeof(double)); c=(double *)calloc(n,sizeof(double)); d=(double *)calloc(n,sizeof(double)); v=(double *)calloc(n*n,sizeof(double)); var=(double *)calloc(n*n,sizeof(double)); for(i=0; i reduced rank solution) 8 meas. 5 param. cf-in: 1.0000 0.4000 2.1000 -1.2000 -0.7000 sing-val: 3.271984 0.933026 0.184390 0.024232 0.001806 enter threshold: rank: 4 ssq= 0.000008101694 cf-out: 0.98806170 0.57253938 1.35978962 0.00969771 -1.36504152 cf-var-mat: 0.000011857 -0.000085383 0.000134713 0.000031663 -0.000114710 -0.000085383 0.000700286 -0.001185774 -0.000255025 0.001039132 0.000134713 -0.001185774 0.002120958 0.000417448 -0.001911414 0.000031663 -0.000255025 0.000417448 0.000096597 -0.000355657 -0.000114710 0.001039132 -0.001911414 -0.000355657 0.001752179 var-ev: 0.004599092 0.000079429 0.000003102 0.000000252 0.000000000 var-evec: 0.043243 -0.171071 -0.491188 -0.852960 0.007576 -0.379459 0.686195 0.447672 -0.415632 -0.109486 0.678953 -0.029656 0.506425 -0.247091 0.469705 0.133146 -0.427051 0.429523 -0.161764 -0.767622 -0.612728 -0.562690 0.342590 -0.111746 0.422006 */