minpack Module

A fortran collection of functions for minimization problems

Note

MINPACK is a FORTRAN90 library which solves systems of nonlinear equations, or carries out the least squares minimization of the residual of a set of linear or nonlinear equations, by Jorge More, Danny Sorenson, Burton Garbow, Kenneth Hillstrom.

link


Used by

  • module~~minpack~~UsedByGraph module~minpack minpack program~test_minpack test_minpack program~test_minpack->module~minpack

Functions

public function enorm(n, x)

ENORM computes the Euclidean norm of a vector.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: x(n)

Return Value real(kind=8)

public function enorm2(n, x)

ENORM2 computes the Euclidean norm of a vector.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: x(n)

Return Value real(kind=8)

public function r8_uniform_01(seed)

R8_UNIFORM_01 returns a unit pseudorandom R8.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: seed

Return Value real(kind=8)


Subroutines

public subroutine chkder(m, n, x, fvec, fjac, ldfjac, xp, fvecp, mode, err)

CHKDER checks the gradients of M functions of N variables.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: m
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: fvec(m)
real(kind=8) :: fjac(ldfjac,n)
integer(kind=4) :: ldfjac
real(kind=8) :: xp(n)
real(kind=8) :: fvecp(m)
integer(kind=4) :: mode
real(kind=8) :: err(m)

public subroutine dogleg(n, r, lr, diag, qtb, delta, x)

DOGLEG finds the minimizing combination of Gauss-Newton and gradient steps.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: r(lr)
integer(kind=4) :: lr
real(kind=8) :: diag(n)
real(kind=8) :: qtb(n)
real(kind=8) :: delta
real(kind=8) :: x(n)

public subroutine fdjac1(fcn, n, x, fvec, fjac, ldfjac, iflag, ml, mu, epsfcn)

FDJAC1 estimates an N by N jacobian matrix using forward differences.

Arguments

Type IntentOptional Attributes Name
real :: fcn
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: fvec(n)
real(kind=8) :: fjac(ldfjac,n)
integer(kind=4) :: ldfjac
integer(kind=4) :: iflag
integer(kind=4) :: ml
integer(kind=4) :: mu
real(kind=8) :: epsfcn

public subroutine fdjac2(fcn, m, n, x, fvec, fjac, ldfjac, iflag, epsfcn)

FDJAC2 estimates an M by N jacobian matrix using forward differences.

Arguments

Type IntentOptional Attributes Name
real :: fcn
integer(kind=4) :: m
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: fvec(m)
real(kind=8) :: fjac(ldfjac,n)
integer(kind=4) :: ldfjac
integer(kind=4) :: iflag
real(kind=8) :: epsfcn

public subroutine hybrd(fcn, n, x, fvec, xtol, maxfev, ml, mu, epsfcn, diag, mode, factor, nprint, info, nfev, fjac, ldfjac, r, lr, qtf)

HYBRD seeks a zero of N nonlinear equations in N variables.

Arguments

Type IntentOptional Attributes Name
real :: fcn
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: fvec(n)
real(kind=8) :: xtol
integer(kind=4) :: maxfev
integer(kind=4) :: ml
integer(kind=4) :: mu
real(kind=8) :: epsfcn
real(kind=8) :: diag(n)
integer(kind=4) :: mode
real(kind=8) :: factor
integer(kind=4) :: nprint
integer(kind=4) :: info
integer(kind=4) :: nfev
real(kind=8) :: fjac(ldfjac,n)
integer(kind=4) :: ldfjac
real(kind=8) :: r(lr)
integer(kind=4) :: lr
real(kind=8) :: qtf(n)

public subroutine hybrd1(fcn, n, x, fvec, tol, info)

HYBRD1 seeks a zero of N nonlinear equations in N variables.

Arguments

Type IntentOptional Attributes Name
real :: fcn
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: fvec(n)
real(kind=8) :: tol
integer(kind=4) :: info

public subroutine hybrj(fcn, n, x, fvec, fjac, ldfjac, xtol, maxfev, diag, mode, factor, nprint, info, nfev, njev, r, lr, qtf)

HYBRJ seeks a zero of N nonlinear equations in N variables.

Arguments

