/* svdu1v.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.) * ------------------------------------------------------------------------ */ #include #include #include "matutl.h" int svdu1v(double *d,double *a,int m,double *v,int n) { double *p,*p1,*q,*pp,*w,*e; double s,h,r,t,sv; int i,j,k,mm,nm,ms; if(m1){ sv=h=0.; for(j=0,q=p,s=0.; j0.){ h=sqrt(s); if(*p<0.) h= -h; s+= *p*h; s=1./s; t=1./(w[0]+=h); sv=1.+fabs(*p/h); for(k=1,ms=n-i; k1){ for(j=0,q=p1,s=0.; j0.){ h=sqrt(s); if(*p1<0.) h= -h; sv=1.+fabs(*p1/h); s+= *p1*h; s=1./s; t=1./(*p1+=h); for(k=n,ms=n*(m-i); k