亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dtron.f90

?? 牛頓優化算法源fortran代碼
?? F90
?? 第 1 頁 / 共 5 頁
字號:
MODULE tron

! ************************************************************************* !
!                                                                           !
!            COPYRIGHT NOTIFICATION                                         !
!                                                                           !
! This program discloses material protectable under copyright laws of       !
! the United States. Permission to copy and modify this software and its    !
! documentation for internal research use is hereby granted, provided       !
! that this notice is retained thereon and on all copies or modifications.  !
! The University of Chicago makes no representations as to the suitability  !
! and operability of this software for any purpose.                         !
! It is provided "as is" without express or implied warranty.               !
!                                                                           !
! Use of this software for commercial purposes is expressly prohibited      !
! without contacting                                                        !
!                                                                           !
!    Jorge J. More'                                                         !
!    Mathematics and Computer Science Division                              !
!    Argonne National Laboratory                                            !
!    9700 S. Cass Ave.                                                      !
!    Argonne, Illinois 60439-4844                                           !
!    e-mail: more@mcs.anl.gov                                               !
!                                                                           !
! Argonne National Laboratory with facilities in the states of              !
! Illinois and Idaho, is owned by The United States Government, and         !
! operated by the University of Chicago under provision of a contract       !
! with the Department of Energy.                                            !
!                                                                           !
! ************************************************************************* !
!                                                                           !
!            ADDITIONAL INFORMATION                                         !
!                                                                           !
! Chih-Jen Lin and Jorge J. More',                                          !
! Newton's method for large bound-constrained optimization problems,        !
! Argonne National Laboratory,                                              !
! Mathematics and Computer Science Division,                                !
! Preprint ANL/MCS-P724-0898,                                               !
! August 1998 (Revised March 1999).                                         !
!                                                                           !
! http://www.mcs.anl.gov/~more/papers/tron.ps.gz                            !
!                                                                           !
! The Fortran 77 code can be downloaded from:                               !
!                                                                           !
! http://www-unix.mcs.anl.gov/~more/tron                                    !
!                                                                           !
! ************************************************************************* !
!                                                                           !
! Last modification (Fortran 77 version): April 29, 1999                    !


IMPLICIT NONE
INTEGER, PARAMETER                     :: dp = SELECTED_REAL_KIND(14, 60)
REAL (dp), PARAMETER, PRIVATE          :: zero = 0.0_dp, one = 1.0_dp
REAL (dp), ALLOCATABLE, SAVE, PRIVATE  :: xc(:), s(:), dsave(:), wa(:)
INTEGER, ALLOCATABLE, SAVE, PRIVATE    :: indfree(:), isave(:)

CONTAINS


SUBROUTINE dtron(n, x, xl, xu, f, g, a, adiag, acol_ptr, arow_ind,  &
                 frtol, fatol, fmin, cgtol, itermax, delta, task,  &
                 b, bdiag, bcol_ptr, brow_ind,   &
                 l, ldiag, lcol_ptr, lrow_ind, iterscg)
 
! Code converted using TO_F90 by Alan Miller
! Date: 1999-06-29  Time: 11:18:32
! Latest revision - 5 July 1999

INTEGER, INTENT(IN)        :: n
REAL (dp), INTENT(IN OUT)  :: x(:)
REAL (dp), INTENT(IN)      :: xl(:)
REAL (dp), INTENT(IN)      :: xu(:)
REAL (dp), INTENT(IN OUT)  :: f
REAL (dp), INTENT(IN)      :: g(:)
REAL (dp), INTENT(IN)      :: a(:)
REAL (dp), INTENT(IN)      :: adiag(:)
INTEGER, INTENT(IN)        :: acol_ptr(:)    ! acol_ptr(n+1)
INTEGER, INTENT(IN)        :: arow_ind(:)
REAL (dp), INTENT(IN)      :: frtol
REAL (dp), INTENT(IN)      :: fatol
REAL (dp), INTENT(IN)      :: fmin
REAL (dp), INTENT(IN)      :: cgtol
INTEGER, INTENT(IN)        :: itermax
REAL (dp), INTENT(IN OUT)  :: delta
CHARACTER (LEN=*), INTENT(IN OUT) :: task
REAL (dp), INTENT(OUT)     :: b(:)
REAL (dp), INTENT(OUT)     :: bdiag(:)
INTEGER, INTENT(OUT)       :: bcol_ptr(:)    ! bcol_ptr(n+1)
INTEGER, INTENT(OUT)       :: brow_ind(:)
REAL (dp), INTENT(OUT)     :: l(:)
REAL (dp), INTENT(OUT)     :: ldiag(:)
INTEGER, INTENT(OUT)       :: lcol_ptr(:)    ! lcol_ptr(n+1)
INTEGER, INTENT(OUT)       :: lrow_ind(:)
INTEGER, INTENT(OUT)       :: iterscg

