Skip to content

Commit f50ffcc

Browse files
committed
fixed a bug where the sparsity pattern was being modified
1 parent c074161 commit f50ffcc

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/numerical_differentiation_module.f90

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,9 @@ subroutine set_sparsity_pattern(me,irow,icol)
11031103
s%ngrp,s%maxgrp,&
11041104
mingrp,info,ipntr,jpntr)
11051105
if (info/=1) error stop 'Error partitioning sparsity pattern.'
1106+
! restore the original one, since it is used elsewhere:
1107+
s%irow = irow
1108+
s%icol = icol
11061109
end associate
11071110
end if
11081111

@@ -1803,7 +1806,7 @@ subroutine print_sparsity(me,n,m,iunit,dense)
18031806

18041807
implicit none
18051808

1806-
class(sparsity_pattern),intent(inout) :: me
1809+
class(sparsity_pattern),intent(in) :: me
18071810
integer,intent(in) :: n !! number of variables (columns of jacobian)
18081811
integer,intent(in) :: m !! number of functions (rows of jacobian)
18091812
integer,intent(in) :: iunit !! file unit to write to.

0 commit comments

Comments
 (0)