Type IntentOptional Attributes Name
real :: fcn
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: fvec(n)
real(kind=8) :: fjac(ldfjac,n)
integer(kind=4) :: ldfjac
real(kind=8) :: xtol
integer(kind=4) :: maxfev
real(kind=8) :: diag(n)
integer(kind=4) :: mode
real(kind=8) :: factor
integer(kind=4) :: nprint
integer(kind=4) :: info
integer(kind=4) :: nfev
integer(kind=4) :: njev
real(kind=8) :: r(lr)
integer(kind=4) :: lr
real(kind=8) :: qtf(n)

public subroutine hybrj1(fcn, n, x, fvec, fjac, ldfjac, tol, info)

HYBRJ1 seeks a zero of N equations in N variables by Powell’s method.

Arguments

Type IntentOptional Attributes Name
real :: fcn
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: fvec(n)
real(kind=8) :: fjac(ldfjac,n)
integer(kind=4) :: ldfjac
real(kind=8) :: tol
integer(kind=4) :: info

public subroutine lmder(fcn, m, n, x, fvec, fjac, ldfjac, ftol, xtol, gtol, maxfev, diag, mode, factor, nprint, info, nfev, njev, ipvt, qtf)

LMDER minimizes M functions in N variables by the Levenberg-Marquardt method.

Arguments

Type IntentOptional Attributes Name
real :: fcn
integer(kind=4) :: m
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: fvec(m)
real(kind=8) :: fjac(ldfjac,n)
integer(kind=4) :: ldfjac
real(kind=8) :: ftol
real(kind=8) :: xtol
real(kind=8) :: gtol
integer(kind=4) :: maxfev
real(kind=8) :: diag(n)
integer(kind=4) :: mode
real(kind=8) :: factor
integer(kind=4) :: nprint
integer(kind=4) :: info
integer(kind=4) :: nfev
integer(kind=4) :: njev
integer(kind=4) :: ipvt(n)
real(kind=8) :: qtf(n)

public subroutine lmder1(fcn, m, n, x, fvec, fjac, ldfjac, tol, info)

LMDER1 minimizes M functions in N variables by Levenberg-Marquardt method.

Arguments

Type IntentOptional Attributes Name
real :: fcn
integer(kind=4) :: m
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: fvec(m)
real(kind=8) :: fjac(ldfjac,n)
integer(kind=4) :: ldfjac
real(kind=8) :: tol
integer(kind=4) :: info

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

LMDIF minimizes M functions in N variables by the Levenberg-Marquardt method.

Arguments

Type IntentOptional Attributes Name
real :: fcn
integer(kind=4) :: m
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: fvec(m)
real(kind=8) :: ftol
real(kind=8) :: xtol
real(kind=8) :: gtol
integer(kind=4) :: maxfev
real(kind=8) :: epsfcn
real(kind=8) :: diag(n)
integer(kind=4) :: mode
real(kind=8) :: factor
integer(kind=4) :: nprint
integer(kind=4) :: info
integer(kind=4) :: nfev
real(kind=8) :: fjac(ldfjac,n)
integer(kind=4) :: ldfjac
integer(kind=4) :: ipvt(n)
real(kind=8) :: qtf(n)

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

LMDIF1 minimizes M functions in N variables using Levenberg-Marquardt method.

Arguments

Type IntentOptional Attributes Name
real :: fcn
integer(kind=4) :: m
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: fvec(m)
real(kind=8) :: tol
integer(kind=4) :: info

public subroutine lmpar(n, r, ldr, ipvt, diag, qtb, delta, par, x, sdiag)

LMPAR computes a parameter for the Levenberg-Marquardt method.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: r(ldr,n)
integer(kind=4) :: ldr
integer(kind=4) :: ipvt(n)
real(kind=8) :: diag(n)
real(kind=8) :: qtb(n)
real(kind=8) :: delta
real(kind=8) :: par
real(kind=8) :: x(n)
real(kind=8) :: sdiag(n)

public subroutine lmstr(fcn, m, n, x, fvec, fjac, ldfjac, ftol, xtol, gtol, maxfev, diag, mode, factor, nprint, info, nfev, njev, ipvt, qtf)

LMSTR minimizes M functions in N variables using Levenberg-Marquardt method.

Arguments

