Skip to content

Commit

Permalink
Catch bad indexing for failing assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
pprcht committed Sep 9, 2024
1 parent 97b1004 commit 162ee28
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/minitools.f90
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ subroutine irmsd_tool(fname1,fname2)
write (stdout,*)

rmsdval = rmsdval*autoaa
write (*,'(1x,a,f16.8)') 'Calculated RMSD (Å):',rmsdval
write (*,'(1x,a,f16.8)') 'Calculated iRMSD (Å):',rmsdval

return
end subroutine irmsd_tool
Expand Down
4 changes: 2 additions & 2 deletions src/sorting/hungarian.f90
Original file line number Diff line number Diff line change
Expand Up @@ -495,15 +495,15 @@ subroutine lsap_cached(lcache,nr,nc,maximize,iostatus)

!> Augment previous solution
j = sink
do jj=1,nc
do jj=1,nc+1 !> avoid infinite loop
i = path(j)
row4col(j) = i
call swap(col4row(i),j)
if (i == curRow) exit
end do
end do

!> Finalize the assignment based on transposition
!> Finalize the assignment
do i = 1,nr
a(i) = i
b(i) = col4row(i)
Expand Down
1 change: 1 addition & 0 deletions src/sorting/irmsd_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ subroutine compute_linear_sum_assignment(ref,mol,ranks, &
do i = 1,rnknat
jj = aptr%a(i)
ii = aptr%b(i)
if(ii == -1 .or. jj == -1) cycle !> cycle bad assignments
val0 = val0+aptr%Cost(jj+(ii-1)*rnknat)
iwork2(i,2) = iwork2(aptr%b(i),1)
end do
Expand Down

0 comments on commit 162ee28

Please sign in to comment.