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

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

?? lm.f90

?? 開發的lm算法,很有用的一種優化算法. 對非線性優化有很大用處
?? F90
?? 第 1 頁 / 共 5 頁
字號:
MODULE Levenberg_Marquardt
! MINPACK routines which are used by both LMDIF & LMDER
! 25 October 2001:
!    Changed INTENT of iflag in several places to IN OUT.
!    Changed INTENT of fvec to IN OUT in user routine FCN.
!    Removed arguments diag and qtv from LMDIF & LMDER.
!    Replaced several DO loops with array operations.
! amiller @ bigpond.net.au

IMPLICIT NONE
INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(12, 60)

PRIVATE
PUBLIC :: dp, lmdif1, lmdif, lmder1, lmder, enorm

CONTAINS


SUBROUTINE lmdif1(fcn, m, n, x, fvec, tol, info, iwa)
 
! Code converted using TO_F90 by Alan Miller
! Date: 1999-12-11  Time: 00:51:44

! N.B. Arguments WA & LWA have been removed.

INTEGER, INTENT(IN)        :: m
INTEGER, INTENT(IN)        :: n
REAL (dp), INTENT(IN OUT)  :: x(:)
REAL (dp), INTENT(OUT)     :: fvec(:)
REAL (dp), INTENT(IN)      :: tol
INTEGER, INTENT(OUT)       :: info
INTEGER, INTENT(OUT)       :: iwa(:)

! EXTERNAL fcn

INTERFACE
  SUBROUTINE fcn(m, n, x, fvec, iflag)
    IMPLICIT NONE
    INTEGER, PARAMETER         :: dp = SELECTED_REAL_KIND(12, 60)
    INTEGER, INTENT(IN)        :: m, n
    REAL (dp), INTENT(IN)      :: x(:)
    REAL (dp), INTENT(IN OUT)  :: fvec(:)
    INTEGER, INTENT(IN OUT)    :: iflag
  END SUBROUTINE fcn
END INTERFACE

!  **********

!  subroutine lmdif1

!  The purpose of lmdif1 is to minimize the sum of the squares of m nonlinear
!  functions in n variables by a modification of the Levenberg-Marquardt
!  algorithm.  This is done by using the more general least-squares
!  solver lmdif.  The user must provide a subroutine which calculates the
!  functions.  The jacobian is then calculated by a forward-difference
!  approximation.

!  the subroutine statement is

!    subroutine lmdif1(fcn, m, n, x, fvec, tol, info, iwa)

!  where

!    fcn is the name of the user-supplied subroutine which calculates
!      the functions.  fcn must be declared in an external statement in the
!      user calling program, and should be written as follows.

!      subroutine fcn(m, n, x, fvec, iflag)
!      integer m, n, iflag
!      REAL (dp) x(n), fvec(m)
!      ----------
!      calculate the functions at x and return this vector in fvec.
!      ----------
!      return
!      end

!      the value of iflag should not be changed by fcn unless
!      the user wants to terminate execution of lmdif1.
!      In this case set iflag to a negative integer.

!    m is a positive integer input variable set to the number of functions.

!    n is a positive integer input variable set to the number of variables.
!      n must not exceed m.

!    x is an array of length n.  On input x must contain an initial estimate
!      of the solution vector.  On output x contains the final estimate of
!      the solution vector.

!    fvec is an output array of length m which contains
!      the functions evaluated at the output x.

!    tol is a nonnegative input variable.  Termination occurs when the
!      algorithm estimates either that the relative error in the sum of
!      squares is at most tol or that the relative error between x and the
!      solution is at most tol.

!    info is an integer output variable.  If the user has terminated execution,
!      info is set to the (negative) value of iflag.  See description of fcn.
!      Otherwise, info is set as follows.

!      info = 0  improper input parameters.

!      info = 1  algorithm estimates that the relative error
!                in the sum of squares is at most tol.

!      info = 2  algorithm estimates that the relative error
!                between x and the solution is at most tol.

!      info = 3  conditions for info = 1 and info = 2 both hold.

!      info = 4  fvec is orthogonal to the columns of the
!                jacobian to machine precision.

!      info = 5  number of calls to fcn has reached or exceeded 200*(n+1).

!      info = 6  tol is too small. no further reduction in
!                the sum of squares is possible.

!      info = 7  tol is too small.  No further improvement in
!                the approximate solution x is possible.

