JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
hto_solve_nonlin Module Reference

Functions/Subroutines

subroutine, public hto_hbrd (HTO_FCN, n, x, fvec, epsfcn, tol, info, diag)
 
subroutine, public hto_hybrd (HTO_FCN, n, x, fvec, xtol, maxfev, ml, mu, epsfcn, diag, mode, factor, nprint, info, nfev)
 
subroutine hto_dogleg (n, r, lr, diag, qtb, delta, x, wa1, wa2)
 
subroutine hto_fdjac1 (HTO_FCN, n, x, fvec, fjac, ldfjac, iflag, ml, mu, epsfcn, wa1, wa2)
 
subroutine hto_qform (m, n, q, ldq, wa)
 
subroutine hto_qrfac (m, n, a, lda, pivot, ipvt, lipvt, rdiag, acnorm, wa)
 
subroutine hto_r1mpyq (m, n, a, lda, v, w)
 
subroutine hto_r1updt (m, n, s, ls, u, v, w, sing)
 
real *8 function hto_enorm (n, x)
 

Function/Subroutine Documentation

◆ hto_dogleg()

subroutine hto_solve_nonlin::hto_dogleg ( integer, intent(in)  n,
real*8, dimension(lr), intent(in)  r,
integer, intent(in)  lr,
real*8, dimension(n), intent(in)  diag,
real*8, dimension(n), intent(in)  qtb,
real*8, intent(in)  delta,
real*8, dimension(n), intent(inout)  x,
real*8, dimension(n), intent(out)  wa1,
real*8, dimension(n), intent(out)  wa2 
)

Definition at line 5805 of file CALLING_cpHTO.f.

5805 *
5806  INTEGER, INTENT(IN) :: n
5807  INTEGER, INTENT(IN) :: lr
5808  real*8, INTENT(IN) :: r(lr)
5809  real*8, INTENT(IN) :: diag(n)
5810  real*8, INTENT(IN) :: qtb(n)
5811  real*8, INTENT(IN) :: delta
5812  real*8, INTENT(IN OUT) :: x(n)
5813  real*8, INTENT(OUT) :: wa1(n)
5814  real*8, INTENT(OUT) :: wa2(n)
5815 
5816 ! **********
5817 
5818 ! SUBROUTINE HTO_DOGLEG
5819 
5820 ! GIVEN AN M BY N MATRIX A, AN N BY N NONSINGULAR DIAGONAL
5821 ! MATRIX D, AN M-VECTOR B, AND A POSITIVE NUMBER DELTA, THE
5822 ! PROBLEM IS TO DETERMINE THE CONVEX COMBINATION X OF THE
5823 ! GAUSS-NEWTON AND SCALED GRADIENT DIRECTIONS THAT MINIMIZES
5824 ! (A*X - B) IN THE LEAST SQUARES SENSE, SUBJECT TO THE
5825 ! RESTRICTION THAT THE EUCLIDEAN NORM OF D*X BE AT MOST DELTA.
5826 
5827 ! THIS SUBROUTINE HTO_COMPLETES THE SOLUTION OF THE PROBLEM
5828 ! IF IT IS PROVIDED WITH THE NECESSARY INFORMATION FROM THE
5829 ! QR FACTORIZATION OF A. THAT IS, IF A= Q*R, WHERE Q HAS
5830 ! ORTHOGONAL COLUMNS AND R IS AN UPPER TRIANGULAR MATRIX,
5831 ! THEN DOGLEG EXPECTS THE FULL UPPER TRIANGLE OF R AND
5832 ! THE FIRST N COMPONENTS OF (Q TRANSPOSE)*B.
5833 
5834 ! THE SUBROUTINE HTO_STATEMENT IS
5835 
5836 ! SUBROUTINE HTO_DOGLEG(N,R,LR,DIAG,QTB,DELTA,X,WA1,WA2)
5837 
5838 ! WHERE
5839 
5840 ! N IS A POSITIVE INTEGER INPUT VARIABLE SET TO THE ORDER OF R.
5841 
5842 ! R IS AN INPUT ARRAY OF LENGTH LR WHICH MUST CONTAIN THE UPPER
5843 ! TRIANGULAR MATRIX R STORED BY ROWS.
5844 
5845 ! LR IS A POSITIVE INTEGER INPUT VARIABLE NOT LESS THAN
5846 ! (N*(N+1))/2.
5847 
5848 ! DIAG IS AN INPUT ARRAY OF LENGTH N WHICH MUST CONTAIN THE
5849 ! DIAGONAL ELEMENTS OF THE MATRIX D.
5850 
5851 ! QTB IS AN INPUT ARRAY OF LENGTH N WHICH MUST CONTAIN THE FIRST
5852 ! N ELEMENTS OF THE VECTOR (Q TRANSPOSE)*B.
5853 
5854 ! DELTA IS A POSITIVE INPUT VARIABLE WHICH SPECIFIES AN UPPER
5855 ! BOUND ON THE EUCLIDEAN NORM OF D*X.
5856 
5857 ! X IS AN OUTPUT ARRAY OF LENGTH N WHICH CONTAINS THE DESIRED
5858 ! CONVEX COMBINATION OF THE GAUSS-NEWTON DIRECTION AND THE
5859 ! SCALED GRADIENT DIRECTION.
5860 
5861 ! WA1 AND WA2 ARE WORK ARRAYS OF LENGTH N.
5862 
5863 ! SUBPROGRAMS CALLED
5864 
5865 ! MINPACK-SUPPLIED ... SPMPAR,ENORM
5866 
5867 ! FORTRAN-SUPPLIED ... ABS,MAX,MIN,SQRT
5868 
5869 ! ARGONNE NATIONAL LABORATORY. MINPACK PROJECT. MARCH 1980.
5870 ! BURTON S. GARBOW, KENNETH E. HILLSTROM, JORGE J. MORE
5871 
5872 ! **********
5873 
5874  INTEGER :: i,j,jj,jp1,k,l
5875  real*8 :: alpha,bnorm,epsmch,gnorm,qnorm,sgnorm,sum,temp
5876 *
5877  epsmch= epsilon(1.0d0)
5878  jj= (n*(n+1))/2+1
5879  DO k= 1,n
5880  j= n-k+1
5881  jp1= j+1
5882  jj= jj-k
5883  l= jj+1
5884  sum= 0.0
5885  IF(n >= jp1) THEN
5886  DO i= jp1,n
5887  sum= sum+r(l)*x(i)
5888  l= l+1
5889  ENDDO
5890  ENDIF
5891  temp= r(jj)
5892  IF(temp == 0.0) THEN
5893  l= j
5894  DO i= 1,j
5895  temp= max(temp,abs(r(l)))
5896  l= l+n-i
5897  ENDDO
5898  temp= epsmch*temp
5899  IF(temp == 0.0) temp= epsmch
5900  ENDIF
5901  x(j)= (qtb(j)-sum)/temp
5902  ENDDO
5903 *
5904  DO j= 1,n
5905  wa1(j)= 0.0
5906  wa2(j)= diag(j)*x(j)
5907  ENDDO
5908  qnorm= hto_enorm(n,wa2)
5909 *
5910  IF(qnorm > delta) THEN
5911  l= 1
5912  DO j= 1,n
5913  temp= qtb(j)
5914  DO i= j,n
5915  wa1(i)= wa1(i)+r(l)*temp
5916  l= l+1
5917  ENDDO
5918  wa1(j)= wa1(j)/diag(j)
5919  ENDDO
5920  gnorm= hto_enorm(n,wa1)
5921  sgnorm= 0.0
5922  alpha= delta/qnorm
5923  IF(gnorm /= 0.0) THEN
5924  DO j= 1,n
5925  wa1(j)= (wa1(j)/gnorm)/diag(j)
5926  ENDDO
5927  l= 1
5928  DO j= 1,n
5929  sum= 0.0
5930  DO i= j,n
5931  sum= sum+r(l)*wa1(i)
5932  l= l+1
5933  ENDDO
5934  wa2(j)= sum
5935  ENDDO
5936  temp= hto_enorm(n,wa2)
5937  sgnorm= (gnorm/temp)/temp
5938  alpha= 0.0
5939  IF(sgnorm < delta) THEN
5940  bnorm= hto_enorm(n,qtb)
5941  temp= (bnorm/gnorm)*(bnorm/qnorm)*(sgnorm/delta)
5942  temp= temp-(delta/qnorm)*(sgnorm/delta)**2+
5943  # sqrt((temp-(delta/qnorm))**2+(1.0d0-(delta/qnorm)**2)*
5944  # (1.0d0-( sgnorm/delta)**2))
5945  alpha= ((delta/qnorm)*(1.0d0-(sgnorm/delta)**2))/temp
5946  ENDIF
5947  ENDIF
5948  temp= (1.0d0-alpha)*min(sgnorm,delta)
5949  DO j= 1,n
5950  x(j)= temp*wa1(j)+alpha*x(j)
5951  ENDDO
5952  ENDIF
5953 *
5954  RETURN
5955 *

◆ hto_enorm()

real*8 function hto_solve_nonlin::hto_enorm ( integer, intent(in)  n,
real*8, dimension(n), intent(in)  x 
)

Definition at line 6621 of file CALLING_cpHTO.f.