!  *********

!  Subroutine dtron

!  This subroutine implements a trust region Newton method for the
!  solution of large bound-constrained optimization problems

!        min { f(x) : xl <= x <= xu }

!  where the Hessian matrix is sparse. The user must evaluate the
!  function, gradient, and the Hessian matrix.

!  This subroutine uses reverse communication.
!  The user must choose an initial approximation x to the minimizer,
!  and make an initial call with task set to 'START'.
!  On exit task indicates the required action.

!  A typical invocation has the following outline:

!  Compute a starting vector x.
!  Compute the sparsity pattern of the Hessian matrix and
!  store in compressed column storage in (acol_ptr,arow_ind).

!  task = 'START'
!  do while (search)

!     if (task .eq. 'F' .or. task .eq. 'START') then
!        Evaluate the function at x and store in f.
!     end if
!     if (task .eq. 'GH' .or. task .eq. 'START') then
!        Evaluate the gradient at x and store in g.
!        Evaluate the Hessian at x and store in compressed
!        column storage in (a, adiag, acol_ptr, arow_ind)
!     end if

!     call dtron(n, x, xl, xu, f, g, a, adiag, acol_ptr, arow_ind,
!                frtol, fatol, fmin, cgtol, itermax, delta, task,
!                b, bdiag, bcol_ptr, brow_ind,
!                l, ldiag, lcol_ptr, lrow_ind, iterscg)

!     if (task(1:4) .eq. 'CONV') search = .false.

!   end do

!  NOTE: The user must not alter work arrays between calls.

!  The subroutine statement is

!    subroutine dtron(n, x, xl, xu, f, g, a, adiag, acol_ptr, arow_ind,
!                     frtol, fatol, fmin, cgtol, itermax, delta, task,
!                     b, bdiag, bcol_ptr, brow_ind,
!                     l, ldiag, lcol_ptr, lrow_ind, isave)

!  where

!    n is an integer variable.
!      On entry n is the number of variables.
!      On exit n is unchanged.

!    x is a REAL (dp) array of dimension n.
!      On entry x specifies the vector x.
!      On exit x is the final minimizer.

!    xl is a REAL (dp) array of dimension n.
!      On entry xl is the vector of lower bounds.
!      On exit xl is unchanged.

!    xu is a REAL (dp) array of dimension n.
!      On entry xu is the vector of upper bounds.
!      On exit xu is unchanged.

!    f is a REAL (dp) variable.
!      On entry f must contain the function at x.
!      On exit f is unchanged.   This is NOT true.

!    g is a REAL (dp) array of dimension n.
!      On entry g must contain the gradient at x.
!      On exit g is unchanged.

!    a is a REAL (dp) array of dimension nnz.
!      On entry a must contain the strict lower triangular part
!         of A in compressed column storage.
!      On exit a is unchanged.

!    adiag is a REAL (dp) array of dimension n.
!      On entry adiag must contain the diagonal elements of A.
!      On exit adiag is unchanged.

!    acol_ptr is an integer array of dimension n + 1.
!      On entry acol_ptr must contain pointers to the columns of A.
!         The nonzeros in column j of A must be in positions
!         acol_ptr(j), ... , acol_ptr(j+1) - 1.
!      On exit acol_ptr is unchanged.

!    arow_ind is an integer array of dimension nnz.
!      On entry arow_ind must contain row indices for the strict
!         lower triangular part of A in compressed column storage.
!      On exit arow_ind is unchanged.

!    frtol is a REAL (dp) variable.
!      On entry frtol specifies the relative error desired in the function.
!         Convergence occurs if the estimate of the relative error between f(x)
!         and f(xsol), where xsol is a local minimizer, is less than frtol.
!      On exit frtol is unchanged.

!    fatol is a REAL (dp) variable.
!      On entry fatol specifies the absolute error desired in the function.
!         Convergence occurs if the estimate of the absolute error between f(x)
!         and f(xsol), where xsol is a local minimizer, is less than fatol.
!      On exit fatol is unchanged.

!    fmin is a REAL (dp) variable.
!      On entry fmin specifies a lower bound for the function.
!         The subroutine exits with a warning if f < fmin.
!      On exit fmin is unchanged.

!    cgtol is a REAL (dp) variable.
!      On entry cgtol specifies the convergence criteria for
!         the conjugate gradient method.
!      On exit cgtol is unchanged.

