/* sv2val.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 sv2val(double *d,double *a,int m,int n) { double *p,*p1,*q,*w,*v; double s,h,u; int i,j,k,mm,nm,ms; if(m1 ;++i,--mm,p+=n+1){ for(j=0,q=p,s=0.; j0.){ h=sqrt(s); if(*p<0.) h= -h; s+= *p*h; s=1./s; w[0]+=h; for(k=1,ms=n-i; k1){ for(j=0,q=p,s=0.; j0.){ h=sqrt(s); if(*p<0.) h= -h; s+= *p*h; s=1./s; w[0]+=h; for(k=1,ms=n-i; k1){ for(j=0,q=p1,s=0.; j0.){ h=sqrt(s); if(*p1<0.) h= -h; s+= *p1*h; s=1./s; *p1+=h; for(k=n,ms=n*(m-i); k