Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "minpack/lmpar"

Index

Functions

Functions

lmpar

  • lmpar(n: number, r: number[], ldr: number, ipvt: number[], diag: number[], qtb: number[], delta: number, ref: byRef, x: number[], sdiag: number[], wa1: number[], wa2: number[]): void
  • subroutine lmpar

    given an m by n matrix a, an n by n nonsingular diagonal matrix d, an m-vector b, and a positive number delta, the problem is to determine a value for the parameter par such that if x solves the system

    ax = b , sqrt(par)d*x = 0 ,

    in the least squares sense, and dxnorm is the euclidean norm of d*x, then either par is zero and

    (dxnorm-delta) .le. 0.1*delta ,

    or par is positive and

    abs(dxnorm-delta) .le. 0.1*delta .

    this subroutine completes the solution of the problem if it is provided with the necessary information from the qr factorization, with column pivoting, of a. that is, if ap = qr, where p is a permutation matrix, q has orthogonal columns, and r is an upper triangular matrix with diagonal elements of nonincreasing magnitude, then lmpar expects the full upper triangle of r, the permutation matrix p, and the first n components of (q transpose)*b. on output lmpar also provides an upper triangular matrix s such that

    t t t p (a *a + pardd)p = s *s .

    s is employed within lmpar and may be of separate interest.

    only a few iterations are generally needed for convergence of the algorithm. if, however, the limit of 10 iterations is reached, then the output par will contain the best value obtained so far.

    the subroutine statement is

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

    where

    Parameters

    • n: number

      is a positive integer input variable set to the order of r.

    • r: number[]

      is an n by n array. on input the full upper triangle must contain the full upper triangle of the matrix r. on output the full upper triangle is unaltered, and the strict lower triangle contains the strict upper triangle (transposed) of the upper triangular matrix s.

    • ldr: number

      is a positive integer input variable not less than n which specifies the leading dimension of the array r.

    • ipvt: number[]

      is an integer input array of length n which defines the permutation matrix p such that ap = qr. column j of p is column ipvt(j) of the identity matrix.

    • diag: number[]

      is an input array of length n which must contain the diagonal elements of the matrix d.

    • qtb: number[]

      is an input array of length n which must contain the first n elements of the vector (q transpose)*b.

    • delta: number

      is a positive input variable which specifies an upper bound on the euclidean norm of d*x.

    • ref: byRef
    • x: number[]

      is an output array of length n which contains the least squares solution of the system ax = b, sqrt(par)d*x = 0, for the output par.

    • sdiag: number[]

      is an output array of length n which contains the diagonal elements of the upper triangular matrix s.

    • wa1: number[]

      and wa2 are work arrays of length n.

      subprograms called

      minpack-supplied ... dpmpar,enorm,qrsolv

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

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

    • wa2: number[]

    Returns void