!    itermax is an integer variable.
!      On entry itermax specifies the limit on the number of
!         conjugate gradient iterations.
!      On exit itermax is unchanged.

!    delta is a REAL (dp) variable.
!      On entry delta is the trust region bound.
!      On exit delta is unchanged.  This is NOT true.

!    task is a character variable of length at least 60.
!      On initial entry task must be set to 'START'.
!      On exit task indicates the required action:

!         If task(1:1) = 'F' then evaluate the function at x.

!         If task(1:2) = 'GH' then evaluate the gradient and the
!         Hessian matrix at x.

!         If task(1:4) = 'CONV' then the search is successful.

!         If task(1:4) = 'WARN' then the subroutine is not able
!         to satisfy the convergence conditions. The exit value
!         of x contains the best approximation found.

!    bdiag is a REAL (dp) array of dimension n.
!      On entry bdiag need not be specified.
!      On exit bdiag contains the diagonal elements of B.

!    bcol_ptr is an integer array of dimension n + 1.
!      On entry bcol_ptr need not be specified
!      On exit bcol_ptr contains pointers to the columns of B.
!         The nonzeros in column j of B are in the
!         bcol_ptr(j), ... , bcol_ptr(j+1) - 1 positions of b.

!    brow_ind is an integer array of dimension nnz.
!      On entry brow_ind need not be specified.
!      On exit brow_ind contains row indices for the strict lower
!         triangular part of B in compressed column storage.

!    l is a REAL (dp) array of dimension nnz + n*p.
!      On entry l need not be specified.
!      On exit l contains the strict lower triangular part
!         of L in compressed column storage.

!    ldiag is a REAL (dp) array of dimension n.
!      On entry ldiag need not be specified.
!      On exit ldiag contains the diagonal elements of L.

!    lcol_ptr is an integer array of dimension n + 1.
!      On entry lcol_ptr need not be specified.
!      On exit lcol_ptr contains pointers to the columns of L.
!         The nonzeros in column j of L are in the
!         lcol_ptr(j), ... , lcol_ptr(j+1) - 1 positions of l.

!    lrow_ind is an integer array of dimension nnz + n*p.
!      On entry lrow_ind need not be specified.
!      On exit lrow_ind contains row indices for the strict lower
!         triangular part of L in compressed column storage.

!  Subprograms called

!    MINPACK-2  ......  dcauchy, dspcg, dssyax

!    Level 1 BLAS  ...  dcopy

!  MINPACK-2 Project. May 1999.
!  Argonne National Laboratory.
!  Chih-Jen Lin and Jorge J. More'.

!  **********

REAL (dp), PARAMETER :: p5=0.5_dp

!     Parameters for updating the iterates.

REAL (dp), PARAMETER :: eta0=1D-4, eta1=0.25_dp, eta2=0.75_dp

!     Parameters for updating the trust region size delta.

REAL (dp), PARAMETER :: sigma1=0.25_dp, sigma2=0.5_dp, sigma3=4.0_dp

LOGICAL   :: search
INTEGER   :: info, iter, iters
REAL (dp) :: alphac, fc, prered, actred, snorm, gs, alpha
CHARACTER (LEN=60) :: work

! REAL (dp) :: ddot, dnrm2
! EXTERNAL dcauchy, dspcg, dssyax
! EXTERNAL dcopy, ddot, dnrm2

!     Initialization section.

IF (task(1:5) == 'START') THEN
  
!        Initialize local variables.
  
  iter = 1
  iterscg = 0
  alphac = one
  work = 'COMPUTE'
  IF (ALLOCATED(xc)) DEALLOCATE( xc, s, indfree, dsave, wa, isave )
  ALLOCATE( xc(n), s(n), indfree(n), dsave(n), wa(n), isave(n) )
  
ELSE
  
!        Restore local variables.
  
  IF (isave(1) == 1) THEN
    work = 'COMPUTE'
  ELSE IF (isave(1) == 2) THEN
    work = 'EVALUATE'
  END IF
  iter = isave(2)
  iterscg = isave(3)
  fc = dsave(1)
  alphac = dsave(2)
END IF

!     Search for a lower function value.

search = .true.
DO WHILE (search)
  
!        Compute a step and evaluate the function at the trial point.
  
  IF (work == 'COMPUTE') THEN
    
!           Save the best function value and the best x.
    
    fc = f
    xc(1:n) = x(1:n)
    
!           Compute the Cauchy step and store in s.
    
    CALL dcauchy(n, x, xl, xu, a, adiag, acol_ptr, arow_ind, g, delta,  &
                 alphac, s)
    