!    iwa is an integer work array of length n.

!    wa is a work array of length lwa.

!    lwa is a positive integer input variable not less than m*n+5*n+m.

!  subprograms called

!    user-supplied ...... fcn

!    minpack-supplied ... lmdif

!  argonne national laboratory. minpack project. march 1980.
!  burton s. garbow, kenneth e. hillstrom, jorge j. more

!  **********
INTEGER   :: maxfev, mode, nfev, nprint
REAL (dp) :: epsfcn, ftol, gtol, xtol, fjac(m,n)
REAL (dp), PARAMETER :: factor = 100._dp, zero = 0.0_dp

info = 0

!     check the input parameters for errors.

IF (n <= 0 .OR. m < n .OR. tol < zero) GO TO 10

!     call lmdif.

maxfev = 200*(n + 1)
ftol = tol
xtol = tol
gtol = zero
epsfcn = zero
mode = 1
nprint = 0
CALL lmdif(fcn, m, n, x, fvec, ftol, xtol, gtol, maxfev, epsfcn,   &
           mode, factor, nprint, info, nfev, fjac, iwa)
IF (info == 8) info = 4

10 RETURN

!     last card of subroutine lmdif1.

END SUBROUTINE lmdif1



SUBROUTINE lmdif(fcn, m, n, x, fvec, ftol, xtol, gtol, maxfev, epsfcn,  &
                 mode, factor, nprint, info, nfev, fjac, ipvt)
 
! N.B. Arguments LDFJAC, DIAG, QTF, WA1, WA2, WA3 & WA4 have been removed.

INTEGER, INTENT(IN)        :: m
INTEGER, INTENT(IN)        :: n
REAL (dp), INTENT(IN OUT)  :: x(:)
REAL (dp), INTENT(OUT)     :: fvec(:)
REAL (dp), INTENT(IN)      :: ftol
REAL (dp), INTENT(IN)      :: xtol
REAL (dp), INTENT(IN OUT)  :: gtol
INTEGER, INTENT(IN OUT)    :: maxfev
REAL (dp), INTENT(IN OUT)  :: epsfcn
INTEGER, INTENT(IN)        :: mode
REAL (dp), INTENT(IN)      :: factor
INTEGER, INTENT(IN)        :: nprint
INTEGER, INTENT(OUT)       :: info
INTEGER, INTENT(OUT)       :: nfev
REAL (dp), INTENT(OUT)     :: fjac(:,:)    ! fjac(ldfjac,n)
INTEGER, INTENT(OUT)       :: ipvt(:)

! EXTERNAL fcn

INTERFACE
  SUBROUTINE fcn(m, n, x, fvec, iflag)
    IMPLICIT NONE
    INTEGER, PARAMETER         :: dp = SELECTED_REAL_KIND(12, 60)
    INTEGER, INTENT(IN)        :: m, n
    REAL (dp), INTENT(IN)      :: x(:)
    REAL (dp), INTENT(IN OUT)  :: fvec(:)
    INTEGER, INTENT(IN OUT)    :: iflag
  END SUBROUTINE fcn
END INTERFACE

!  **********

!  subroutine lmdif

!  The purpose of lmdif is to minimize the sum of the squares of m nonlinear
!  functions in n variables by a modification of the Levenberg-Marquardt
!  algorithm.  The user must provide a subroutine which calculates the
!  functions.  The jacobian is then calculated by a forward-difference
!  approximation.

!  the subroutine statement is

!    subroutine lmdif(fcn, m, n, x, fvec, ftol, xtol, gtol, maxfev, epsfcn,
!                     diag, mode, factor, nprint, info, nfev, fjac,
!                     ldfjac, ipvt, qtf, wa1, wa2, wa3, wa4)

! N.B. 7 of these arguments have been removed in this version.

!  where

!    fcn is the name of the user-supplied subroutine which calculates the
!      functions.  fcn must be declared in an external statement in the user
!      calling program, and should be written as follows.

!      subroutine fcn(m, n, x, fvec, iflag)
!      integer m, n, iflag
!      REAL (dp) x(:), fvec(m)
!      ----------
!      calculate the functions at x and return this vector in fvec.
!      ----------
!      return
!      end

!      the value of iflag should not be changed by fcn unless
!      the user wants to terminate execution of lmdif.
!      in this case set iflag to a negative integer.

