DetBitEQ Function

public pure function DetBitEQ(iLutI, iLutJ, nLast, t_hphf_in) result(res)

Arguments

Type IntentOptional Attributes Name
integer(kind=n_int), intent(in) :: iLutI(0:)
integer(kind=n_int), intent(in) :: iLutJ(0:)
integer, intent(in), optional :: nLast
logical, intent(in), optional :: t_hphf_in

Return Value logical


Contents

Source Code


Source Code

    pure function DetBitEQ(iLutI, iLutJ, nLast, t_hphf_in) result(res)
        integer(kind=n_int), intent(in) :: iLutI(0:), iLutJ(0:)
        integer, intent(in), optional :: nLast
        logical, intent(in), optional :: t_hphf_in
        logical :: res, t_hphf
        integer :: i, lnLast
        integer(n_int) :: ilut_hphf(0:niftot)

        if (present(t_hphf_in)) then
            t_hphf = t_hphf_in
        else
            t_hphf = .false.
        end if

        if (t_hphf) then
            ilut_hphf = return_hphf_sym_det(ilutJ)

            if (present(nLast)) then
                lnLast = nLast
            else
                lnLast = nifd
            end if

            if (.not. (all(ilutI(0:lnLast) == ilutJ(0:lnLast)) .or. &
                       all(ilutI(0:lnLast) == ilut_hphf(0:lnLast)))) then

                res = .false.
                return
            end if
        else
            if (iLutI(0) /= iLutJ(0)) then
                res = .false.
                return
            else
                if (present(nLast)) then
                    lnLast = nLast
                else
                    lnLast = nifd
                end if

                do i = 1, lnLast
                    if (iLutI(i) /= iLutJ(i)) then
                        res = .false.
                        return
                    end if
                end do
            end if
        end if

        res = .true.

    end function DetBitEQ