Wrapper for dsm to compute the sparsity pattern partition.
| Type | Intent | Optional | 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 |
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