!    m is a positive integer input variable set to the number of functions.

!    n is a positive integer input variable set to the number of variables.
!      n must not exceed m.

!    x is an array of length n.  On input x must contain an initial estimate
!      of the solution vector.  On output x contains the final estimate of the
!      solution vector.

!    fvec is an output array of length m which contains
!      the functions evaluated at the output x.

!    ftol is a nonnegative input variable.  Termination occurs when both the
!      actual and predicted relative reductions in the sum of squares are at
!      most ftol.  Therefore, ftol measures the relative error desired
!      in the sum of squares.

!    xtol is a nonnegative input variable.  Termination occurs when the
!      relative error between two consecutive iterates is at most xtol.
!      Therefore, xtol measures the relative error desired in the approximate
!      solution.

!    gtol is a nonnegative input variable.  Termination occurs when the cosine
!      of the angle between fvec and any column of the jacobian is at most
!      gtol in absolute value.  Therefore, gtol measures the orthogonality
!      desired between the function vector and the columns of the jacobian.

!    maxfev is a positive integer input variable.  Termination occurs when the
!      number of calls to fcn is at least maxfev by the end of an iteration.

!    epsfcn is an input variable used in determining a suitable step length
!      for the forward-difference approximation.  This approximation assumes
!      that the relative errors in the functions are of the order of epsfcn.
!      If epsfcn is less than the machine precision, it is assumed that the
!      relative errors in the functions are of the order of the machine
!      precision.

!    diag is an array of length n.  If mode = 1 (see below), diag is
!      internally set.  If mode = 2, diag must contain positive entries that
!      serve as multiplicative scale factors for the variables.

!    mode is an integer input variable.  If mode = 1, the variables will be
!      scaled internally.  If mode = 2, the scaling is specified by the input
!      diag. other values of mode are equivalent to mode = 1.

!    factor is a positive input variable used in determining the initial step
!      bound.  This bound is set to the product of factor and the euclidean
!      norm of diag*x if nonzero, or else to factor itself.  In most cases
!      factor should lie in the interval (.1,100.). 100. is a generally
!      recommended value.

!    nprint is an integer input variable that enables controlled printing of
!      iterates if it is positive.  In this case, fcn is called with iflag = 0
!      at the beginning of the first iteration and every nprint iterations
!      thereafter and immediately prior to return, with x and fvec available
!      for printing.  If nprint is not positive, no special calls
!      of fcn with iflag = 0 are made.

!    info is an integer output variable.  If the user has terminated
!      execution, info is set to the (negative) value of iflag.
!      See description of fcn.  Otherwise, info is set as follows.

!      info = 0  improper input parameters.

!      info = 1  both actual and predicted relative reductions
!                in the sum of squares are at most ftol.

!      info = 2  relative error between two consecutive iterates <= xtol.

!      info = 3  conditions for info = 1 and info = 2 both hold.

!      info = 4  the cosine of the angle between fvec and any column of
!                the Jacobian is at most gtol in absolute value.

!      info = 5  number of calls to fcn has reached or exceeded maxfev.

!      info = 6  ftol is too small. no further reduction in
!                the sum of squares is possible.

!      info = 7  xtol is too small. no further improvement in
!                the approximate solution x is possible.

!      info = 8  gtol is too small. fvec is orthogonal to the
!                columns of the jacobian to machine precision.

!    nfev is an integer output variable set to the number of calls to fcn.

!    fjac is an output m by n array. the upper n by n submatrix
!      of fjac contains an upper triangular matrix r with
!      diagonal elements of nonincreasing magnitude such that

!             t     t           t
!            p *(jac *jac)*p = r *r,

!      where p is a permutation matrix and jac is the final calculated
!      Jacobian.  Column j of p is column ipvt(j) (see below) of the
!      identity matrix. the lower trapezoidal part of fjac contains
!      information generated during the computation of r.

!    ldfjac is a positive integer input variable not less than m
!      which specifies the leading dimension of the array fjac.

!    ipvt is an integer output array of length n.  ipvt defines a permutation
!      matrix p such that jac*p = q*r, where jac is the final calculated
!      jacobian, q is orthogonal (not stored), and r is upper triangular
!      with diagonal elements of nonincreasing magnitude.
!      Column j of p is column ipvt(j) of the identity matrix.

