@@ -613,27 +613,27 @@ function distance_to_set(
613613 distance:: ProjectionUpperBoundDistance ,
614614 x:: AbstractVector{T} ,
615615 set:: MOI.Indicator{MOI.ACTIVATE_ON_ONE} ,
616- ) where {T<: Real }
616+ ) where {T<: Number }
617617 _check_dimension (x, set)
618618 return min (
619619 # Distance of x[1] from 0
620620 abs (x[1 ]),
621621 # Distance of x[1] from 1 + distance to set
622- sqrt ((1 - x[1 ])^ 2 + distance_to_set (distance, x[2 ], set. set)^ 2 ),
622+ sqrt (abs (1 - x[1 ])^ 2 + distance_to_set (distance, x[2 ], set. set)^ 2 ),
623623 )
624624end
625625
626626function distance_to_set (
627627 distance:: ProjectionUpperBoundDistance ,
628628 x:: AbstractVector{T} ,
629629 set:: MOI.Indicator{MOI.ACTIVATE_ON_ZERO} ,
630- ) where {T}
630+ ) where {T<: Number }
631631 _check_dimension (x, set)
632632 return min (
633633 # Distance of x[1] from 1
634634 abs (one (T) - x[1 ]),
635635 # Distance of x[1] from 0 + distance to set
636- sqrt (x[1 ]^ 2 + distance_to_set (distance, x[2 ], set. set)^ 2 ),
636+ sqrt (abs ( x[1 ]) ^ 2 + distance_to_set (distance, x[2 ], set. set)^ 2 ),
637637 )
638638end
639639
@@ -647,7 +647,7 @@ function distance_to_set(
647647 :: ProjectionUpperBoundDistance ,
648648 x:: AbstractVector{T} ,
649649 set:: MOI.NormNuclearCone ,
650- ) where {T}
650+ ) where {T<: Real }
651651 _check_dimension (x, set)
652652 X = reshape (x[2 : end ], set. row_dim, set. column_dim)
653653 return max (sum (LinearAlgebra. svdvals (X)) - x[1 ], zero (T))
@@ -663,7 +663,7 @@ function distance_to_set(
663663 :: ProjectionUpperBoundDistance ,
664664 x:: AbstractVector{T} ,
665665 set:: MOI.NormSpectralCone ,
666- ) where {T}
666+ ) where {T<: Real }
667667 _check_dimension (x, set)
668668 X = reshape (x[2 : end ], set. row_dim, set. column_dim)
669669 return max (maximum (LinearAlgebra. svdvals (X)) - x[1 ], zero (T))
0 commit comments