sign_gt Function

public pure function sign_gt(iLutI, iLutJ) result(bGt)

Arguments

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

Return Value logical


Contents

Source Code


Source Code

    pure function sign_gt(ilutI, ilutJ) result(bGt)

        ! This is a comparison function between two bit strings of length
        ! 0:NIfTot, and will return true if the abs sign of ilutI is greater
        ! than ilutJ

        integer(n_int), intent(in) :: iLutI(0:), iLutJ(0:)
        logical :: bGt
        real(dp) :: SignI(lenof_sign), SignJ(lenof_sign)
        real(dp) :: WeightI, WeightJ

        call extract_sign(ilutI, SignI)
        call extract_sign(ilutJ, SignJ)

        if (lenof_sign == 1) then
            bGt = abs(SignI(1)) > abs(SignJ(1))
        else
            WeightI = sqrt(real(SignI(1), dp)**2 + &
                           real(SignI(lenof_sign), dp)**2)
            WeightJ = sqrt(real(SignJ(1), dp)**2 + &
                           real(SignJ(lenof_sign), dp)**2)

            bGt = WeightI > WeightJ
        end if
    end function sign_gt