!           Compute the projected Newton step.
    
    CALL dspcg(n, x, xl, xu, a, adiag, acol_ptr, arow_ind, g, delta,  &
               cgtol, s, 5, itermax, iters, info, b, bdiag, bcol_ptr, brow_ind,  &
               l, ldiag, lcol_ptr, lrow_ind)
    
    iterscg = iterscg + iters
    task = 'F'
  END IF
  
!        Evaluate the step and determine if the step is successful.
  
  IF (work == 'EVALUATE') THEN
    
!           Compute the predicted reduction.
    
    CALL dssyax(n, a, adiag, acol_ptr, arow_ind, s, wa)
    prered = DOT_PRODUCT( s(1:n), p5*wa(1:n) - g(1:n) )
    
!           Compute the actual reduction.
    
    actred =  fc - f
    
!           On the first iteration, adjust the initial step bound.
    
    snorm = dnrm2(n, s, 1)
    IF (iter == 1)  delta = MIN(delta, snorm)
    
!           Compute prediction alpha*snorm of the step.
    
    gs = DOT_PRODUCT( g(1:n), s(1:n) )
    IF (f-fc-gs <= zero) THEN
      alpha = sigma3
    ELSE
      alpha = MAX(sigma1, -p5*(gs/(f-fc-gs)))
    END IF
    
!           Update the trust region bound according to the ratio
!           of actual to predicted reduction.
    
    IF (actred < eta0*prered) THEN
      
!              Reduce delta.  Step is not successful.
      
      delta = MIN(MAX(alpha, sigma1)*snorm, sigma2*delta)
      
    ELSE IF (actred < eta1*prered) THEN
      
!              Reduce delta.  Step is not sufficiently successful.
      
      delta = MAX(sigma1*delta, MIN(alpha*snorm, sigma2*delta))
      
    ELSE IF (actred < eta2*prered) THEN
      
!              The ratio of actual to predicted reduction is in
!              the interval (eta1, eta2).  We are allowed to either
!              increase or decrease delta.
      
      delta = MAX(sigma1*delta, MIN(alpha*snorm, sigma3*delta))
      
    ELSE
      
!              The ratio of actual to predicted reduction exceeds eta2.
!              Do not decrease delta.
      
      delta = MAX(delta, MIN(alpha*snorm, sigma3*delta))
      
    END IF
    
!           Update the iterate.
    
    IF (actred > eta0*prered) THEN
      