6621 *
6622  INTEGER, INTENT(IN) :: n
6623  real*8, INTENT(IN) :: x(n)
6624  real*8 :: fn_val
6625 
6626 ! **********
6627 
6628 ! FUNCTION ENORM
6629 
6630 ! GIVEN AN N-VECTOR X, THIS FUNCTION CALCULATES THE EUCLIDEAN NORM OF X.
6631 
6632 ! THE EUCLIDEAN NORM IS COMPUTED BY ACCUMULATING THE SUM OF SQUARES IN THREE
6633 ! DIFFERENT SUMS. THE SUMS OF SQUARES FOR THE SMALL AND LARGE COMPONENTS
6634 ! ARE SCALED SO THAT NO OVERFLOWS OCCUR. NON-DESTRUCTIVE UNDERFLOWS ARE
6635 ! PERMITTED. UNDERFLOWS AND OVERFLOWS DO NOT OCCUR IN THE COMPUTATION OF THE UNSCALED
6636 ! SUM OF SQUARES FOR THE INTERMEDIATE COMPONENTS.
6637 ! THE DEFINITIONS OF SMALL, INTERMEDIATE AND LARGE COMPONENTS DEPEND ON
6638 ! TWO CONSTANTS, RDWARF AND RGIANT. THE MAIN RESTRICTIONS ON THESE CONSTANTS
6639 ! ARE THAT RDWARF**2 NOT UNDERFLOW AND RGIANT**2 NOT OVERFLOW.
6640 ! THE CONSTANTS GIVEN HERE ARE SUITABLE FOR EVERY KNOWN COMPUTER.
6641 
6642 ! THE FUNCTION STATEMENT IS
6643 
6644 ! REAL FUNCTION ENORM(N, X)
6645 
6646 ! WHERE
6647 
6648 ! N IS A POSITIVE INTEGER INPUT VARIABLE.
6649 
6650 ! X IS AN INPUT ARRAY OF LENGTH N.
6651 
6652 ! SUBPROGRAMS CALLED
6653 
6654 ! FORTRAN-SUPPLIED ... ABS,SQRT
6655 
6656 ! ARGONNE NATIONAL LABORATORY. MINPACK PROJECT. MARCH 1980.
6657 ! BURTON S. GARBOW, KENNETH E. HILLSTROM, JORGE J. MORE
6658 
6659 ! **********
6660 
6661  INTEGER :: i
6662  real*8 :: agiant,floatn,s1,s2,s3,xabs,x1max,x3max
6663  real*8, PARAMETER :: rdwarf= 1.0d-100,rgiant= 1.0d+100
6664 *
6665  s1= 0.0d0
6666  s2= 0.0d0
6667  s3= 0.0d0
6668  x1max= 0.0d0
6669  x3max= 0.0d0
6670  floatn= n
6671  agiant= rgiant/floatn
6672  DO i= 1,n
6673  xabs= abs(x(i))
6674  IF(xabs <= rdwarf.or.xabs >= agiant) THEN
6675  IF(xabs > rdwarf) THEN
6676  IF(xabs > x1max) THEN
6677  s1= 1.0d0+s1*(x1max/xabs)**2
6678  x1max= xabs
6679  ELSE
6680  s1= s1+(xabs/x1max)**2
6681  ENDIF
6682  ELSE
6683  IF(xabs > x3max) THEN
6684  s3= 1.0d0+s3*(x3max/xabs)**2
6685  x3max= xabs
6686  ELSE
6687  IF(xabs /= 0.0d0) s3= s3+(xabs/x3max)**2
6688  ENDIF
6689  ENDIF
6690  ELSE
6691  s2= s2+xabs**2
6692  ENDIF
6693  ENDDO
6694  IF(s1 /= 0.0d0) THEN
6695  fn_val= x1max*sqrt(s1+(s2/x1max)/x1max)
6696  ELSE
6697  IF(s2 /= 0.0d0) THEN
6698  IF(s2 >= x3max) fn_val= sqrt(s2*(1.0d0+(x3max/s2)*(x3max*s3)))
6699  IF(s2 < x3max) fn_val= sqrt(x3max*((s2/x3max)+(x3max*s3)))
6700  ELSE
6701  fn_val= x3max*sqrt(s3)
6702  ENDIF
6703  ENDIF
6704 *
6705  RETURN
6706 *

◆ hto_fdjac1()

subroutine hto_solve_nonlin::hto_fdjac1 (   HTO_FCN,
integer, intent(in)  n,
real*8, dimension(n), intent(inout)  x,
real*8, dimension(n), intent(in)  fvec,
real*8, dimension(ldfjac,n), intent(out)  fjac,
integer, intent(in)  ldfjac,
integer, intent(inout)  iflag,
integer, intent(in)  ml,
integer, intent(in)  mu,
real*8, intent(in)  epsfcn,
real*8, dimension(n), intent(inout)  wa1,
real*8, dimension(n), intent(out)  wa2 
)

Definition at line 5962 of file CALLING_cpHTO.f.

5962 *
5963  INTEGER, INTENT(IN) :: n
5964  real*8, INTENT(IN OUT) :: x(n)
5965  real*8, INTENT(IN) :: fvec(n)
5966  INTEGER, INTENT(IN) :: ldfjac
5967  real*8, INTENT(OUT) :: fjac(ldfjac,n)
5968  INTEGER, INTENT(IN OUT) :: iflag
5969  INTEGER, INTENT(IN) :: ml
5970  INTEGER, INTENT(IN) :: mu
5971  real*8, INTENT(IN) :: epsfcn
5972  real*8, INTENT(IN OUT) :: wa1(n)
5973  real*8, INTENT(OUT) :: wa2(n)
5974 
5975 ! EXTERNAL fcn
5976 
5977  INTERFACE
5978  SUBROUTINE hto_fcn(N,X,FVEC,IFLAG)
5979  IMPLICIT NONE
5980  INTEGER, PARAMETER :: dp= selected_real_kind(14,60)
5981  INTEGER,INTENT(IN) :: n
5982  real*8,INTENT(IN) :: x(n)
5983  real*8, INTENT(OUT) :: fvec(n)
5984  INTEGER, INTENT(IN OUT) :: iflag
5985  END SUBROUTINE hto_fcn
5986  END INTERFACE
5987 
5988 ! **********
5989 
5990 ! SUBROUTINE HTO_FDJAC1
5991 
5992 ! THIS SUBROUTINE HTO_COMPUTES A FORWARD-DIFFERENCE APPROXIMATION TO THE N BY N
5993 ! JACOBIAN MATRIX ASSOCIATED WITH A SPECIFIED PROBLEM OF N FUNCTIONS IN N
5994 ! VARIABLES. IF THE JACOBIAN HAS A BANDED FORM, THEN FUNCTION EVALUATIONS
5995 ! ARE SAVED BY ONLY APPROXIMATING THE NONZERO TERMS.
5996 
5997 ! THE SUBROUTINE HTO_STATEMENT IS
5998 
5999 ! SUBROUTINE HTO_FDJAC1(FCN,N,X,FVEC,FJAC,LDFJAC,IFLAG,ML,MU,EPSFCN,
6000 ! WA1,WA2)
6001 
6002 ! WHERE
6003 
6004 ! FCN IS THE NAME OF THE USER-SUPPLIED SUBROUTINE HTO_WHICH CALCULATES
6005 ! THE FUNCTIONS. FCN MUST BE DECLARED IN AN EXTERNAL STATEMENT IN
6006 ! THE USER CALLING PROGRAM, AND SHOULD BE WRITTEN AS FOLLOWS.
6007 
6008 ! SUBROUTINE HTO_FCN(N,X,FVEC,IFLAG)
6009 ! INTEGER N,IFLAG
6010 ! REAL X(N),FVEC(N)
6011 ! ----------
6012 ! CALCULATE THE FUNCTIONS AT X AND
6013 ! RETURN THIS VECTOR IN FVEC.
6014 ! ----------
6015 ! RETURN
6016 ! END
6017 
6018 ! THE VALUE OF IFLAG SHOULD NOT BE CHANGED BY FCN UNLESS
6019 ! THE USER WANTS TO TERMINATE EXECUTION OF FDJAC1.
6020 ! IN THIS CASE SET IFLAG TO A NEGATIVE INTEGER.
6021 
6022 ! N IS A POSITIVE INTEGER INPUT VARIABLE SET TO THE NUMBER
6023 ! OF FUNCTIONS AND VARIABLES.
6024 
6025 ! X IS AN INPUT ARRAY OF LENGTH N.
6026 
6027 ! FVEC IS AN INPUT ARRAY OF LENGTH N WHICH MUST CONTAIN THE
6028 ! FUNCTIONS EVALUATED AT X.
6029 
6030 ! FJAC IS AN OUTPUT N BY N ARRAY WHICH CONTAINS THE
6031 ! APPROXIMATION TO THE JACOBIAN MATRIX EVALUATED AT X.
6032 
6033 ! LDFJAC IS A POSITIVE INTEGER INPUT VARIABLE NOT LESS THAN N
6034 ! WHICH SPECIFIES THE LEADING DIMENSION OF THE ARRAY FJAC.
6035 
6036 ! IFLAG IS AN INTEGER VARIABLE WHICH CAN BE USED TO TERMINATE
6037 ! THE EXECUTION OF FDJAC1. SEE DESCRIPTION OF FCN.
6038 
6039 ! ML IS A NONNEGATIVE INTEGER INPUT VARIABLE WHICH SPECIFIES
6040 ! THE NUMBER OF SUBDIAGONALS WITHIN THE BAND OF THE
6041 ! JACOBIAN MATRIX. IF THE JACOBIAN IS NOT BANDED, SET
6042 ! ML TO AT LEAST N - 1.
6043 
6044 ! EPSFCN IS AN INPUT VARIABLE USED IN DETERMINING A SUITABLE
6045 ! STEP LENGTH FOR THE FORWARD-DIFFERENCE APPROXIMATION. THIS
6046 ! APPROXIMATION ASSUMES THAT THE RELATIVE ERRORS IN THE
6047 ! FUNCTIONS ARE OF THE ORDER OF EPSFCN. IF EPSFCN IS LESS
6048 ! THAN THE MACHINE PRECISION, IT IS ASSUMED THAT THE RELATIVE
6049 ! ERRORS IN THE FUNCTIONS ARE OF THE ORDER OF THE MACHINE PRECISION.
6050 
6051 ! MU IS A NONNEGATIVE INTEGER INPUT VARIABLE WHICH SPECIFIES
6052 ! THE NUMBER OF SUPERDIAGONALS WITHIN THE BAND OF THE
6053 ! JACOBIAN MATRIX. IF THE JACOBIAN IS NOT BANDED, SET
6054 ! MU TO AT LEAST N - 1.
6055 
6056 ! WA1 AND WA2 ARE WORK ARRAYS OF LENGTH N. IF ML + MU + 1 IS AT
6057 ! LEAST N, THEN THE JACOBIAN IS CONSIDERED DENSE, AND WA2 IS
6058 ! NOT REFERENCED.
6059 
6060 ! SUBPROGRAMS CALLED
6061 
6062 ! MINPACK-SUPPLIED ... SPMPAR
6063 
6064 ! FORTRAN-SUPPLIED ... ABS,MAX,SQRT
6065 
6066 ! ARGONNE NATIONAL LABORATORY. MINPACK PROJECT. MARCH 1980.
6067 ! BURTON S. GARBOW, KENNETH E. HILLSTROM, JORGE J. MORE
6068 
6069 ! **********
6070 *
6071 
6072  INTEGER :: i,j,k,msum
6073  real*8 :: eps,epsmch,h,temp
6074  real*8, PARAMETER :: zero= 0.0d0
6075 *
6076  epsmch= epsilon(1.0d0)
6077  eps= sqrt(max(epsfcn,epsmch))
6078  msum= ml+mu+1
6079  IF(msum >= n) THEN
6080  DO j= 1,n
6081  temp= x(j)
6082  h= eps*abs(temp)
6083  IF(h == zero) h= eps
6084  x(j)= temp+h
6085  CALL hto_fcn(n,x,wa1,iflag)
6086  IF(iflag < 0) EXIT
6087  x(j)= temp
6088  DO i= 1,n
6089  fjac(i,j)= (wa1(i)-fvec(i))/h
6090  ENDDO
6091  ENDDO
6092  ELSE
6093  DO k= 1,msum
6094  DO j= k,n,msum
6095  wa2(j)= x(j)
6096  h= eps*abs(wa2(j))
6097  IF(h == zero) h= eps
6098  x(j)= wa2(j)+h
6099  ENDDO
6100  CALL hto_fcn(n,x,wa1,iflag)
6101  IF(iflag < 0) EXIT
6102  DO j= k,n,msum
6103  x(j)= wa2(j)
6104  h= eps*abs(wa2(j))
6105  IF(h == zero) h= eps
6106  DO i= 1,n
6107  fjac(i,j)= zero
6108  IF(i >= j-mu.and.i <= j+ml) fjac(i,j)= (wa1(i)-fvec(i))/h
6109  ENDDO
6110  ENDDO
6111  ENDDO
6112  ENDIF
6113 *
6114  RETURN
6115 *

