aboutsummaryrefslogtreecommitdiff
path: root/noao/astcat/src/awcs/ksbsvd.f
blob: 3c78ec235bec9b05fae7a223c0d4f58f1f73468b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
C 	This routines was copied from the stsdas$pkg/analysis/gasp/gasplib/
C       directory. See the file stsdas$copyright.stsdas  for copyright
C	restrictions. 
	subroutine ksbsvd (u,w,v,m,n,b,x)
	parameter (nmax=1000)
	real*8 u(m,n),w(n),v(n,n),b(m),x(n),tmp(nmax)
	real*8 s

	do j=1,n
		s=0.
		if(w(j).ne.0.)then
			do i=1,m
				s=s+u(i,j)*b(i)
			enddo
			s=s/w(j)
		endif
		tmp(j)=s
	enddo
	do j=1,n
		s=0.
		do jj=1,n
			s=s+v(j,jj)*tmp(jj)
		enddo
		x(j)=s
	enddo
	return
	end