DetBitLT Function

public pure function DetBitLT(iLutI, iLutJ, nLast)

Arguments

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

Return Value integer


Contents

Source Code


Source Code

    pure integer function DetBitLT(iLutI, iLutJ, nLast)
        integer, intent(in), optional :: nLast
        integer(kind=n_int), intent(in) :: iLutI(0:NIfTot), iLutJ(0:NIfTot)
        integer :: i, lnLast

        !First, compare first integers
        IF (iLutI(0) < iLutJ(0)) THEN
            DetBitLT = 1
        else if (iLutI(0) == iLutJ(0)) THEN
            ! If the integers are the same, then cycle through the rest of
            ! the integers until we find a difference.
            ! If we don't want to consider all the integers, specify nLast
            if (present(nLast)) then
                lnLast = nLast
            else
                lnLast = nifd
            end if
            do i = 1, lnLast
                IF (iLutI(i) < iLutJ(i)) THEN
                    DetBitLT = 1
                    RETURN
                else if (iLutI(i) > iLutJ(i)) THEN
                    DetBitLT = -1
                    RETURN
                end if
            end do

            DetBitLT = 0
        ELSE
            DetBitLT = -1
        end if

    END FUNCTION DetBitLT