!    qtf is an output array of length n which contains
!      the first n elements of the vector (q transpose)*fvec.

!    wa1, wa2, and wa3 are work arrays of length n.

!    wa4 is a work array of length m.

!  subprograms called

!    user-supplied ...... fcn

!    minpack-supplied ... dpmpar,enorm,fdjac2,lmpar,qrfac

!    fortran-supplied ... dabs,dmax1,dmin1,dsqrt,mod

!  argonne national laboratory. minpack project. march 1980.
!  burton s. garbow, kenneth e. hillstrom, jorge j. more

!  **********
INTEGER   :: i, iflag, iter, j, l
REAL (dp) :: actred, delta, dirder, epsmch, fnorm, fnorm1, gnorm,  &
             par, pnorm, prered, ratio, sum, temp, temp1, temp2, xnorm
REAL (dp) :: diag(n), qtf(n), wa1(n), wa2(n), wa3(n), wa4(m)
REAL (dp), PARAMETER :: one = 1.0_dp, p1 = 0.1_dp, p5 = 0.5_dp,  &
                        p25 = 0.25_dp, p75 = 0.75_dp, p0001 = 0.0001_dp, &
                        zero = 0.0_dp

!     epsmch is the machine precision.

epsmch = EPSILON(zero)

info = 0
iflag = 0
nfev = 0

!     check the input parameters for errors.

IF (n <= 0 .OR. m < n .OR. ftol < zero .OR. xtol < zero .OR. gtol < zero  &
    .OR. maxfev <= 0 .OR. factor <= zero) GO TO 300
IF (mode /= 2) GO TO 20
DO  j = 1, n
  IF (diag(j) <= zero) GO TO 300
END DO

!     evaluate the function at the starting point and calculate its norm.

20 iflag = 1
CALL fcn(m, n, x, fvec, iflag)
nfev = 1
IF (iflag < 0) GO TO 300
fnorm = enorm(m, fvec)

!     initialize levenberg-marquardt parameter and iteration counter.

par = zero
iter = 1

!     beginning of the outer loop.