!              Successful iterate.
      
      task = 'GH'
      iter = iter + 1
      
    ELSE

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99精品久久久| fc2成人免费人成在线观看播放| 欧美视频日韩视频| 欧美日韩黄色一区二区| 欧美日韩高清一区二区不卡| 欧美日韩黄视频| 久久夜色精品国产噜噜av| 久久精品人人做人人爽人人| 欧美日韩综合在线免费观看| 色诱亚洲精品久久久久久| 伊人婷婷欧美激情| 欧美高清一级片在线| 蜜桃一区二区三区四区| 国产亚洲精品福利| 色综合色综合色综合 | 懂色av一区二区三区免费观看| 国产精品网站一区| 欧美亚洲综合一区| 韩国精品一区二区| 亚洲女与黑人做爰| 日韩一级精品视频在线观看| 国产v综合v亚洲欧| 亚洲午夜免费视频| 国产亚洲制服色| 在线视频欧美区| 韩国v欧美v日本v亚洲v| |精品福利一区二区三区| 欧美高清性hdvideosex| 国产精品一区二区在线播放| 亚洲制服丝袜av| 欧美高清在线精品一区| 欧美日韩国产美| 成人精品一区二区三区四区| 五月天欧美精品| 国产精品亲子伦对白| 欧美一级欧美三级在线观看 | av电影在线观看不卡| 午夜精品久久久久久| 国产精品视频一二三| 日韩一区二区三区电影| 91丝袜美女网| 国产精品一二三| 日韩va亚洲va欧美va久久| 国产精品久久久久aaaa| 精品国产一区二区三区久久久蜜月| 色综合中文综合网| 99re亚洲国产精品| 蜜臀va亚洲va欧美va天堂| 亚洲视频一区二区在线| 精品久久五月天| 欧美日韩精品二区第二页| 成人h动漫精品一区二| 激情都市一区二区| 天堂成人国产精品一区| 一区二区三区不卡视频在线观看| 国产婷婷一区二区| 欧美电视剧在线看免费| 欧美日韩高清一区二区三区| 日本道在线观看一区二区| voyeur盗摄精品| 国产一区三区三区| 激情亚洲综合在线| 日韩av一区二区三区四区| 亚洲成人福利片| 洋洋成人永久网站入口| 亚洲在线视频一区| 亚洲免费电影在线| 亚洲女人的天堂| 亚洲日本在线看| 国产精品色噜噜| 中文一区一区三区高中清不卡| 亚洲精品一线二线三线| 精品久久一区二区| 久久婷婷色综合| 久久蜜桃av一区精品变态类天堂 | 一区二区三区四区蜜桃| 最新高清无码专区| 亚洲欧美另类图片小说| 一区二区三区在线视频观看58| 亚洲日本va午夜在线影院| 亚洲女人的天堂| 亚洲成人av电影| 日本欧美一区二区三区乱码| 日本特黄久久久高潮| 捆绑调教美女网站视频一区| 捆绑调教美女网站视频一区| 国产精品综合在线视频| 岛国一区二区在线观看| 91蝌蚪porny| 欧美人动与zoxxxx乱| 欧美一区国产二区| 久久久久久久精| 国产精品成人免费在线| 亚洲精品中文字幕在线观看| 亚洲成人7777| 国产精品一级在线| 99re热视频这里只精品| 欧美日韩一级视频| 精品美女在线播放| 国产精品灌醉下药二区| 亚洲高清三级视频| 国内精品伊人久久久久av一坑| 国产成+人+日韩+欧美+亚洲| 色综合久久88色综合天天免费| 在线影院国内精品| 日韩欧美在线影院| 欧美国产成人精品| 亚洲成人一区二区在线观看| 国内偷窥港台综合视频在线播放| 成人国产免费视频| 精品视频999| 久久精品夜色噜噜亚洲a∨| 亚洲精品日产精品乱码不卡| 日本女优在线视频一区二区| 国产成人免费av在线| 在线观看网站黄不卡| 欧美mv日韩mv亚洲| 一区二区三区四区亚洲| 狠狠色丁香婷婷综合| 99视频在线观看一区三区| 欧美性大战久久久久久久蜜臀 | 91久久精品一区二区三区| 日韩欧美你懂的| 国产精品久久久久久妇女6080| 日韩制服丝袜av| 成人动漫中文字幕| 91精品久久久久久久99蜜桃| 国产精品三级在线观看| 日本中文字幕一区二区视频| 丁香婷婷综合色啪| 日韩午夜av一区| 一区二区三区电影在线播| 国产成人av资源| 日韩天堂在线观看| 亚洲高清视频在线| 91网站在线观看视频| 欧美经典一区二区| 日韩国产精品久久| 在线视频国内自拍亚洲视频| 久久精品综合网| 日本va欧美va精品发布| 日本丶国产丶欧美色综合| 中文字幕精品在线不卡| 韩国三级中文字幕hd久久精品| 在线不卡的av| 亚洲一区二区三区国产| 成人app在线观看| 国产女主播一区| 国产福利91精品| 精品国产精品一区二区夜夜嗨| 五月天久久比比资源色| 欧美日韩国产免费| 午夜视频在线观看一区二区三区| 色哟哟在线观看一区二区三区| 国产精品毛片久久久久久| 国产成人av电影在线观看| 久久综合九色综合97婷婷| 捆绑紧缚一区二区三区视频 | 一本一道久久a久久精品综合蜜臀| 久久丝袜美腿综合| 国产一区二区三区免费看| 欧美一区二区三区男人的天堂| 亚洲电影一级片| 欧美日韩国产成人在线免费| 亚洲午夜精品久久久久久久久| 一本一道综合狠狠老| 艳妇臀荡乳欲伦亚洲一区| 在线观看日韩一区| 一区二区三区小说| 欧美三片在线视频观看| 亚洲.国产.中文慕字在线| 精品污污网站免费看| 亚洲二区视频在线| 欧美一区二区视频观看视频| 青青草一区二区三区| 欧美成人a在线| 国产在线国偷精品免费看| 国产欧美日韩激情| 成a人片国产精品| 亚洲综合区在线| 欧美一区二区三区四区五区| 久久99精品国产麻豆不卡| 久久久精品国产免大香伊| 国产91丝袜在线观看| 亚洲图片另类小说| 欧美日韩国产乱码电影| 美女视频网站黄色亚洲| 国产午夜精品理论片a级大结局 | 亚洲自拍都市欧美小说| 欧美精品vⅰdeose4hd| 久草精品在线观看| 国产精品久久久久一区| 欧美亚洲免费在线一区| 美国十次了思思久久精品导航| 久久久无码精品亚洲日韩按摩| 99久久精品国产精品久久| 天天射综合影视| 国产欧美一区二区精品性| 欧美亚州韩日在线看免费版国语版| 欧美aaaaaa午夜精品|