I am a bit confused as I am running my code to do scalar-vector multiplication using u = v * scalar and v = scalar * u
I thought the following code would give me ambiguous declaration for the generic '*'. How are the functions vsm_real32, vsm_real64, and vsm_real128 not conflicting with function svm?
Procedure :: vsm_real32, vsm_real64, &
vsm_real128
Procedure, Pass (tb) :: svm
Generic :: Operator (*) => vsm_real32, &
vsm_real64, vsm_real128, &
svm
Contains
Function vsm_real32 (tb, sc_real32) Result (ta)
Type (Vector) :: ta
Class (Vector), Intent (In) :: tb
Real (Real32), Intent (In) :: sc_real32
Call vsmd (ta, tb, sc_real32, "*")
End Function vsm_real32
Function vsm_real64 (tb, sc_real64) Result (ta)
Type (Vector) :: ta
Class (Vector), Intent (In) :: tb
Real (Real64), Intent (In) :: sc_real64
Call vsmd (ta, tb, sc_real64, "*")
End Function vsm_real64
Function vsm_real128 (tb, sc_real128) Result (ta)
Type (Vector) :: ta
Class (Vector), Intent (In) :: tb
Real (Real128), Intent (In) :: sc_real128
Call vsmd (ta, tb, sc_real128, "*")
End Function vsm_real128
Function svm (sc, tb) Result (ta)
Type (Vector) :: ta
Class (*), Intent (In) :: sc
Class (Vector), Intent (In) :: tb
Call vsmd (ta, tb, sc, "*")
End Function svm