Module for bvls.
Call bvls, but matching the interface of the old nnls.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(inout), | dimension(mda,n) | :: | a | ||
integer, | intent(in) | :: | mda | |||
integer, | intent(in) | :: | m | |||
integer, | intent(in) | :: | n | |||
real(kind=wp), | intent(inout), | dimension(m) | :: | b | ||
real(kind=wp), | intent(out), | dimension(n) | :: | x | ||
real(kind=wp), | intent(out) | :: | rnorm | |||
real(kind=wp), | intent(inout), | dimension(n) | :: | w | ||
real(kind=wp), | intent(inout), | dimension(m) | :: | zz | ||
integer, | intent(out) | :: | mode | |||
integer, | intent(in) | :: | max_iter |
maximum number of iterations
(if <=0, then |
Given an m by n matrix, , and an m-vector, , compute an n-vector, , that solves the least squares problem:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(inout), | dimension(:,:) | :: | a |
On entry A() contains the M by N matrix, A. On return A() contains the product matrix, Q*A, where Q is an M by M orthogonal matrix generated by this subroutine. The dimensions are M=size(A,1) and N=size(A,2). |
|
real(kind=wp), | intent(inout), | dimension(:) | :: | b |
On entry B() contains the M-vector, B. On return, B() contains Q*B. The same Q multiplies A. |
|
real(kind=wp), | intent(in), | dimension(:,:) | :: | bnd |
BND(1,J) is the lower bound for X(J). BND(2,J) is the upper bound for X(J). |
|
real(kind=wp), | intent(out), | dimension(:) | :: | x |
On entry X() need not be initialized. On return, X() will contain the solution N-vector. |
|
real(kind=wp), | intent(out) | :: | rnorm |
Euclidean norm of the residual vector, b - A*X. |
||
integer, | intent(out) | :: | nsetp |
Indicates the number of components of the solution vector, X(), that are not at their constraint values. |
||
real(kind=wp), | intent(out), | dimension(:) | :: | w |
An N-array. On return, W() will contain the dual solution vector. Using Set definitions below: |
|
integer, | intent(out), | dimension(:) | :: | index |
An INTEGER working array of size N. On exit the contents of this array define the sets P, Z, and F as follows: |
|
integer, | intent(out) | :: | ierr |
Indicates status on return: |
||
integer, | intent(in) | :: | max_iter |
maximum number of iterations (if <=0, then |