◆ hto_hbrd()

subroutine, public hto_solve_nonlin::hto_hbrd (   HTO_FCN,
integer, intent(in)  n,
real*8, dimension(n), intent(inout)  x,
real*8, dimension(n), intent(inout)  fvec,
real*8, intent(in)  epsfcn,
real*8, intent(in)  tol,
integer, intent(out)  info,
real*8, dimension(n), intent(out)  diag 
)

Definition at line 5311 of file CALLING_cpHTO.f.

5311 *
5312 ! Code converted using TO_F90 by Alan Miller
5313 ! Date: 2003-07-15 Time: 13:27:42
5314 *
5315  INTEGER, INTENT(IN) :: n
5316  real*8, INTENT(IN OUT) :: x(n)
5317  real*8, INTENT(IN OUT) :: fvec(n)
5318  real*8, INTENT(IN) :: epsfcn
5319  real*8, INTENT(IN) :: tol
5320  INTEGER, INTENT(OUT) :: info
5321  real*8, INTENT(OUT) :: diag(n)
5322 *
5323 ! EXTERNAL fcn
5324 *
5325  INTERFACE
5326  SUBROUTINE hto_fcn(N,X,FVEC,IFLAG)
5327  IMPLICIT NONE
5328  INTEGER, INTENT(IN) :: n
5329  real*8, INTENT(IN) :: x(n)
5330  real*8, INTENT(OUT) :: fvec(n)
5331  INTEGER, INTENT(IN OUT) :: iflag
5332  END SUBROUTINE hto_fcn
5333  END INTERFACE
5334 
5335 ! **********
5336 
5337 ! SUBROUTINE HTO_HBRD
5338 
5339 ! THE PURPOSE OF HBRD IS TO FIND A ZERO OF A SYSTEM OF N NONLINEAR
5340 ! FUNCTIONS IN N VARIABLES BY A MODIFICATION OF THE POWELL HYBRID METHOD.
5341 ! THIS IS DONE BY USING THE MORE GENERAL NONLINEAR EQUATION SOLVER HYBRD.
5342 ! THE USER MUST PROVIDE A SUBROUTINE HTO_WHICH CALCULATES THE FUNCTIONS.
5343 ! THE JACOBIAN IS THEN CALCULATED BY A FORWARD-DIFFERENCE APPROXIMATION.
5344 
5345 ! THE SUBROUTINE HTO_STATEMENT IS
5346 
5347 ! SUBROUTINE HTO_HBRD(N,X,FVEC,EPSFCN,TOL,INFO,WA,LWA)
5348 
5349 ! WHERE
5350 
5351 ! FCN IS THE NAME OF THE USER-SUPPLIED SUBROUTINE HTO_WHICH CALCULATES
5352 ! THE FUNCTIONS. FCN MUST BE DECLARED IN AN EXTERNAL STATEMENT
5353 ! IN THE USER CALLING PROGRAM, AND SHOULD BE WRITTEN AS FOLLOWS.
5354 
5355 ! SUBROUTINE HTO_FCN(N,X,FVEC,IFLAG)
5356 ! INTEGER N,IFLAG
5357 ! REAL X(N),FVEC(N)
5358 ! ----------
5359 ! CALCULATE THE FUNCTIONS AT X AND RETURN THIS VECTOR IN FVEC.
5360 ! ---------
5361 ! RETURN
5362 ! END
5363 
5364 ! THE VALUE OF IFLAG NOT BE CHANGED BY FCN UNLESS
5365 ! THE USER WANTS TO TERMINATE THE EXECUTION OF HBRD.
5366 ! IN THIS CASE SET IFLAG TO A NEGATIVE INTEGER.
5367 
5368 ! N IS A POSITIVE INTEGER INPUT VARIABLE SET TO THE NUMBER
5369 ! OF FUNCTIONS AND VARIABLES.
5370 
5371 ! X IS AN ARRAY OF LENGTH N. ON INPUT X MUST CONTAIN AN INITIAL
5372 ! ESTIMATE OF THE SOLUTION VECTOR. ON OUTPUT X CONTAINS THE
5373 ! FINAL ESTIMATE OF THE SOLUTION VECTOR.
5374 
5375 ! FVEC IS AN OUTPUT ARRAY OF LENGTH N WHICH CONTAINS
5376 ! THE FUNCTIONS EVALUATED AT THE OUTPUT X.
5377 
5378 ! EPSFCN IS AN INPUT VARIABLE USED IN DETERMINING A SUITABLE STEP LENGTH
5379 ! FOR THE FORWARD-DIFFERENCE APPROXIMATION. THIS APPROXIMATION ASSUMES
5380 ! THAT THE RELATIVE ERRORS IN THE FUNCTIONS ARE OF THE ORDER OF EPSFCN.
5381 ! IF EPSFCN IS LESS THAN THE MACHINE PRECISION, IT IS ASSUMED THAT THE
5382 ! RELATIVE ERRORS IN THE FUNCTIONS ARE OF THE ORDER OF THE MACHINE
5383 ! PRECISION.
5384 
5385 ! TOL IS A NONNEGATIVE INPUT VARIABLE. TERMINATION OCCURS WHEN THE
5386 ! ALGORITHM ESTIMATES THAT THE RELATIVE ERROR BETWEEN X AND THE SOLUTION
5387 ! IS AT MOST TOL.
5388 
5389 ! INFO IS AN INTEGER OUTPUT VARIABLE. IF THE USER HAS TERMINATED
5390 ! EXECUTION, INFO IS SET TO THE (NEGATIVE) VALUE OF IFLAG.
5391 ! SEE DESCRIPTION OF FCN. OTHERWISE, INFO IS SET AS FOLLOWS.
5392 
5393 ! INFO= 0 IMPROPER INPUT PARAMETERS.
5394 
5395 ! INFO= 1 ALGORITHM ESTIMATES THAT THE RELATIVE ERROR
5396 ! BETWEEN X AND THE SOLUTION IS AT MOST TOL.
5397 
5398 ! INFO= 2 NUMBER OF CALLS TO FCN HAS REACHED OR EXCEEDED 200*(N+1).
5399 
5400 ! INFO= 3 TOL IS TOO SMALL. NO FURTHER IMPROVEMENT IN
5401 ! THE APPROXIMATE SOLUTION X IS POSSIBLE.
5402 
5403 ! INFO= 4 ITERATION IS NOT MAKING GOOD PROGRESS.
5404 
5405 ! SUBPROGRAMS CALLED
5406 
5407 ! USER-SUPPLIED ...... FCN
5408 
5409 ! MINPACK-SUPPLIED ... HYBRD
5410 
5411 ! ARGONNE NATIONAL LABORATORY. MINPACK PROJECT. MARCH 1980.
5412 ! BURTON S. GARBOW, KENNETH E. HILLSTROM, JORGE J. MORE
5413 
5414 ! Reference:
5415 ! Powell, M.J.D. 'A hybrid method for nonlinear equations' in Numerical Methods
5416 ! for Nonlinear Algebraic Equations', P.Rabinowitz (editor), Gordon and
5417 ! Breach, London 1970.
5418 ! **********
5419  INTEGER :: maxfev, ml,mode,mu,nfev,nprint
5420  real*8 :: xtol
5421  real*8, PARAMETER :: factor= 100.0d0,zero= 0.0d0
5422 
5423  info= 0
5424 
5425 ! CHECK THE INPUT PARAMETERS FOR ERRORS.
5426 
5427  IF(n <= 0.or.epsfcn < zero.or.tol < zero) GO TO 20
5428 
5429 ! CALL HTO_HYBRD.
5430 
5431  maxfev= 200*(n+1)
5432  xtol= tol
5433  ml= n-1
5434  mu= n-1
5435  mode= 2
5436  nprint= 0
5437  CALL hto_hybrd(hto_fcn,n,x,fvec,xtol,maxfev,ml,mu,epsfcn,diag,
5438  # mode,factor,nprint,info,nfev)
5439  IF(info == 5) info= 4
5440  20 RETURN
5441 
5442 ! LAST CARD OF SUBROUTINE HTO_HBRD.
5443 

◆ hto_hybrd()

subroutine, public hto_solve_nonlin::hto_hybrd (   HTO_FCN,
integer, intent(in)  n,
real*8, dimension(n), intent(inout)  x,
real*8, dimension(n), intent(inout)  fvec,
real*8, intent(in)  xtol,
integer, intent(inout)  maxfev,
integer, intent(inout)  ml,
integer, intent(in)  mu,
real*8, intent(in)  epsfcn,
real*8, dimension(n), intent(out)  diag,
integer, intent(in)  mode,
real*8, intent(in)  factor,
integer, intent(inout)  nprint,
integer, intent(out)  info,
integer, intent(out)  nfev 
)

Definition at line 5450 of file CALLING_cpHTO.f.

5450 
5451  INTEGER, INTENT(IN) :: n
5452  real*8, INTENT(IN OUT) :: x(n)
5453  real*8, INTENT(IN OUT) :: fvec(n)
5454  real*8, INTENT(IN) :: xtol
5455  INTEGER, INTENT(IN OUT) :: maxfev
5456  INTEGER, INTENT(IN OUT) :: ml
5457  INTEGER, INTENT(IN) :: mu
5458  real*8, INTENT(IN) :: epsfcn
5459  real*8, INTENT(OUT) :: diag(n)
5460  INTEGER, INTENT(IN) :: mode
5461  real*8, INTENT(IN) :: factor
5462  INTEGER, INTENT(IN OUT) :: nprint
5463  INTEGER, INTENT(OUT) :: info
5464  INTEGER, INTENT(OUT) :: nfev
5465 
5466 ! EXTERNAL fcn
5467 
5468  INTERFACE
5469  SUBROUTINE hto_fcn(N,X,FVEC,IFLAG)
5470  IMPLICIT NONE
5471  INTEGER, INTENT(IN) :: n
5472  real*8, INTENT(IN) :: x(n)
5473  real*8, INTENT(OUT) :: fvec(n)
5474  INTEGER, INTENT(IN OUT) :: iflag
5475  END SUBROUTINE hto_fcn
5476  END INTERFACE
5477 
5478 ! **********
5479 
5480 ! SUBROUTINE HTO_HYBRD
5481 
5482 ! THE PURPOSE OF HYBRD IS TO FIND A ZERO OF A SYSTEM OF N NONLINEAR
5483 ! FUNCTIONS IN N VARIABLES BY A MODIFICATION OF THE POWELL HYBRID METHOD.
5484 ! THE USER MUST PROVIDE A SUBROUTINE HTO_WHICH CALCULATES THE FUNCTIONS.
5485 ! THE JACOBIAN IS THEN CALCULATED BY A FORWARD-DIFFERENCE APPROXIMATION.
5486 
5487 ! THE SUBROUTINE HTO_STATEMENT IS
5488 
5489 ! SUBROUTINE HTO_HYBRD(FCN,N,X,FVEC,XTOL,MAXFEV,ML,MU,EPSFCN,
5490 ! DIAG,MODE,FACTOR,NPRINT,INFO,NFEV,FJAC,
5491 ! LDFJAC,R,LR,QTF,WA1,WA2,WA3,WA4)
5492 
5493 ! WHERE
5494 
5495 ! FCN IS THE NAME OF THE USER-SUPPLIED SUBROUTINE HTO_WHICH CALCULATES
5496 ! THE FUNCTIONS. FCN MUST BE DECLARED IN AN EXTERNAL STATEMENT IN
5497 ! THE USER CALLING PROGRAM, AND SHOULD BE WRITTEN AS FOLLOWS.
5498 
5499 ! SUBROUTINE HTO_FCN(N, X, FVEC, IFLAG)
5500 ! INTEGER N, IFLAG
5501 ! REAL X(N), FVEC(N)
5502 ! ----------
5503 ! CALCULATE THE FUNCTIONS AT X AND
5504 ! RETURN THIS VECTOR IN FVEC.
5505 ! ---------
5506 ! RETURN
5507 ! END
5508 
5509 ! THE VALUE OF IFLAG SHOULD NOT BE CHANGED BY FCN UNLESS
5510 ! THE USER WANTS TO TERMINATE EXECUTION OF HYBRD.
5511 ! IN THIS CASE SET IFLAG TO A NEGATIVE INTEGER.
5512 
5513 ! N IS A POSITIVE INTEGER INPUT VARIABLE SET TO THE NUMBER
5514 ! OF FUNCTIONS AND VARIABLES.
5515 
5516 ! X IS AN ARRAY OF LENGTH N. ON INPUT X MUST CONTAIN AN INITIAL
5517 ! ESTIMATE OF THE SOLUTION VECTOR. ON OUTPUT X CONTAINS THE FINAL
5518 ! ESTIMATE OF THE SOLUTION VECTOR.
5519 
5520 ! FVEC IS AN OUTPUT ARRAY OF LENGTH N WHICH CONTAINS
5521 ! THE FUNCTIONS EVALUATED AT THE OUTPUT X.
5522 
5523 ! XTOL IS A NONNEGATIVE INPUT VARIABLE. TERMINATION OCCURS WHEN THE
5524 ! RELATIVE ERROR BETWEEN TWO CONSECUTIVE ITERATES IS AT MOST XTOL.
5525 
5526 ! MAXFEV IS A POSITIVE INTEGER INPUT VARIABLE. TERMINATION OCCURS WHEN
5527 ! THE NUMBER OF CALLS TO FCN IS AT LEAST MAXFEV BY THE END OF AN
5528 ! ITERATION.
5529 
5530 ! ML IS A NONNEGATIVE INTEGER INPUT VARIABLE WHICH SPECIFIES THE
5531 ! NUMBER OF SUBDIAGONALS WITHIN THE BAND OF THE JACOBIAN MATRIX.
5532 ! IF THE JACOBIAN IS NOT BANDED, SET ML TO AT LEAST N - 1.
5533 
5534 ! MU IS A NONNEGATIVE INTEGER INPUT VARIABLE WHICH SPECIFIES THE NUMBER
5535 ! OF SUPERDIAGONALS WITHIN THE BAND OF THE JACOBIAN MATRIX.
5536 ! IF THE JACOBIAN IS NOT BANDED, SET MU TO AT LEAST N - 1.
5537 
5538 ! EPSFCN IS AN INPUT VARIABLE USED IN DETERMINING A SUITABLE STEP LENGTH
5539 ! FOR THE FORWARD-DIFFERENCE APPROXIMATION. THIS APPROXIMATION
5540 ! ASSUMES THAT THE RELATIVE ERRORS IN THE FUNCTIONS ARE OF THE ORDER
5541 ! OF EPSFCN. IF EPSFCN IS LESS THAN THE MACHINE PRECISION,
5542 ! IT IS ASSUMED THAT THE RELATIVE ERRORS IN THE FUNCTIONS ARE OF THE
5543 ! ORDER OF THE MACHINE PRECISION.
5544 
5545 ! DIAG IS AN ARRAY OF LENGTH N. IF MODE= 1 (SEE BELOW),
5546 ! DIAG IS INTERNALLY SET. IF MODE= 2, DIAG MUST CONTAIN POSITIVE
5547 ! ENTRIES THAT SERVE AS MULTIPLICATIVE SCALE FACTORS FOR THE
5548 ! VARIABLES.
5549 
5550 ! MODE IS AN INTEGER INPUT VARIABLE. IF MODE= 1, THE VARIABLES WILL BE
5551 ! SCALED INTERNALLY. IF MODE= 2, THE SCALING IS SPECIFIED BY THE
5552 ! INPUT DIAG. OTHER VALUES OF MODE ARE EQUIVALENT TO MODE= 1.
5553 
5554 ! FACTOR IS A POSITIVE INPUT VARIABLE USED IN DETERMINING THE
5555 ! INITIAL STEP BOUND. THIS BOUND IS SET TO THE PRODUCT OF
5556 ! FACTOR AND THE EUCLIDEAN NORM OF DIAG*X IF NONZERO, OR ELSE
5557 ! TO FACTOR ITSELF. IN MOST CASES FACTOR SHOULD LIE IN THE
5558 ! INTERVAL (.1,100.). 100. IS A GENERALLY RECOMMENDED VALUE.
5559 
5560 ! NPRINT IS AN INTEGER INPUT VARIABLE THAT ENABLES CONTROLLED
5561 ! PRINTING OF ITERATES IF IT IS POSITIVE. IN THIS CASE,
5562 ! FCN IS CALLED WITH IFLAG= 0 AT THE BEGINNING OF THE FIRST
5563 ! ITERATION AND EVERY NPRINT ITERATIONS THEREAFTER AND
5564 ! IMMEDIATELY PRIOR TO RETURN, WITH X AND FVEC AVAILABLE
5565 ! FOR PRINTING. IF NPRINT IS NOT POSITIVE, NO SPECIAL CALLS
5566 ! OF FCN WITH IFLAG= 0 ARE MADE.
5567 
5568 ! INFO IS AN INTEGER OUTPUT VARIABLE. IF THE USER HAS
5569 ! TERMINATED EXECUTION, INFO IS SET TO THE (NEGATIVE)
5570 ! VALUE OF IFLAG. SEE DESCRIPTION OF FCN. OTHERWISE,
5571 ! INFO IS SET AS FOLLOWS.
5572 
5573 ! INFO= 0 IMPROPER INPUT PARAMETERS.
5574 
5575 ! INFO= 1 RELATIVE ERROR BETWEEN TWO CONSECUTIVE ITERATES
5576 ! IS AT MOST XTOL.
5577 
5578 ! INFO= 2 NUMBER OF CALLS TO FCN HAS REACHED OR EXCEEDED MAXFEV.
5579 
5580 ! INFO= 3 XTOL IS TOO SMALL. NO FURTHER IMPROVEMENT IN
5581 ! THE APPROXIMATE SOLUTION X IS POSSIBLE.
5582 
5583 ! INFO= 4 ITERATION IS NOT MAKING GOOD PROGRESS, AS
5584 ! MEASURED BY THE IMPROVEMENT FROM THE LAST
5585 ! FIVE JACOBIAN EVALUATIONS.
5586 
5587 ! INFO= 5 ITERATION IS NOT MAKING GOOD PROGRESS, AS MEASURED BY
5588 ! THE IMPROVEMENT FROM THE LAST TEN ITERATIONS.
5589 
5590 ! NFEV IS AN INTEGER OUTPUT VARIABLE SET TO THE NUMBER OF CALLS TO FCN.
5591 
5592 ! FJAC IS AN OUTPUT N BY N ARRAY WHICH CONTAINS THE ORTHOGONAL MATRIX Q
5593 ! PRODUCED BY THE QR FACTORIZATION OF THE FINAL APPROXIMATE JACOBIAN.
5594 
5595 ! LDFJAC IS A POSITIVE INTEGER INPUT VARIABLE NOT LESS THAN N
5596 ! WHICH SPECIFIES THE LEADING DIMENSION OF THE ARRAY FJAC.
5597 
5598 ! R IS AN OUTPUT ARRAY OF LENGTH LR WHICH CONTAINS THE
5599 ! UPPER TRIANGULAR MATRIX PRODUCED BY THE QR FACTORIZATION
5600 ! OF THE FINAL APPROXIMATE JACOBIAN, STORED ROWWISE.
5601 
5602 ! LR IS A POSITIVE INTEGER INPUT VARIABLE NOT LESS THAN (N*(N+1))/2.
5603 
5604 ! QTF IS AN OUTPUT ARRAY OF LENGTH N WHICH CONTAINS
5605 ! THE VECTOR (Q TRANSPOSE)*FVEC.
5606 
5607 ! WA1, WA2, WA3, AND WA4 ARE WORK ARRAYS OF LENGTH N.
5608 
5609 ! SUBPROGRAMS CALLED
5610 
5611 ! USER-SUPPLIED ...... FCN
5612 
5613 ! MINPACK-SUPPLIED ... DOGLEG,SPMPAR,ENORM,FDJAC1,
5614 ! QFORM,QRFAC,R1MPYQ,R1UPDT
5615 
5616 ! FORTRAN-SUPPLIED ... ABS,MAX,MIN,MIN,MOD
5617 
5618 ! ARGONNE NATIONAL LABORATORY. MINPACK PROJECT. MARCH 1980.
5619 ! BURTON S. GARBOW, KENNETH E. HILLSTROM, JORGE J. MORE
5620 
5621 ! **********
5622 
5623  INTEGER :: i,iflag,iter,j,jm1,l,lr,msum,ncfail,ncsuc,
5624  # nslow1,nslow2
5625  INTEGER :: iwa(1)
5626  LOGICAL :: jeval,sing
5627  real*8 :: actred,delta,epsmch,fnorm,fnorm1,pnorm,prered,
5628  # ratio,sum,temp,xnorm
5629  real*8, PARAMETER :: one= 1.0d0,p1= 0.1d0,p5= 0.5d0,
5630  # p001= 0.001d0,p0001= 0.0001d0,zero= 0.0d0
5631  real*8 :: fjac(n,n),r(n*(n+1)/2),qtf(n),wa1(n),wa2(n),
5632  # wa3(n),wa4(n)
5633 *
5634  epsmch= epsilon(1.0d0)
5635  info= 0
5636  iflag= 0
5637  nfev= 0
5638  lr= n*(n+1)/2
5639  IF(n > 0.and.xtol >= zero.and.maxfev > 0.and.ml >= 0
5640  # .and.mu >= 0.and.factor > zero ) THEN
5641  IF(mode == 2) THEN
5642  diag(1:n)= one
5643  ENDIF
5644  iflag= 1
5645  CALL hto_fcn(n,x,fvec,iflag)
5646  nfev= 1
5647  IF(iflag >= 0) THEN
5648  fnorm= hto_enorm(n,fvec)
5649  msum= min(ml+mu+1,n)
5650  iter= 1
5651  ncsuc= 0
5652  ncfail= 0
5653  nslow1= 0
5654  nslow2= 0
5655  20 jeval= .true.
5656  iflag= 2
5657  CALL hto_fdjac1(hto_fcn,n,x,fvec,fjac,n,iflag,ml,mu,epsfcn,
5658  # wa1,wa2)
5659  nfev= nfev+msum
5660  IF(iflag >= 0) THEN
5661  CALL hto_qrfac(n,n,fjac,n,.false.,iwa,1,wa1,wa2,wa3)
5662  IF(iter == 1) THEN
5663  IF(mode /= 2) THEN
5664  DO j= 1,n
5665  diag(j)= wa2(j)
5666  IF(wa2(j) == zero) diag(j)= one
5667  ENDDO
5668  ENDIF
5669  wa3(1:n)= diag(1:n)*x(1:n)
5670  xnorm= hto_enorm(n,wa3)
5671  delta= factor*xnorm
5672  IF(delta == zero) delta= factor
5673  ENDIF
5674  qtf(1:n)= fvec(1:n)
5675  DO j= 1,n
5676  IF(fjac(j,j) /= zero) THEN
5677  sum= zero
5678  DO i= j,n
5679  sum= sum+fjac(i,j)*qtf(i)
5680  ENDDO
5681  temp= -sum/fjac(j,j)
5682  DO i= j,n
5683  qtf(i)= qtf(i)+fjac(i,j)*temp
5684  ENDDO
5685  ENDIF
5686  ENDDO
5687  sing= .false.
5688  DO j= 1,n
5689  l= j
5690  jm1= j-1
5691  IF(jm1 >= 1) THEN
5692  DO i= 1,jm1
5693  r(l)= fjac(i,j)
5694  l= l+n-i
5695  ENDDO
5696  ENDIF
5697  r(l)= wa1(j)
5698  IF(wa1(j) == zero) sing= .true.
5699  ENDDO
5700  CALL hto_qform(n,n,fjac,n,wa1)
5701  IF(mode /= 2) THEN
5702  DO j= 1,n
5703  diag(j)= max(diag(j),wa2(j))
5704  ENDDO
5705  ENDIF
5706  120 IF(nprint > 0) THEN
5707  iflag= 0
5708  IF(mod(iter-1,nprint) == 0) CALL hto_fcn(n,x,fvec,iflag)
5709  IF(iflag < 0) GO TO 190
5710  ENDIF
5711  CALL hto_dogleg(n,r,lr,diag,qtf,delta,wa1,wa2,wa3)
5712  DO j= 1,n
5713  wa1(j)= -wa1(j)
5714  wa2(j)= x(j)+wa1(j)
5715  wa3(j)= diag(j)*wa1(j)
5716  ENDDO
5717  pnorm= hto_enorm(n,wa3)
5718  IF(iter == 1) delta= min(delta,pnorm)
5719  iflag= 1
5720  CALL hto_fcn(n,wa2,wa4,iflag)
5721  nfev= nfev+1
5722  IF(iflag >= 0) THEN
5723  fnorm1= hto_enorm(n,wa4)
5724  actred= -one
5725  IF(fnorm1 < fnorm) actred= one-(fnorm1/fnorm)**2
5726  l= 1
5727  DO i= 1,n
5728  sum= zero
5729  DO j= i,n
5730  sum= sum+r(l)*wa1(j)
5731  l= l+1
5732  ENDDO
5733  wa3(i)= qtf(i)+sum
5734  ENDDO
5735  temp= hto_enorm(n,wa3)
5736  prered= zero
5737  IF(temp < fnorm) prered= one-(temp/fnorm)**2
5738  ratio= zero
5739  IF(prered > zero) ratio= actred/prered
5740  IF(ratio < p1) THEN
5741  ncsuc= 0
5742  ncfail= ncfail+1
5743  delta= p5*delta
5744  ELSE
5745  ncfail= 0
5746  ncsuc= ncsuc+1
5747  IF(ratio >= p5.or.ncsuc > 1) delta= max(delta,pnorm/p5)
5748  IF(abs(ratio-one) <= p1) delta= pnorm/p5
5749  ENDIF
5750  IF(ratio >= p0001) THEN
5751  DO j= 1,n
5752  x(j)= wa2(j)
5753  wa2(j)= diag(j)*x(j)
5754  fvec(j)= wa4(j)
5755  ENDDO
5756  xnorm= hto_enorm(n,wa2)
5757  fnorm= fnorm1
5758  iter= iter+1
5759  ENDIF
5760  nslow1= nslow1+1
5761  IF(actred >= p001) nslow1= 0
5762  IF(jeval) nslow2= nslow2+1
5763  IF(actred >= p1) nslow2= 0
5764  IF(delta <= xtol*xnorm.or.fnorm == zero) info= 1
5765  IF(info == 0) THEN
5766  IF(nfev >= maxfev) info= 2
5767  IF(p1*max(p1*delta,pnorm) <= epsmch*xnorm) info= 3
5768  IF(nslow2 == 5) info= 4
5769  IF(nslow1 == 10) info= 5
5770  IF(info == 0) THEN
5771  IF(ncfail /= 2) THEN
5772  DO j= 1,n
5773  sum= zero
5774  DO i= 1,n
5775  sum= sum+fjac(i,j)*wa4(i)
5776  ENDDO
5777  wa2(j)= (sum-wa3(j))/pnorm
5778  wa1(j)= diag(j)*((diag(j)*wa1(j))/pnorm)
5779  IF(ratio >= p0001) qtf(j)= sum
5780  ENDDO
5781  CALL hto_r1updt(n,n,r,lr,wa1,wa2,wa3,sing)
5782  CALL hto_r1mpyq(n,n,fjac,n,wa2,wa3)
5783  CALL hto_r1mpyq(1,n,qtf,1,wa2,wa3)
5784  jeval= .false.
5785  GO TO 120
5786  ENDIF
5787  GO TO 20
5788  ENDIF
5789  ENDIF
5790  ENDIF
5791  ENDIF
5792  ENDIF
5793  ENDIF
5794 *
5795  190 IF(iflag < 0) info= iflag
5796  iflag= 0
5797  IF(nprint > 0) CALL hto_fcn(n,x,fvec,iflag)
5798  RETURN
5799 *

◆ hto_qform()

subroutine hto_solve_nonlin::hto_qform ( integer, intent(in)  m,
integer, intent(in)  n,
real*8, dimension(ldq,m), intent(out)  q,
integer, intent(in)  ldq,
real*8, dimension(m), intent(out)  wa 
)

Definition at line 6121 of file CALLING_cpHTO.f.

6121 *
6122  INTEGER, INTENT(IN) :: m
6123  INTEGER, INTENT(IN) :: n
6124  INTEGER, INTENT(IN) :: ldq
6125  real*8, INTENT(OUT) :: q(ldq,m)
6126  real*8, INTENT(OUT) :: wa(m)
6127 
6128 ! **********
6129 
6130 ! SUBROUTINE HTO_QFORM
6131 
6132 ! THIS SUBROUTINE HTO_PROCEEDS FROM THE COMPUTED QR FACTORIZATION OF AN M BY N
6133 ! MATRIX A TO ACCUMULATE THE M BY M ORTHOGONAL MATRIX Q FROM ITS FACTORED FORM.
6134 
6135 ! THE SUBROUTINE HTO_STATEMENT IS
6136 
6137 ! SUBROUTINE HTO_QFORM(M,N,Q,LDQ,WA)
6138 
6139 ! WHERE
6140 
6141 ! M IS A POSITIVE INTEGER INPUT VARIABLE SET TO THE NUMBER
6142 ! OF ROWS OF A AND THE ORDER OF Q.
6143 
6144 ! N IS A POSITIVE INTEGER INPUT VARIABLE SET TO THE NUMBER OF COLUMNS OF A.
6145 
6146 ! Q IS AN M BY M ARRAY. ON INPUT THE FULL LOWER TRAPEZOID IN
6147 ! THE FIRST MIN(M,N) COLUMNS OF Q CONTAINS THE FACTORED FORM.
6148 ! ON OUTPUT Q HAS BEEN ACCUMULATED INTO A SQUARE MATRIX.
6149 
6150 ! LDQ IS A POSITIVE INTEGER INPUT VARIABLE NOT LESS THAN M
6151 ! WHICH SPECIFIES THE LEADING DIMENSION OF THE ARRAY Q.
6152 
6153 ! WA IS A WORK ARRAY OF LENGTH M.
6154 
6155 ! SUBPROGRAMS CALLED
6156 
6157 ! FORTRAN-SUPPLIED ... MIN
6158 
6159 ! ARGONNE NATIONAL LABORATORY. MINPACK PROJECT. MARCH 1980.
6160 ! BURTON S. GARBOW, KENNETH E. HILLSTROM, JORGE J. MORE
6161 
6162 ! **********
6163 *
6164  INTEGER :: i,j,jm1,k,l,minmn,np1
6165  real*8 :: sum,temp
6166  real*8, PARAMETER :: one= 1.0d0,zero= 0.0d0
6167 *
6168  minmn= min(m,n)
6169  IF(minmn >= 2) THEN
6170  DO j= 2,minmn
6171  jm1= j-1
6172  DO i= 1,jm1
6173  q(i,j)= zero
6174  ENDDO
6175  ENDDO
6176  ENDIF
6177  np1= n+1
6178  IF(m >= np1) THEN
6179  DO j= np1,m
6180  DO i= 1,m
6181  q(i,j)= zero
6182  ENDDO
6183  q(j,j)= one
6184  ENDDO
6185  ENDIF
6186  DO l= 1,minmn
6187  k= minmn-l+1
6188  DO i= k,m
6189  wa(i)= q(i,k)
6190  q(i,k)= zero
6191  ENDDO
6192  q(k,k)= one
6193  IF(wa(k) /= zero) THEN
6194  DO j= k,m
6195  sum= zero
6196  DO i= k,m
6197  sum= sum+q(i,j)*wa(i)
6198  ENDDO
6199  temp= sum/wa(k)
6200  DO i= k,m
6201  q(i,j)= q(i,j)-temp*wa(i)
6202  ENDDO
6203  ENDDO
6204  ENDIF
6205  ENDDO
6206 *
6207  RETURN
6208 *

◆ hto_qrfac()

subroutine hto_solve_nonlin::hto_qrfac ( integer, intent(in)  m,
integer, intent(in)  n,
real*8, dimension(lda,n), intent(inout)  a,
integer, intent(in)  lda,
logical, intent(in)  pivot,
integer, dimension(lipvt), intent(out)  ipvt,
integer, intent(in)  lipvt,
real*8, dimension(n), intent(out)  rdiag,
real*8, dimension(n), intent(out)  acnorm,
real*8, dimension(n), intent(out)  wa 
)

Definition at line 6214 of file CALLING_cpHTO.f.

6214 *
6215  INTEGER, INTENT(IN) :: m
6216  INTEGER, INTENT(IN) :: n
6217  INTEGER, INTENT(IN) :: lda
6218  real*8, INTENT(IN OUT) :: a(lda,n)
6219  LOGICAL, INTENT(IN) :: pivot
6220  INTEGER, INTENT(IN) :: lipvt
6221  INTEGER, INTENT(OUT) :: ipvt(lipvt)
6222  real*8, INTENT(OUT) :: rdiag(n)
6223  real*8, INTENT(OUT) :: acnorm(n)
6224  real*8, INTENT(OUT) :: wa(n)
6225 
6226 ! **********
6227 
6228 ! SUBROUTINE HTO_QRFAC
6229 
6230 ! THIS SUBROUTINE HTO_USES HOUSEHOLDER TRANSFORMATIONS WITH COLUMN PIVOTING
6231 ! (OPTIONAL) TO COMPUTE A QR FACTORIZATION OF THE M BY N MATRIX A.
6232 ! THAT IS, QRFAC DETERMINES AN ORTHOGONAL MATRIX Q, A PERMUTATION MATRIX P,
6233 ! AND AN UPPER TRAPEZOIDAL MATRIX R WITH DIAGONAL ELEMENTS OF NONINCREASING
6234 ! MAGNITUDE, SUCH THAT A*P= Q*R. THE HOUSEHOLDER TRANSFORMATION FOR
6235 ! COLUMN K, K= 1,2,...,MIN(M,N), IS OF THE FORM
6236 
6237 ! T
6238 ! I - (1/U(K))*U*U
6239 
6240 ! WHERE U HAS ZEROS IN THE FIRST K-1 POSITIONS. THE FORM OF THIS
6241 ! TRANSFORMATION AND THE METHOD OF PIVOTING FIRST APPEARED IN THE
6242 ! CORRESPONDING LINPACK SUBROUTINE.
6243 
6244 ! THE SUBROUTINE HTO_STATEMENT IS
6245 
6246 ! SUBROUTINE HTO_QRFAC(M,N,A,LDA,PIVOT,IPVT,LIPVT,RDIAG,ACNORM,WA)
6247 
6248 ! WHERE
6249 
6250 ! M IS A POSITIVE INTEGER INPUT VARIABLE SET TO THE NUMBER OF ROWS OF A.
6251 
6252 ! N IS A POSITIVE INTEGER INPUT VARIABLE SET TO THE NUMBER
6253 ! OF COLUMNS OF A.
6254 
6255 ! A IS AN M BY N ARRAY. ON INPUT A CONTAINS THE MATRIX FOR WHICH THE
6256 ! QR FACTORIZATION IS TO BE COMPUTED. ON OUTPUT THE STRICT UPPER
6257 ! TRAPEZOIDAL PART OF A CONTAINS THE STRICT UPPER TRAPEZOIDAL PART OF R,
6258 ! AND THE LOWER TRAPEZOIDAL PART OF A CONTAINS A FACTORED FORM OF Q
6259 ! (THE NON-TRIVIAL ELEMENTS OF THE U VECTORS DESCRIBED ABOVE).
6260 
6261 ! LDA IS A POSITIVE INTEGER INPUT VARIABLE NOT LESS THAN M
6262 ! WHICH SPECIFIES THE LEADING DIMENSION OF THE ARRAY A.
6263 
6264 ! PIVOT IS A LOGICAL INPUT VARIABLE. IF PIVOT IS SET TRUE,
6265 ! THEN COLUMN PIVOTING IS ENFORCED. IF PIVOT IS SET FALSE,
6266 ! THEN NO COLUMN PIVOTING IS DONE.
6267 
6268 ! IPVT IS AN INTEGER OUTPUT ARRAY OF LENGTH LIPVT. IPVT DEFINES THE
6269 ! PERMUTATION MATRIX P SUCH THAT A*P= Q*R.
6270 ! COLUMN J OF P IS COLUMN IPVT(J) OF THE IDENTITY MATRIX.
6271 ! IF PIVOT IS FALSE, IPVT IS NOT REFERENCED.
6272 
6273 ! LIPVT IS A POSITIVE INTEGER INPUT VARIABLE. IF PIVOT IS FALSE,
6274 ! THEN LIPVT MAY BE AS SMALL AS 1. IF PIVOT IS TRUE, THEN
6275 ! LIPVT MUST BE AT LEAST N.
6276 
6277 ! RDIAG IS AN OUTPUT ARRAY OF LENGTH N WHICH CONTAINS THE
6278 ! DIAGONAL ELEMENTS OF R.
6279 
6280 ! ACNORM IS AN OUTPUT ARRAY OF LENGTH N WHICH CONTAINS THE NORMS OF
6281 ! THE CORRESPONDING COLUMNS OF THE INPUT MATRIX A.
6282 ! IF THIS INFORMATION IS NOT NEEDED, THEN ACNORM CAN COINCIDE WITH RDIAG.
6283 
6284 ! WA IS A WORK ARRAY OF LENGTH N. IF PIVOT IS FALSE, THEN WA
6285 ! CAN COINCIDE WITH RDIAG.
6286 
6287 ! SUBPROGRAMS CALLED
6288 
6289 ! MINPACK-SUPPLIED ... SPMPAR,ENORM
6290 
6291 ! FORTRAN-SUPPLIED ... MAX,SQRT,MIN
6292 
6293 ! ARGONNE NATIONAL LABORATORY. MINPACK PROJECT. MARCH 1980.
6294 ! BURTON S. GARBOW, KENNETH E. HILLSTROM, JORGE J. MORE
6295 
6296 ! **********
6297  INTEGER :: i,j,jp1,k,kmax,minmn
6298  real*8 :: ajnorm,epsmch,sum,temp
6299  real*8, PARAMETER :: one= 1.0d0,p05= 0.05d0,zero= 0.0d0
6300 *
6301  epsmch= epsilon(1.0d0)
6302  DO j= 1,n
6303  acnorm(j)= hto_enorm(m,a(1:,j))
6304  rdiag(j)= acnorm(j)
6305  wa(j)= rdiag(j)
6306  IF(pivot) ipvt(j)= j
6307  ENDDO
6308  minmn= min(m,n)
6309  DO j= 1,minmn
6310  IF(pivot) THEN
6311  kmax= j
6312  DO k= j,n
6313  IF(rdiag(k) > rdiag(kmax)) kmax= k
6314  ENDDO
6315  IF(kmax /= j) THEN
6316  DO i= 1,m
6317  temp= a(i,j)
6318  a(i,j)= a(i,kmax)
6319  a(i,kmax)= temp
6320  ENDDO
6321  rdiag(kmax)= rdiag(j)
6322  wa(kmax)= wa(j)
6323  k= ipvt(j)
6324  ipvt(j)= ipvt(kmax)
6325  ipvt(kmax)= k
6326  ENDIF
6327  ENDIF
6328  ajnorm= hto_enorm(m-j+1,a(j:,j))
6329  IF(ajnorm /= zero) THEN
6330  IF(a(j,j) < zero) ajnorm= -ajnorm
6331  DO i= j,m
6332  a(i,j)= a(i,j)/ajnorm
6333  ENDDO
6334  a(j,j)= a(j,j)+one
6335  jp1= j+1
6336  IF(n >= jp1) THEN
6337  DO k= jp1,n
6338  sum= zero
6339  DO i= j,m
6340  sum= sum+a(i,j)*a(i,k)
6341  ENDDO
6342  temp= sum/a(j,j)
6343  DO i= j,m
6344  a(i,k)= a(i,k)-temp*a(i,j)
6345  ENDDO
6346  IF(.NOT.(.NOT.pivot.OR.rdiag(k) == zero)) THEN
6347  temp= a(j,k)/rdiag(k)
6348  rdiag(k)= rdiag(k)*sqrt(max(zero,one-temp**2))
6349  IF(p05*(rdiag(k)/wa(k))**2 <= epsmch) THEN
6350  rdiag(k)= hto_enorm(m-j,a(jp1:,k))
6351  wa(k)= rdiag(k)
6352  ENDIF
6353  ENDIF
6354  ENDDO
6355  ENDIF
6356  ENDIF
6357  rdiag(j)= -ajnorm
6358  ENDDO
6359 *
6360  RETURN
6361 *

◆ hto_r1mpyq()

subroutine hto_solve_nonlin::hto_r1mpyq ( integer, intent(in)  m,
integer, intent(in)  n,
real*8, dimension(lda,n), intent(inout)  a,
integer, intent(in)  lda,
real*8, dimension(n), intent(in)  v,
real*8, dimension(n), intent(in)  w 
)

Definition at line 6367 of file CALLING_cpHTO.f.

6367 *
6368  INTEGER, INTENT(IN) :: m
6369  INTEGER, INTENT(IN) :: n
6370  INTEGER, INTENT(IN) :: lda
6371  real*8, INTENT(IN OUT) :: a(lda,n)
6372  real*8, INTENT(IN) :: v(n)
6373  real*8, INTENT(IN) :: w(n)
6374 
6375 ! **********
6376 
6377 ! SUBROUTINE HTO_R1MPYQ
6378 
6379 ! GIVEN AN M BY N MATRIX A, THIS SUBROUTINE HTO_COMPUTES A*Q WHERE
6380 ! Q IS THE PRODUCT OF 2*(N - 1) TRANSFORMATIONS
6381 
6382 ! GV(N-1)*...*GV(1)*GW(1)*...*GW(N-1)
6383 
6384 ! AND GV(I), GW(I) ARE GIVENS ROTATIONS IN THE (I,N) PLANE WHICH
6385 ! ELIMINATE ELEMENTS IN THE I-TH AND N-TH PLANES, RESPECTIVELY.
6386 ! Q ITSELF IS NOT GIVEN, RATHER THE INFORMATION TO RECOVER THE
6387 ! GV, GW ROTATIONS IS SUPPLIED.
6388 
6389 ! THE SUBROUTINE HTO_STATEMENT IS
6390 
6391 ! SUBROUTINE HTO_R1MPYQ(M, N, A, LDA, V, W)
6392 
6393 ! WHERE
6394 
6395 ! M IS A POSITIVE INTEGER INPUT VARIABLE SET TO THE NUMBER OF ROWS OF A.
6396 
6397 ! N IS A POSITIVE INTEGER INPUT VARIABLE SET TO THE NUMBER OF COLUMNS OF A.
6398 
6399 ! A IS AN M BY N ARRAY. ON INPUT A MUST CONTAIN THE MATRIX TO BE
6400 ! POSTMULTIPLIED BY THE ORTHOGONAL MATRIX Q DESCRIBED ABOVE.
6401 ! ON OUTPUT A*Q HAS REPLACED A.
6402 
6403 ! LDA IS A POSITIVE INTEGER INPUT VARIABLE NOT LESS THAN M
6404 ! WHICH SPECIFIES THE LEADING DIMENSION OF THE ARRAY A.
6405 
6406 ! V IS AN INPUT ARRAY OF LENGTH N. V(I) MUST CONTAIN THE INFORMATION
6407 ! NECESSARY TO RECOVER THE GIVENS ROTATION GV(I) DESCRIBED ABOVE.
6408 
6409 ! W IS AN INPUT ARRAY OF LENGTH N. W(I) MUST CONTAIN THE INFORMATION
6410 ! NECESSARY TO RECOVER THE GIVENS ROTATION GW(I) DESCRIBED ABOVE.
6411 
6412 ! SUBROUTINES CALLED
6413 
6414 ! FORTRAN-SUPPLIED ... ABS, SQRT
6415 
6416 ! ARGONNE NATIONAL LABORATORY. MINPACK PROJECT. MARCH 1980.
6417 ! BURTON S. GARBOW, KENNETH E. HILLSTROM, JORGE J. MORE
6418 
6419 ! **********
6420 
6421  INTEGER :: i,j,nmj,nm1
6422  real*8 :: cos,sin,temp
6423  real*8, PARAMETER :: one= 1.0d0
6424 *
6425  nm1= n-1
6426  IF(nm1 >= 1) THEN
6427  DO nmj= 1,nm1
6428  j= n-nmj
6429  IF(abs(v(j)) > one) cos= one/v(j)
6430  IF(abs(v(j)) > one) sin= sqrt(one-cos**2)
6431  IF(abs(v(j)) <= one) sin= v(j)
6432  IF(abs(v(j)) <= one) cos= sqrt(one-sin**2)
6433  DO i= 1,m
6434  temp= cos*a(i,j)-sin*a(i,n)
6435  a(i,n)= sin*a(i,j)+cos*a(i,n)
6436  a(i,j)= temp
6437  ENDDO
6438  ENDDO
6439  DO j= 1,nm1
6440  IF(abs(w(j)) > one) cos= one/w(j)
6441  IF(abs(w(j)) > one) sin= sqrt(one-cos**2)
6442  IF(abs(w(j)) <= one) sin= w(j)
6443  IF(abs(w(j)) <= one) cos= sqrt(one-sin**2)
6444  DO i= 1,m
6445  temp= cos*a(i,j)+sin*a(i,n)
6446  a(i,n)= -sin*a(i,j)+cos*a(i,n)
6447  a(i,j)= temp
6448  ENDDO
6449  ENDDO
6450  ENDIF
6451 *
6452  RETURN
6453 *

◆ hto_r1updt()

subroutine hto_solve_nonlin::hto_r1updt ( integer, intent(in)  m,
integer, intent(in)  n,
real*8, dimension(ls), intent(inout)  s,
integer, intent(in)  ls,
real*8, dimension(m), intent(in)  u,
real*8, dimension(n), intent(inout)  v,
real*8, dimension(m), intent(out)  w,
logical, intent(out)  sing 
)

Definition at line 6459 of file CALLING_cpHTO.f.

6459 *
6460  INTEGER, INTENT(IN) :: m
6461  INTEGER, INTENT(IN) :: n
6462  INTEGER, INTENT(IN) :: ls
6463  real*8, INTENT(IN OUT) :: s(ls)
6464  real*8, INTENT(IN) :: u(m)
6465  real*8, INTENT(IN OUT) :: v(n)
6466  real*8, INTENT(OUT) :: w(m)
6467  LOGICAL, INTENT(OUT) :: sing
6468 
6469 ! **********
6470 
6471 ! SUBROUTINE HTO_R1UPDT
6472 
6473 ! GIVEN AN M BY N LOWER TRAPEZOIDAL MATRIX S, AN M-VECTOR U,
6474 ! AND AN N-VECTOR V, THE PROBLEM IS TO DETERMINE AN
6475 ! ORTHOGONAL MATRIX Q SUCH THAT
6476 
6477 ! T
6478 ! (S + U*V )*Q
6479 
6480 ! IS AGAIN LOWER TRAPEZOIDAL.
6481 
6482 ! THIS SUBROUTINE HTO_DETERMINES Q AS THE PRODUCT OF 2*(N - 1) TRANSFORMATIONS
6483 
6484 ! GV(N-1)*...*GV(1)*GW(1)*...*GW(N-1)
6485 
6486 ! WHERE GV(I), GW(I) ARE GIVENS ROTATIONS IN THE (I,N) PLANE
6487 ! WHICH ELIMINATE ELEMENTS IN THE I-TH AND N-TH PLANES, RESPECTIVELY.
6488 ! Q ITSELF IS NOT ACCUMULATED, RATHER THE INFORMATION TO RECOVER THE GV,
6489 ! GW ROTATIONS IS RETURNED.
6490 
6491 ! THE SUBROUTINE HTO_STATEMENT IS
6492 
6493 ! SUBROUTINE HTO_R1UPDT(M,N,S,LS,U,V,W,SING)
6494 
6495 ! WHERE
6496 
6497 ! M IS A POSITIVE INTEGER INPUT VARIABLE SET TO THE NUMBER OF ROWS OF S.
6498 
6499 ! N IS A POSITIVE INTEGER INPUT VARIABLE SET TO THE NUMBER
6500 ! OF COLUMNS OF S. N MUST NOT EXCEED M.
6501 
6502 ! S IS AN ARRAY OF LENGTH LS. ON INPUT S MUST CONTAIN THE LOWER
6503 ! TRAPEZOIDAL MATRIX S STORED BY COLUMNS. ON OUTPUT S CONTAINS
6504 ! THE LOWER TRAPEZOIDAL MATRIX PRODUCED AS DESCRIBED ABOVE.
6505 
6506 ! LS IS A POSITIVE INTEGER INPUT VARIABLE NOT LESS THAN
6507 ! (N*(2*M-N+1))/2.
6508 
6509 ! U IS AN INPUT ARRAY OF LENGTH M WHICH MUST CONTAIN THE VECTOR U.
6510 
6511 ! V IS AN ARRAY OF LENGTH N. ON INPUT V MUST CONTAIN THE VECTOR V.
6512 ! ON OUTPUT V(I) CONTAINS THE INFORMATION NECESSARY TO
6513 ! RECOVER THE GIVENS ROTATION GV(I) DESCRIBED ABOVE.
6514 
6515 ! W IS AN OUTPUT ARRAY OF LENGTH M. W(I) CONTAINS INFORMATION
6516 ! NECESSARY TO RECOVER THE GIVENS ROTATION GW(I) DESCRIBED ABOVE.
6517 
6518 ! SING IS A LOGICAL OUTPUT VARIABLE. SING IS SET TRUE IF ANY OF THE
6519 ! DIAGONAL ELEMENTS OF THE OUTPUT S ARE ZERO. OTHERWISE SING IS
6520 ! SET FALSE.
6521 
6522 ! SUBPROGRAMS CALLED
6523 
6524 ! MINPACK-SUPPLIED ... SPMPAR
6525 
6526 ! FORTRAN-SUPPLIED ... ABS,SQRT
6527 
6528 ! ARGONNE NATIONAL LABORATORY. MINPACK PROJECT. MARCH 1980.
6529 ! BURTON S. GARBOW, KENNETH E. HILLSTROM, JORGE J. MORE, JOHN L. NAZARETH
6530 
6531 ! **********
6532 
6533  INTEGER :: i,j,jj,l,nmj,nm1
6534  real*8 :: cos,cotan,giant,sin,tan,tau,temp
6535  real*8, PARAMETER :: one= 1.0d0,p5= 0.5d0,p25= 0.25d0,zero= 0.0d0
6536 *
6537  giant= huge(1.0d0)
6538  jj= (n*(2*m-n+1))/2-(m-n)
6539  l= jj
6540  DO i= n,m
6541  w(i)= s(l)
6542  l= l+1
6543  ENDDO
6544  nm1= n-1
6545  IF(nm1 >= 1) THEN
6546  DO nmj= 1,nm1
6547  j= n-nmj
6548  jj= jj-(m-j+1)
6549  w(j)= zero
6550  IF(v(j) /= zero) THEN
6551  IF(abs(v(n)) < abs(v(j))) THEN
6552  cotan= v(n)/v(j)
6553  sin= p5/sqrt(p25+p25*cotan**2)
6554  cos= sin*cotan
6555  tau= one
6556  IF(abs(cos)*giant > one) tau= one/cos
6557  ELSE
6558  tan= v(j)/v(n)
6559  cos= p5/sqrt(p25+p25*tan**2)
6560  sin= cos*tan
6561  tau= sin
6562  ENDIF
6563  v(n)= sin*v(j)+cos*v(n)
6564  v(j)= tau
6565  l= jj
6566  DO i= j,m
6567  temp= cos*s(l)-sin*w(i)
6568  w(i)= sin*s(l)+cos*w(i)
6569  s(l)= temp
6570  l= l+1
6571  ENDDO
6572  ENDIF
6573  ENDDO
6574  ENDIF
6575  DO i= 1,m
6576  w(i)= w(i)+v(n)*u(i)
6577  ENDDO
6578  sing= .false.
6579  IF(nm1 >= 1) THEN
6580  DO j= 1,nm1
6581  IF(w(j) /= zero) THEN
6582  IF(abs(s(jj)) < abs(w(j))) THEN
6583  cotan= s(jj)/w(j)
6584  sin= p5/sqrt(p25+p25*cotan**2)
6585  cos= sin*cotan
6586  tau= one
6587  IF(abs(cos)*giant > one) tau= one/cos
6588  ELSE
6589  tan= w(j)/s(jj)
6590  cos= p5/sqrt(p25+p25*tan**2)
6591  sin= cos*tan
6592  tau= sin
6593  ENDIF
6594  l= jj
6595  DO i= j,m
6596  temp= cos*s(l)+sin*w(i)
6597  w(i)= -sin*s(l)+cos*w(i)
6598  s(l)= temp
6599  l= l+1
6600  ENDDO
6601  w(j)= tau
6602  ENDIF
6603  IF(s(jj) == zero) sing= .true.
6604  jj= jj+(m-j+1)
6605  ENDDO
6606  ENDIF
6607  l= jj
6608  DO i= n,m
6609  s(l)= w(i)
6610  l= l+1
6611  ENDDO
6612  IF(s(jj) == zero) sing= .true.
6613 *
6614  RETURN
6615 *
hto_units::one
real *8, parameter one
Definition: CALLING_cpHTO.f:184
hto_units::eps
real *8, parameter eps
Definition: CALLING_cpHTO.f:183
hto_units::zero
real *8, parameter zero
Definition: CALLING_cpHTO.f:185