dsm_wrapper Subroutine

private subroutine dsm_wrapper(me, n, m, info)

Wrapper for dsm to compute the sparsity pattern partition.

Type Bound

sparsity_pattern

Arguments

Type IntentOptional Attributes Name
class(sparsity_pattern), intent(inout) :: me
integer, intent(in) :: n

number of columns of jacobian matrix

integer, intent(in) :: m

number of rows of jacobian matrix

integer, intent(out) :: info

status output from dsm


Calls

proc~~dsm_wrapper~~CallsGraph proc~dsm_wrapper sparsity_pattern%dsm_wrapper proc~compute_group_index sparsity_pattern%compute_group_index proc~dsm_wrapper->proc~compute_group_index proc~dsm dsm proc~dsm_wrapper->proc~dsm proc~get_partition_pattern sparsity_pattern%get_partition_pattern proc~dsm_wrapper->proc~get_partition_pattern proc~degr degr proc~dsm->proc~degr proc~ido ido proc~dsm->proc~ido proc~numsrt numsrt proc~dsm->proc~numsrt proc~seq seq proc~dsm->proc~seq proc~setr setr proc~dsm->proc~setr proc~slo slo proc~dsm->proc~slo proc~srtdat srtdat proc~dsm->proc~srtdat proc~ido->proc~numsrt

Called by

proc~~dsm_wrapper~~CalledByGraph proc~dsm_wrapper sparsity_pattern%dsm_wrapper proc~compute_sparsity_random compute_sparsity_random proc~compute_sparsity_random->proc~dsm_wrapper proc~compute_sparsity_random_2 compute_sparsity_random_2 proc~compute_sparsity_random_2->proc~dsm_wrapper proc~set_sparsity_pattern numdiff_type%set_sparsity_pattern proc~set_sparsity_pattern->proc~dsm_wrapper

Source Code

    subroutine dsm_wrapper(me,n,m,info)

    implicit none

    class(sparsity_pattern),intent(inout) :: me
    integer,intent(in)  :: n     !! number of columns of jacobian matrix
    integer,intent(in)  :: m     !! number of rows of jacobian matrix
    integer,intent(out) :: info  !! status output from [[dsm]]

    integer :: mingrp !! for call to [[dsm]]
    integer,dimension(:),allocatable :: ipntr  !! for call to [[dsm]]
    integer,dimension(:),allocatable :: jpntr  !! for call to [[dsm]]
    integer,dimension(:),allocatable :: irow   !! for call to [[dsm]]
                                               !! (temp copy since [[dsm]]
                                               !! will modify it)
    integer,dimension(:),allocatable :: icol   !! for call to [[dsm]]
                                               !! (temp copy since [[dsm]]
                                               !! will modify it)

    allocate(ipntr(m+1))
    allocate(jpntr(n+1))
    if (allocated(me%ngrp)) deallocate(me%ngrp)
    allocate(me%ngrp(n))
    call me%get_partition_pattern(irow,icol)

    if (size(irow)==0) then
        ! no elements (e.g., the functions do not depend on x),
        ! so all the columns can be in one group:
        ! [dsm does not accept an empty pattern]
        me%maxgrp = 1
        me%ngrp = 1
        info = 1
        call me%compute_group_index()
        return
    end if

    call dsm(m,n,size(irow),&
             irow,icol,&
             me%ngrp,me%maxgrp,&
             mingrp,info,ipntr,jpntr)

    if (info==1) call me%compute_group_index()

    end subroutine dsm_wrapper