!        calculate the jacobian matrix.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲人一二三区| 国产日韩欧美激情| 婷婷亚洲久悠悠色悠在线播放| 在线一区二区视频| 亚洲小说欧美激情另类| 91精品国产一区二区人妖| 免费成人在线观看视频| 欧美va日韩va| 丁香桃色午夜亚洲一区二区三区| 中文av一区特黄| 91久久奴性调教| 水野朝阳av一区二区三区| 日韩欧美一区在线| 成人禁用看黄a在线| 一区二区三区四区在线免费观看 | 91免费在线看| 亚洲成人动漫av| 久久久久久久综合狠狠综合| 99久久精品国产精品久久| 亚洲最新视频在线观看| 欧美成人bangbros| 成人深夜在线观看| 五月激情六月综合| 日本一区二区三区四区| 欧美色视频在线| 国产自产v一区二区三区c| 亚洲欧洲中文日韩久久av乱码| 欧美二区三区的天堂| 国产91精品一区二区麻豆亚洲| 亚洲精品国产精华液| 欧美精品一区二区在线播放| 色偷偷久久人人79超碰人人澡| 蜜臀久久久99精品久久久久久| 自拍偷拍亚洲欧美日韩| 日韩午夜在线观看| 色香蕉久久蜜桃| 国产激情视频一区二区在线观看| 亚洲福中文字幕伊人影院| 欧美经典一区二区| 欧美裸体一区二区三区| 不卡的看片网站| 激情五月婷婷综合网| 洋洋av久久久久久久一区| 国产欧美1区2区3区| 欧美一二区视频| 91九色最新地址| 成人黄色在线视频| 激情都市一区二区| 日本一道高清亚洲日美韩| 亚洲视频电影在线| 久久久不卡影院| 欧美不卡激情三级在线观看| 欧美视频在线不卡| 91丨porny丨户外露出| 国产一区二区三区久久久| 日韩 欧美一区二区三区| 亚洲另类春色国产| 国产精品第五页| 欧美激情综合网| 久久夜色精品国产噜噜av| 欧美一区二区播放| 欧美人牲a欧美精品| 在线观看av不卡| 91网上在线视频| 97精品电影院| www.在线成人| 99久久伊人网影院| 成人激情小说乱人伦| 成人国产精品免费观看视频| 国产精品一区二区在线观看网站 | 成人丝袜18视频在线观看| 国产一区二区三区黄视频| 精品一区二区免费在线观看| 麻豆成人久久精品二区三区红| 天天综合网天天综合色| 午夜精品视频一区| 日本欧洲一区二区| 青青草精品视频| 久国产精品韩国三级视频| 九九**精品视频免费播放| 国产资源在线一区| 国产suv精品一区二区6| 波多野结衣的一区二区三区| www.99精品| 在线观看av一区二区| 欧美日韩精品一区二区三区蜜桃 | 国产亚洲精品福利| 国产喷白浆一区二区三区| 中文字幕不卡一区| 亚洲视频一区二区在线观看| 亚洲小说春色综合另类电影| 日日欢夜夜爽一区| 久久99久久99| 成人h动漫精品一区二| 91美女片黄在线观看91美女| 欧美综合久久久| 欧美一区午夜精品| 久久久99精品免费观看| 国产精品美女www爽爽爽| 亚洲精品免费在线播放| 午夜精品123| 国产麻豆成人传媒免费观看| 成人一级片网址| 欧美色综合网站| 日韩美女视频在线| 国产精品短视频| 日韩精品福利网| 懂色av中文一区二区三区 | www.亚洲色图.com| 欧美日韩国产欧美日美国产精品| 日韩精品影音先锋| 国产精品欧美久久久久一区二区| 亚洲综合图片区| 韩日精品视频一区| 91福利小视频| 精品99一区二区三区| 亚洲黄色小说网站| 久久超碰97人人做人人爱| 99九九99九九九视频精品| 91精品啪在线观看国产60岁| 国产精品理论片在线观看| 天堂蜜桃一区二区三区| 成人av网站在线观看免费| 欧美日韩在线三区| 国产精品女上位| 美女视频网站黄色亚洲| 93久久精品日日躁夜夜躁欧美| 日韩午夜小视频| 亚洲激情男女视频| 国产成人免费av在线| 777亚洲妇女| 夜夜嗨av一区二区三区网页 | 欧美日韩综合一区| 欧美激情一区不卡| 九九九久久久精品| 8v天堂国产在线一区二区| 亚洲免费在线视频一区 二区| 精品亚洲国内自在自线福利| 欧美性一二三区| 中文字幕亚洲一区二区va在线| 轻轻草成人在线| 欧美裸体一区二区三区| 亚洲欧美另类久久久精品2019| 国产一区二区三区观看| 日韩一区二区电影| 亚洲国产成人91porn| 99综合影院在线| 亚洲国产成人自拍| 国产成人自拍在线| 久久这里都是精品| 美日韩黄色大片| 91精品在线观看入口| 亚洲国产成人av| 欧美色图激情小说| 亚洲国产一区二区三区青草影视 | 高清不卡在线观看av| 日韩精品一区二区三区中文精品| 亚洲电影你懂得| 欧美私人免费视频| 亚洲一区二区三区美女| 色婷婷精品久久二区二区蜜臀av| 亚洲视频在线一区| 色欧美88888久久久久久影院| 中文字幕制服丝袜一区二区三区 | 色一区在线观看| 亚洲欧美国产三级| 91丝袜美腿高跟国产极品老师 | 制服丝袜国产精品| 天堂av在线一区| 91精品国产综合久久精品图片| 午夜视频久久久久久| 欧美欧美欧美欧美首页| 午夜av电影一区| 欧美不卡视频一区| 国产成人夜色高潮福利影视| 中文字幕电影一区| 99国产精品久久久久| 一区二区三区欧美| 欧美美女一区二区三区| 久久精品久久综合| 久久久精品国产免大香伊 | 国产美女在线精品| 国产欧美一区二区精品久导航 | 一区二区三区在线影院| 欧美午夜不卡视频| 日本大胆欧美人术艺术动态| 国产精品毛片a∨一区二区三区| 国产精品一区二区三区网站| 日本一区二区三区四区在线视频| 91亚洲精华国产精华精华液| 一区二区久久久久久| 91麻豆精品国产| 国产成人av电影在线| 亚洲黄色免费电影| 欧美成人免费网站| 成人av手机在线观看| 天天做天天摸天天爽国产一区| 久久久久99精品国产片| 99久久婷婷国产综合精品| 婷婷久久综合九色国产成人|