getPlus_semiStart Function

public function getPlus_semiStart(nSwitches, bVal, semiStart) result(plusWeight)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: nSwitches
real(kind=dp), intent(in) :: bVal
type(WeightData_t), intent(in) :: semiStart

Return Value real(kind=dp)


Contents

Source Code


Source Code

    function getPlus_semiStart(nSwitches, bVal, semiStart) result(plusWeight)
        real(dp), intent(in) :: nSwitches, bVal
        type(WeightData_t), intent(in) :: semiStart
        real(dp) :: plusWeight
        character(*), parameter :: this_routine = "getPlus_semiStart"

        ASSERT(nSwitches >= 0.0_dp)
        ! just set +1 branch probability to 0 if b == 0

        if (near_zero(bVal)) then
            plusWeight = 0.0_dp
        else
            plusWeight = semiStart%G * semiStart%zero + semiStart%F * semiStart%plus + &
                         nSwitches / bVal * (semiStart%G * semiStart%minus + semiStart%F * semiStart%zero)
        end if

        ASSERT(plusWeight >= 0.0_dp)

    end function getPlus_semiStart