Skip to content

Commit

Permalink
Revert "Adding Distributions.jl as spaces"
Browse files Browse the repository at this point in the history
This reverts commit 9056ddc.
  • Loading branch information
the-one-and-only-jackson committed Jun 1, 2023
1 parent 79759ce commit 9aa4eff
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,3 @@ function clamp end

bounds(i::AbstractInterval) = (infimum(i), supremum(i))
Base.clamp(x, i::AbstractInterval) = IntevalSets.clamp(x, i)


# Treat distributions as spaces
function SpaceStyle(d::T) where {T <: Distribution}
return Distributions.value_support(d) == Discrete ? FiniteSpaceStyle : ContinuousSpaceStyle
end

Base.in(x, d::Distribution) = insupport(d, x)

function Base.clamp(x, d::Distribution)
@assert SpaceStyle(d) == Continuous "clamp requires a ContinuousSpaceStyle"
return clamp.(x, extrema(d)...)
end

function bounds(d::Distribution)
@assert SpaceStyle(d) == Continuous "Bounds requires a ContinuousSpaceStyle"
return extrema(d)
end

0 comments on commit 9aa4eff

Please sign in to comment.