generator_sign Function

public pure function generator_sign(i, j, k, l) result(sgn)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: i
integer, intent(in) :: j
integer, intent(in) :: k
integer, intent(in) :: l

Return Value real(kind=dp)


Contents

Source Code


Source Code

    pure function generator_sign(i, j, k, l) result(sgn)
        integer, intent(in) :: i, j, k, l
        real(dp) :: sgn

        ! standard value. only for double raising and lowering a -1 can happen
        sgn = 1.0_dp
        if (i < j .and. k < l) then
            ! double raising
            ! make rudimentary now.. think of increasing speed later
            if (i < k) then
                if (l < j) then
                    sgn = -1.0_dp
                end if
            else if (k < i) then
                if (j < l) then
                    sgn = -1.0_dp
                end if
            end if
        else if (j < i .and. l < k) then
            ! double lowering
            if (j < l) then
                if (k < i) then
                    sgn = -1.0_dp
                end if
            else if (l < j) then
                if (i < k) then
                    sgn = -1.0_dp
                end if
            end if
        end if

    end function generator_sign