swh:1:snp:16c54c84bc54885e783d4424d714e5cc82f479a1
Raw File
Tip revision: db8668b63745f624236e566437c198010990b082 authored by Roger Koenker on 02 May 2022, 16:42:02 UTC
version 5.93
Tip revision: db8668b
brute.f
C Output from Public domain Ratfor, version 1.05
      subroutine brutpow(n,p,m,h,a,b,c,x,tau,u,xh,d,jminz,nflag)
      integer n,p,m
      double precision x(p),a(n,p),b(n),c(n)
      double precision u(p,p),d(p),xh(p)
      double precision zero, one,tau,pow,minz,z
      integer h(p,m),k,findk,jminz,nflag
      parameter(zero = 0.0d0, one = 1.d0)
      jminz = 1
      minz = pow(n,p,x,a,b,c,tau)
      do23000 j = 2,m 
      k = findk(p,h(1,j),h(1,j-1))
      if(k .eq. 0)then
      nflag = 4
      return
      endif
      call pivot(n,p,h(1,j-1),h(k,j),h(k,j-1),a,u,d,xh,nflag)
      if(nflag .gt. 0)then
      return
      endif
      do23006 i = 1,p
      xh(i) = b(h(i,j))
23006 continue
23007 continue
      call dgemv('N',p,p,one,u,p,xh,1,zero,x,1)
      z = pow(n,p,x,a,b,c,tau)
      if(z .lt. minz)then
      minz = z
      jminz = j
      endif
23000 continue
23001 continue
      return
      end
      integer function findk(p,h,g)
      integer p,k,h(p),g(p)
      findk = 0
      do23010 k = 1,p
      if(h(k) .ne. g(k))then
      findk = k
      goto 23011
      endif
23010 continue
23011 continue
      return
      end
back to top