bvls_wrapper Subroutine

public subroutine bvls_wrapper(a, mda, m, n, b, x, rnorm, w, zz, mode, max_iter)

Call bvls, but matching the interface of the old nnls.

Arguments

Type IntentOptional 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 3*n is used)


Calls

proc~~bvls_wrapper~~CallsGraph proc~bvls_wrapper bvls_module::bvls_wrapper proc~bvls bvls_module::bvls proc~bvls_wrapper->proc~bvls

Called by

proc~~bvls_wrapper~~CalledByGraph proc~bvls_wrapper bvls_module::bvls_wrapper proc~ldp slsqp_core::ldp proc~ldp->proc~bvls_wrapper proc~lsi slsqp_core::lsi proc~lsi->proc~ldp proc~lsei slsqp_core::lsei proc~lsei->proc~lsi proc~lsq slsqp_core::lsq proc~lsq->proc~lsei proc~slsqpb slsqp_core::slsqpb proc~slsqpb->proc~lsq proc~slsqp slsqp_core::slsqp proc~slsqp->proc~slsqpb proc~slsqp_wrapper slsqp_module::slsqp_solver%slsqp_wrapper proc~slsqp_wrapper->proc~slsqp

Source Code

    subroutine bvls_wrapper(a,mda,m,n,b,x,rnorm,w,zz,mode,max_iter)

    implicit none

    integer,intent(in)                      :: mda
    integer,intent(in)                      :: n
    real(wp),dimension(mda,n),intent(inout) :: a
    integer,intent(in)                      :: m
    real(wp),dimension(m),intent(inout)     :: b
    real(wp),dimension(n),intent(out)       :: x
    real(wp),intent(out)                    :: rnorm
    real(wp),dimension(n),intent(inout)     :: w
    real(wp),dimension(m),intent(inout)     :: zz
    integer,intent(out)                     :: mode
    integer,intent(in)                      :: max_iter !! maximum number of iterations
                                                        !! (if <=0, then `3*n` is used)

    integer,dimension(n) :: index
    integer :: ierr
    integer :: nsetp
    real(wp),dimension(2,n) :: bnd  !! BND(1,J) is the lower bound for X(J).
                                    !! BND(2,J) is the upper bound for X(J).

    ! set bounds for nnls:
    bnd(1,:) = 0.0_wp
    bnd(2,:) = huge(0.0_wp)

    call bvls (a, b, bnd, x, rnorm, nsetp, w, index, ierr, max_iter)

    select case (ierr)
    case(0)
        mode = 1
    case(1:2)
        mode = 2
    case(3)
        ! doesn't exist in nnls... but will never happen because
        ! we are setting bounds above
        mode = -999
    case(4)
        mode = 3
    case default
        mode = -9999
        !error stop 'unknown output from bvls'
    end select

    end subroutine bvls_wrapper