Type IntentOptional Attributes Name
real :: fcn
integer(kind=4) :: m
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: fvec(m)
real(kind=8) :: fjac(ldfjac,n)
integer(kind=4) :: ldfjac
real(kind=8) :: ftol
real(kind=8) :: xtol
real(kind=8) :: gtol
integer(kind=4) :: maxfev
real(kind=8) :: diag(n)
integer(kind=4) :: mode
real(kind=8) :: factor
integer(kind=4) :: nprint
integer(kind=4) :: info
integer(kind=4) :: nfev
integer(kind=4) :: njev
integer(kind=4) :: ipvt(n)
real(kind=8) :: qtf(n)

public subroutine lmstr1(fcn, m, n, x, fvec, fjac, ldfjac, tol, info)

LMSTR1 minimizes M functions in N variables using Levenberg-Marquardt method.

Arguments

Type IntentOptional Attributes Name
real :: fcn
integer(kind=4) :: m
integer(kind=4) :: n
real(kind=8) :: x(n)
real(kind=8) :: fvec(m)
real(kind=8) :: fjac(ldfjac,n)
integer(kind=4) :: ldfjac
real(kind=8) :: tol
integer(kind=4) :: info

public subroutine qform(m, n, q, ldq)

QFORM produces the explicit QR factorization of a matrix.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: m
integer(kind=4) :: n
real(kind=8) :: q(ldq,m)
integer(kind=4) :: ldq

public subroutine qrfac(m, n, a, lda, pivot, ipvt, lipvt, rdiag, acnorm)

QRFAC computes a QR factorization using Householder transformations.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: m
integer(kind=4) :: n
real(kind=8) :: a(lda,n)
integer(kind=4) :: lda
logical :: pivot
integer(kind=4) :: ipvt(lipvt)
integer(kind=4) :: lipvt
real(kind=8) :: rdiag(n)
real(kind=8) :: acnorm(n)

public subroutine qrsolv(n, r, ldr, ipvt, diag, qtb, x, sdiag)

QRSOLV solves a rectangular linear system A*x=b in the least squares sense.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: r(ldr,n)
integer(kind=4) :: ldr
integer(kind=4) :: ipvt(n)
real(kind=8) :: diag(n)
real(kind=8) :: qtb(n)
real(kind=8) :: x(n)
real(kind=8) :: sdiag(n)

public subroutine r1mpyq(m, n, a, lda, v, w)

R1MPYQ computes A*Q, where Q is the product of Householder transformations.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: m
integer(kind=4) :: n
real(kind=8) :: a(lda,n)
integer(kind=4) :: lda
real(kind=8) :: v(n)
real(kind=8) :: w(n)

public subroutine r1updt(m, n, s, ls, u, v, w, sing)

R1UPDT re-triangularizes a matrix after a rank one update.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: m
integer(kind=4) :: n
real(kind=8) :: s(ls)
integer(kind=4) :: ls
real(kind=8) :: u(m)
real(kind=8) :: v(n)
real(kind=8) :: w(m)
logical :: sing

public subroutine r8mat_print(m, n, a, title)

R8MAT_PRINT prints an R8MAT.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: m
integer(kind=4) :: n
real(kind=8) :: a(m,n)
character(len=*) :: title

public subroutine r8mat_print_some(m, n, a, ilo, jlo, ihi, jhi, title)

R8MAT_PRINT_SOME prints some of an R8MAT.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: m
integer(kind=4) :: n
real(kind=8) :: a(m,n)
integer(kind=4) :: ilo
integer(kind=4) :: jlo
integer(kind=4) :: ihi
integer(kind=4) :: jhi
character(len=*) :: title

public subroutine r8vec_print(n, a, title)

R8VEC_PRINT prints an R8VEC.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: a(n)
character(len=*) :: title

public subroutine rwupdt(n, r, ldr, w, b, alpha, c, s)

RWUPDT computes the decomposition of triangular matrix augmented by one row.

Arguments

Type IntentOptional Attributes Name
integer(kind=4) :: n
real(kind=8) :: r(ldr,n)
integer(kind=4) :: ldr
real(kind=8) :: w(n)
real(kind=8) :: b(n)
real(kind=8) :: alpha
real(kind=8) :: c(n)
real(kind=8) :: s(n)

public subroutine timestamp()

TIMESTAMP prints the current YMDHMS date as a time stamp.

Arguments

None