aprod_test_solver Subroutine

private subroutine aprod_test_solver(me, mode, m, n, x, y)

This is the matrix-vector product routine required by subroutines LSQR and CRAIG for a test matrix of the form A = HYDHZ. The quantities defining D, HY, HZ are in the work array rw, followed by a work array w. These are passed to aprod1 and aprod2 in order to make the code readable.

Type Bound

test_solver

Arguments

Type IntentOptional Attributes Name
class(test_solver), intent(inout) :: me
integer, intent(in) :: mode
integer, intent(in) :: m
integer, intent(in) :: n
real(kind=wp), intent(inout), dimension(:) :: x

dimension n

real(kind=wp), intent(inout), dimension(:) :: y

dimension m


Calls

proc~~aprod_test_solver~~CallsGraph proc~aprod_test_solver lsqrtest_module::test_solver%aprod_test_solver proc~aprod1 lsqrtest_module::test_solver%aprod1 proc~aprod_test_solver->proc~aprod1 proc~aprod2 lsqrtest_module::test_solver%aprod2 proc~aprod_test_solver->proc~aprod2 proc~hprod lsqrtest_module::hprod proc~aprod1->proc~hprod proc~aprod2->proc~hprod

Source Code

    subroutine aprod_test_solver (me, mode, m, n, x, y)

    class(test_solver),intent(inout) :: me
    integer,intent(in) :: mode
    integer,intent(in) :: m
    integer,intent(in) :: n
    real(wp),dimension(:),intent(inout) :: x   !! dimension n
    real(wp),dimension(:),intent(inout) :: y   !! dimension m

    integer :: locd, lochy, lochz, locw, maxmn, minmn

    maxmn  = max( m, n )
    minmn  = min( m, n )
    locd   = 1
    lochy  = locd  + minmn
    lochz  = lochy + m
    locw   = lochz + n

    if (mode == 1) then
        call me%aprod1( m, n, maxmn, minmn, x, y, &
                        me%rw(locd), me%rw(lochy), me%rw(lochz), me%rw(locw) )
    else
        call me%aprod2( m, n, maxmn, minmn, x, y, &
                        me%rw(locd), me%rw(lochy), me%rw(lochz), me%rw(locw) )
    end if

    end subroutine aprod_test_solver