bspline_defc_module Module

defc and dfc procedures and support routines from [SLATEC](https: For fitting B-splines polynomials to discrete 1D data.

References

For a description of the B-splines and usage instructions to evaluate them, see:

  • C. W. de Boor, Package for Calculating with B-Splines. SIAM J. Numer. Anal., p. 441, (June, 1977).

For further discussion of (constrained) curve fitting using B-splines, see reference 2.

  • R. J. Hanson, Constrained least squares curve fitting to discrete data using B-splines, a users guide, Report SAND78-1291, Sandia Laboratories, December 1978.

History

  • Dec 2022 (Jacob Williams) : Cleanup and modernization of the SLATEC routines.

Note

This module does not support the user-defined ip integer kind. It only uses the default integer kind.

Todo

add iflag outputs to be consistent with the rest of the library.


Uses

  • module~~bspline_defc_module~~UsesGraph module~bspline_defc_module bspline_defc_module module~bspline_blas_module bspline_blas_module module~bspline_defc_module->module~bspline_blas_module module~bspline_kinds_module bspline_kinds_module module~bspline_defc_module->module~bspline_kinds_module module~bspline_blas_module->module~bspline_kinds_module iso_fortran_env iso_fortran_env module~bspline_kinds_module->iso_fortran_env

Used by

  • module~~bspline_defc_module~~UsedByGraph module~bspline_defc_module bspline_defc_module module~bspline_module bspline_module module~bspline_module->module~bspline_defc_module

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private, parameter :: drelpr = epsilon(1.0_wp)

machine precision (d1mach(4))


Functions

private function dwnlt2(me, mend, ir, factor, tau, scale, wic)

To test independence of incoming column.

Read more…

Arguments

Type IntentOptional Attributes Name
integer :: me
integer :: mend
integer :: ir
real(kind=wp) :: factor
real(kind=wp) :: tau
real(kind=wp) :: scale(*)
real(kind=wp) :: wic(*)

Return Value logical

public function dcv(xval, ndata, nconst, nord, nbkpt, bkpt, w)

dcv is a companion function subprogram for dfc. The documentation for dfc has complete usage instructions.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: xval

The point where the variance is desired

integer, intent(in) :: ndata

The number of discrete (X,Y) pairs for which dfc calculated a piece-wise polynomial curve.

integer, intent(in) :: nconst

The number of conditions that constrained the B-spline in dfc.

integer, intent(in) :: nord

The order of the B-spline used in dfc. The value of NORD must satisfy 1 < NORD < 20 .

Read more…
integer, intent(in) :: nbkpt

The number of knots in the array BKPT(). The value of NBKPT must satisfy NBKPT .GE. 2NORD.

real(kind=wp), intent(in) :: bkpt(*)

The array of knots. Normally the problem data interval will be included between the limits BKPT(NORD) and BKPT(NBKPT-NORD+1). The additional end knots BKPT(I),I=1,...,NORD-1 and I=NBKPT-NORD+2,...,NBKPT, are required by dfc to compute the functions used to fit the data.

real(kind=wp) :: w(*)

Real work array as used in dfc. See dfc for the required length of W(). The contents of W() must not be modified by the user if the variance function is desired.

Return Value real(kind=wp)


Subroutines

public subroutine defc(Ndata, Xdata, Ydata, Sddata, Nord, Nbkpt, Bkpt, Mdein, Mdeout, Coeff, Lw, w)

This subprogram fits a piecewise polynomial curve to discrete data. The piecewise polynomials are represented as B-splines. The fitting is done in a weighted least squares sense.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: Ndata

number of points (size of xdata and ydata). Any non-negative value of NDATA is allowed. A negative value of NDATA is an error.

real(kind=wp), intent(in), dimension(ndata) :: Xdata

X data array. No sorting of XDATA(*) is required.

real(kind=wp), intent(in), dimension(ndata) :: Ydata

Y data array.

real(kind=wp), intent(in), dimension(ndata) :: Sddata

Y value standard deviation or uncertainty. A zero value for any entry of SDDATA(*) will weight that data point as 1. Otherwise the weight of that data point is the reciprocal of this entry.

integer, intent(in) :: Nord

B-spline order. (The order of the spline is one more than the degree of the piecewise polynomial defined on each interval. This is consistent with the B-spline package convention. For example, NORD=4 when we are using piecewise cubics.) NORD must be in the range 1 <= NORD <= 20.

integer, intent(in) :: Nbkpt

The value of NBKPT must satisfy the condition NBKPT >= 2*NORD.

real(kind=wp), intent(in), dimension(:) :: Bkpt

NBKPT knots of the B-spline. Normally the problem data interval will be included between the limits BKPT(NORD) and BKPT(NBKPT-NORD+1). The additional end knots BKPT(I),I=1,...,NORD-1 and I=NBKPT-NORD+2,...,NBKPT, are required to compute the functions used to fit the data. No sorting of BKPT(*) is required. Internal to DEFC the extreme end knots may be reduced and increased respectively to accommodate any data values that are exterior to the given knot values. The contents of BKPT(*) is not changed.

integer, intent(in) :: Mdein

An integer flag, with one of two possible values (1 or 2), that directs the subprogram action with regard to new data points provided by the user:

Read more…
integer, intent(out) :: Mdeout

An output flag that indicates the status of the curve fit:

Read more…
real(kind=wp), intent(out) :: Coeff(*)

If the output value of MDEOUT=1, this array contains the unknowns obtained from the least squares fitting process. These N=NBKPT-NORD parameters are the B-spline coefficients. For MDEOUT=2, not enough data was processed to uniquely determine the B-spline coefficients. In this case, and also when MDEOUT=-1, all values of COEFF(*) are set to zero.

Read more…
integer, intent(in) :: Lw

The amount of working storage actually allocated for the working array W(*). This quantity is compared with the actual amount of storage needed in DEFC. Insufficient storage allocated for W(*) is an error. This feature was included in DEFC because misreading the storage formula for W(*) might very well lead to subtle and hard-to-find programming bugs.

Read more…
real(kind=wp) :: w(*)

Working Array. Its length is specified as an input parameter in LW as noted above. The contents of W(*) must not be modified by the user between calls to DEFC with values of MDEIN=1,2,2,... . The first (NBKPT-NORD+3)*(NORD+1) entries of W(*) are acceptable as direct input to DFC for an "old problem" only when MDEOUT=1 or 2.

private subroutine defcmn(Ndata, Xdata, Ydata, Sddata, Nord, Nbkpt, Bkptin, Mdein, Mdeout, Coeff, Bf, Xtemp, Ptemp, Bkpt, g, Mdg, w, Mdw, Lw)

This is a companion subprogram to DEFC. This subprogram does weighted least squares fitting of data by B-spline curves. The documentation for DEFC has complete usage instructions.

Read more…

Arguments

Type IntentOptional Attributes Name
integer :: Ndata
real(kind=wp) :: Xdata(*)
real(kind=wp) :: Ydata(*)
real(kind=wp) :: Sddata(*)
integer :: Nord
integer :: Nbkpt
real(kind=wp) :: Bkptin(*)
integer :: Mdein
integer :: Mdeout
real(kind=wp) :: Coeff(*)
real(kind=wp) :: Bf(Nord,*)
real(kind=wp) :: Xtemp(*)
real(kind=wp) :: Ptemp(*)
real(kind=wp) :: Bkpt(*)
real(kind=wp) :: g(Mdg,*)
integer :: Mdg
real(kind=wp) :: w(Mdw,*)
integer :: Mdw
integer :: Lw

private subroutine dbndac(g, Mdg, Nb, Ip, Ir, Mt, Jt)

These subroutines solve the least squares problem Ax = b for banded matrices A using sequential accumulation of rows of the data matrix. Exactly one right-hand side vector is permitted.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: g(Mdg,*)

G(MDG,NB+1)

Read more…
integer, intent(in) :: Mdg

The number of rows in the working array G(*,*). The value of MDG should be >= MU. The value of MU is defined in the abstract of these subprograms.

integer, intent(in) :: Nb

The bandwidth of the data matrix A.

integer, intent(inout) :: Ip

Input Set by the user to the value 1 before the first call to DBNDAC. Its subsequent value is controlled by DBNDAC to set up for the next call to DBNDAC.

Read more…
integer, intent(inout) :: Ir

Input Index of the row of G(*,*) where the user is to place the new block of data (C F). Set by the user to the value 1 before the first call to DBNDAC. Its subsequent value is controlled by DBNDAC. A value of IR > MDG is considered an error.

Read more…
integer, intent(in) :: Mt

Set by the user to indicate the number of new rows of data in the block

integer, intent(in) :: Jt

Set by the user to indicate the index of the first nonzero column in that set of rows (E F) = (0 C 0 F) being processed.

private subroutine dbndsl(Mode, g, Mdg, Nb, Ip, Ir, x, n, Rnorm)

These subroutines solve the least squares problem Ax = b for banded matrices A using sequential accumulation of rows of the data matrix. Exactly one right-hand side vector is permitted.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: Mode

Set by the user to one of the values 1, 2, or 3. These values respectively indicate that the solution of AX = B, YR = H or RZ = W is required.

real(kind=wp), intent(in) :: g(Mdg,*)

G(MDG,NB+1)

Read more…
integer, intent(in) :: Mdg

The number of rows in the working array G(*,*). The value of MDG should be >= MU. The value of MU is defined in the abstract of these subprograms.

Read more…
integer, intent(in) :: Nb

This argument has the same meaning and contents as following the last call to DBNDAC.

integer, intent(in) :: Ip

This argument has the same meaning and contents as following the last call to DBNDAC.

integer, intent(in) :: Ir

This argument has the same meaning and contents as following the last call to DBNDAC.

real(kind=wp), intent(inout) :: x(*)

X(N)

Read more…
integer, intent(in) :: n

The number of variables in the solution vector. If any of the N diagonal terms are zero the subroutine DBNDSL prints an appropriate message. This condition is considered an error.

real(kind=wp), intent(out) :: Rnorm

If MODE=1, RNORM is the Euclidean length of the residual vector AX-B. When MODE=2 or 3 RNORM` is set to zero.

private subroutine dfspvn(t, Jhigh, Index, x, Ileft, Vnikx, j, deltam, deltap)

Calculates the value of all possibly nonzero B-splines at X of order MAX(JHIGH,(J+1)(INDEX-1)) on T.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: t(*)
integer, intent(in) :: Jhigh
integer, intent(in) :: Index
real(kind=wp), intent(in) :: x
integer, intent(in) :: Ileft
real(kind=wp) :: Vnikx(*)
integer, intent(inout) :: j

JW : added

real(kind=wp), intent(inout), dimension(20) :: deltam

JW : added

real(kind=wp), intent(inout), dimension(20) :: deltap

JW : added

private subroutine dh12(Mode, Lpivot, l1, m, u, Iue, Up, c, Ice, Icv, Ncv)

Construction and/or application of a single Householder transformation. Q = I + U*(U**T)/B

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: Mode

1 or 2 to select algorithm H1 or H2 .

integer, intent(in) :: Lpivot

the index of the pivot element.

integer, intent(in) :: l1

If L1 <= M the transformation will be constructed to zero elements indexed from L1 through M. If L1 > M the subroutine does an identity transformation.

integer, intent(in) :: m

see l1

real(kind=wp), intent(inout) :: u(Iue,*)

On entry to H1 U() contains the pivot vector. On exit from H1 U() and UP contain quantities defining the vector U of the Householder transformation. On entry to H2 U() and UP should contain quantities previously computed by H1. These will not be modified by H2.

integer, intent(in) :: Iue

the storage increment between elements of U.

real(kind=wp), intent(inout) :: Up

see u

real(kind=wp), intent(inout) :: c(*)

On entry to H1 or H2 C() contains a matrix which will be regarded as a set of vectors to which the Householder transformation is to be applied. On exit C() contains the set of transformed vectors.

integer, intent(in) :: Ice

Storage increment between elements of vectors in C().

integer, intent(in) :: Icv

Storage increment between vectors in C().

integer, intent(in) :: Ncv

Number of vectors in C() to be transformed. If NCV <= 0 no operations will be done on C().

private subroutine dsort(n, Kflag, Dx, Dy)

Sort an array and optionally make the same interchanges in an auxiliary array. The array may be sorted in increasing or decreasing order.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

number of values in array DX to be sorted

integer, intent(in) :: Kflag

control parameter: * Kflag < 0 : sort DX in decreasing order and optionally carry DY along. * Kflag > 0 : sort DX in increasing order and optionally carry DY along.

real(kind=wp), intent(inout), dimension(*) :: Dx

array of values to be sorted (usually abscissas)

real(kind=wp), intent(inout), optional, dimension(*) :: Dy

array to be (optionally) carried along

private subroutine sort_ascending(n, dx, dy)

Recursive quicksoft. Modified to also carry along a second array.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
real(kind=wp), intent(inout), dimension(*) :: dx

array of values to be sorted

real(kind=wp), intent(inout), optional, dimension(*) :: dy

array to be (optionally) carried along

public subroutine dfc(ndata, xdata, ydata, sddata, nord, Nbkpt, Bkpt, nconst, xconst, yconst, nderiv, mode, coeff, w, iw)

This subprogram fits a piecewise polynomial curve to discrete data. The piecewise polynomials are represented as B-splines. The fitting is done in a weighted least squares sense. Equality and inequality constraints can be imposed on the fitted curve.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ndata

number of points (size of xdata and ydata). Any non-negative value of NDATA is allowed. A negative value of NDATA is an error.

real(kind=wp), intent(in) :: xdata(*)

X data array. No sorting of XDATA(*) is required.

real(kind=wp), intent(in) :: ydata(*)

Y data array.

real(kind=wp), intent(in) :: sddata(*)

Y value standard deviation or uncertainty. A zero value for any entry of SDDATA(*) will weight that data point as 1. Otherwise the weight of that data point is the reciprocal of this entry.

integer, intent(in) :: nord

B-spline order. (The order of the spline is one more than the degree of the piecewise polynomial defined on each interval. This is consistent with the B-spline package convention. For example, NORD=4 when we are using piecewise cubics.) NORD must be in the range 1 <= NORD <= 20.

integer, intent(in) :: Nbkpt

The value of NBKPT must satisfy the condition NBKPT >= 2*NORD.

real(kind=wp), intent(in), dimension(*) :: Bkpt

NBKPT knots of the B-spline. Normally the problem data interval will be included between the limits BKPT(NORD) and BKPT(NBKPT-NORD+1). The additional end knots BKPT(I),I=1,...,NORD-1 and I=NBKPT-NORD+2,...,NBKPT, are required to compute the functions used to fit the data. No sorting of BKPT(*) is required. Internal to DEFC the extreme end knots may be reduced and increased respectively to accommodate any data values that are exterior to the given knot values. The contents of BKPT(*) is not changed.

integer, intent(in) :: nconst

The number of conditions that constrain the B-spline is NCONST. A constraint is specified by an (X,Y) pair in the arrays XCONST() and YCONST(), and by the type of constraint and derivative value encoded in the array NDERIV(*).

real(kind=wp), intent(in) :: xconst(*)

X value of constraint. No sorting of XCONST(*) is required.

real(kind=wp), intent(in) :: yconst(*)

Y value of constraint

integer, intent(in) :: nderiv(*)

The value of NDERIV(*) is determined as follows. Suppose the I-th constraint applies to the J-th derivative of the B-spline. (Any non-negative value of J < NORD is permitted. In particular the value J=0 refers to the B-spline itself.) For this I-th constraint, set

Read more…
integer, intent(inout) :: mode

Input

Read more…
real(kind=wp), intent(out) :: coeff(*)

If the output value of MODE=0 or 1, this array contains the unknowns obtained from the least squares fitting process. These N=NBKPT-NORD parameters are the B-spline coefficients. For MODE=1, the equality constraints are contradictory. To make the fitting process more robust, the equality constraints are satisfied in a least squares sense. In this case the array COEFF() contains B-spline coefficients for this extended concept of a solution. If MODE=-1,2 or 3 on output, the array COEFF() is undefined.

real(kind=wp) :: w(*)

real work array of length IW(1). The contents of W(*) must not be modified by the user if the variance function is desired.

Read more…
integer :: iw(*)

integer work array of length IW(2)

Read more…

private subroutine dfcmn(ndata, xdata, ydata, sddata, nord, nbkpt, bkptin, nconst, xconst, yconst, nderiv, mode, coeff, bf, xtemp, ptemp, bkpt, g, mdg, w, mdw, work, iwork)

This is a companion subprogram to DFC. The documentation for DFC has complete usage instructions.

Read more…

Arguments

Type IntentOptional Attributes Name
integer :: ndata
real(kind=wp) :: xdata(*)
real(kind=wp) :: ydata(*)
real(kind=wp) :: sddata(*)
integer :: nord
integer :: nbkpt
real(kind=wp) :: bkptin(*)
integer :: nconst
real(kind=wp) :: xconst(*)
real(kind=wp) :: yconst(*)
integer :: nderiv(*)
integer :: mode
real(kind=wp) :: coeff(*)
real(kind=wp) :: bf(nord,*)
real(kind=wp) :: xtemp(*)
real(kind=wp) :: ptemp(*)
real(kind=wp) :: bkpt(*)
real(kind=wp) :: g(mdg,*)
integer :: mdg
real(kind=wp) :: w(mdw,*)
integer :: mdw
real(kind=wp) :: work(*)
integer :: iwork(*)

private subroutine dfspvd(t, k, x, ileft, vnikx, nderiv)

Calculates value and derivs of all B-splines which do not vanish at X

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: t(*)
integer :: k
real(kind=wp) :: x
integer :: ileft
real(kind=wp) :: vnikx(k,*)
integer :: nderiv

private subroutine dhfti(a, mda, m, n, b, mdb, nb, tau, krank, rnorm, h, g, ip)

Solve a least squares problem for banded matrices using sequential accumulation of rows of the data matrix. Exactly one right-hand side vector is permitted.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: a(mda,*)

A(MDA,N). The array A(,) initially contains the M by N matrix A of the least squares problem AX = B. The first dimensioning parameter of the array A(,) is MDA, which must satisfy MDA>=M Either M>=N or M<N is permitted. There is no restriction on the rank of A. The condition MDA<M is considered an error.

Read more…
integer, intent(in) :: mda

actual leading dimension of a

integer, intent(in) :: m
integer, intent(in) :: n
real(kind=wp), intent(inout) :: b(mdb,*)

(B(MDB,NB) or B(M)). If NB = 0 the subroutine will perform the orthogonal decomposition but will make no references to the array B(). If NB>0 the array B() must initially contain the M by NB matrix B of the least squares problem AX = B. If NB>=2 the array B() must be doubly subscripted with first dimensioning parameter MDB>=MAX(M,N). If NB = 1 the array B() may be either doubly or singly subscripted. In the latter case the value of MDB is arbitrary but it should be set to some valid integer value such as MDB = M.

Read more…
integer, intent(in) :: mdb

actual leading dimension of b

integer, intent(in) :: nb
real(kind=wp), intent(in) :: tau

Absolute tolerance parameter provided by user for pseudorank determination.

integer, intent(out) :: krank

Set by the subroutine to indicate the pseudorank of A.

real(kind=wp), intent(out) :: rnorm(*)

RNORM(NB). On return, RNORM(J) will contain the Euclidean norm of the residual vector for the problem defined by the J-th column vector of the array B(,) for J = 1,...,NB.

real(kind=wp) :: h(*)

H(N). Array of working space used by DHFTI. On return, contains elements of the pre-multiplying Householder transformations used to compute the minimum Euclidean length solution. not generally required by the user.

real(kind=wp) :: g(*)

G(N). Array of working space used by DHFTI. On return, contain elements of the post-multiplying Householder transformations used to compute the minimum Euclidean length solution. not generally required by the user.

integer :: ip(*)

IP(N). Array of working space used by DHFTI. Array in which the subroutine records indices describing the permutation of column vectors. not generally required by the user.

private subroutine dlpdp(a, mda, m, n1, n2, prgopt, x, wnorm, mode, ws, is)

Determine an N1-vector W, and an N2-vector Z which minimizes the Euclidean length of W subject to GW+HZ >= Y. This is the least projected distance problem, LPDP. The matrices G and H are of respective dimensions M by N1 and M by N2.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: a(mda,*)

A(MDA,N+1), where N=N1+N2.

integer, intent(in) :: mda
integer :: m
integer, intent(in) :: n1
integer, intent(in) :: n2
real(kind=wp) :: prgopt(*)
real(kind=wp) :: x(*)

X(N), where N=N1+N2.

real(kind=wp) :: wnorm
integer, intent(out) :: mode

The value of MODE indicates the status of the computation after returning to the user.

Read more…
real(kind=wp) :: ws(*)

WS((M+2)*(N+7)), where N=N1+N2. This is a slight overestimate for WS(*).

integer :: is(*)

IS(M+N+1), where N=N1+N2.

private subroutine dlsei(w, mdw, me, ma, mg, n, prgopt, x, rnorme, rnorml, mode, ws, ip)

This subprogram solves a linearly constrained least squares problem with both equality and inequality constraints, and, if the user requests, obtains a covariance matrix of the solution parameters.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: w(mdw,*)
integer, intent(in) :: mdw
integer :: me
integer :: ma
integer :: mg
integer :: n
real(kind=wp) :: prgopt(*)
real(kind=wp) :: x(*)
real(kind=wp) :: rnorme
real(kind=wp) :: rnorml
integer :: mode
real(kind=wp) :: ws(*)
integer :: ip(3)

private subroutine dlsi(w, mdw, ma, mg, n, prgopt, x, rnorm, mode, ws, ip)

This is a companion subprogram to DLSEI. The documentation for DLSEI has complete usage instructions.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: w(mdw,*)

W(*,*) contains:

Read more…
integer, intent(in) :: mdw

contain (resp) var. dimension of W(*,*), and matrix dimensions.

integer, intent(in) :: ma

contain (resp) var. dimension of W(*,*), and matrix dimensions.

integer, intent(in) :: mg

contain (resp) var. dimension of W(*,*), and matrix dimensions.

integer, intent(in) :: n

contain (resp) var. dimension of W(*,*), and matrix dimensions.

real(kind=wp), intent(in) :: prgopt(*)

Program option vector.

real(kind=wp), intent(out) :: x(*)

Solution vector(unless MODE=2)

real(kind=wp), intent(out) :: rnorm

length of AX-B.

integer, intent(out) :: mode Read more…
real(kind=wp) :: ws(*)

Working storage of dimension K+N+(MG+2)*(N+7), where K=MAX(MA+MG,N).

integer :: ip(*)

IP(MG+2*N+1) Integer working storage

private subroutine dwnlit(w, mdw, m, n, l, ipivot, itype, h, scale, rnorm, idope, dope, done)

This is a companion subprogram to DWNNLS. The documentation for DWNNLS has complete usage instructions.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: w(mdw,*)
integer :: mdw
integer :: m
integer :: n
integer :: l
integer :: ipivot(*)
integer :: itype(*)
real(kind=wp) :: h(*)
real(kind=wp) :: scale(*)
real(kind=wp) :: rnorm
integer :: idope(*)
real(kind=wp) :: dope(*)
logical :: done

private subroutine dwnlsm(w, mdw, mme, ma, n, l, prgopt, x, rnorm, mode, ipivot, itype, wd, h, scale, z, temp, d)

This is a companion subprogram to DWNNLS. The documentation for DWNNLS has complete usage instructions.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: w(mdw,*)
integer :: mdw
integer :: mme
integer :: ma
integer :: n
integer :: l
real(kind=wp) :: prgopt(*)
real(kind=wp) :: x(*)
real(kind=wp) :: rnorm
integer :: mode
integer :: ipivot(*)
integer :: itype(*)
real(kind=wp) :: wd(*)
real(kind=wp) :: h(*)
real(kind=wp) :: scale(*)
real(kind=wp) :: z(*)
real(kind=wp) :: temp(*)
real(kind=wp) :: d(*)

private subroutine dwnlt1(i, lend, mend, ir, mdw, recalc, imax, hbar, h, scale, w)

To update the column Sum Of Squares and find the pivot column. The column Sum of Squares Vector will be updated at each step. When numerically necessary, these values will be recomputed.

Read more…

Arguments

Type IntentOptional Attributes Name
integer :: i
integer :: lend
integer :: mend
integer :: ir
integer :: mdw
logical :: recalc
integer :: imax
real(kind=wp) :: hbar
real(kind=wp) :: h(*)
real(kind=wp) :: scale(*)
real(kind=wp) :: w(mdw,*)

private subroutine dwnlt3(i, imax, m, mdw, ipivot, h, w)

Perform column interchange. Exchange elements of permuted index vector and perform column interchanges.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: i
integer, intent(in) :: imax
integer, intent(in) :: m
integer, intent(in) :: mdw
integer, intent(inout) :: ipivot(*)
real(kind=wp), intent(inout) :: h(*)
real(kind=wp), intent(inout) :: w(mdw,*)

private subroutine dwnnls(w, mdw, me, ma, n, l, prgopt, x, rnorm, mode, iwork, work)

This subprogram solves a linearly constrained least squares problem. Suppose there are given matrices E and A of respective dimensions ME by N and MA by N, and vectors F and B of respective lengths ME and MA. This subroutine solves the problem

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: w(mdw,*)
integer :: mdw
integer :: me
integer :: ma
integer :: n
integer :: l
real(kind=wp) :: prgopt(*)
real(kind=wp) :: x(*)
real(kind=wp) :: rnorm
integer :: mode
integer :: iwork(*)
real(kind=wp) :: work(*)