Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specialize in(x::Union{Sym,Term,Num}, I::TypedEndpointsInterval) #797

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf"
Groebner = "0b43b601-686d-58a3-8a1c-6623616c7cd4"
IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
LambertW = "984bce1d-4616-540c-a9ee-88d1112d94c9"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
Expand Down Expand Up @@ -45,7 +46,9 @@ DocStringExtensions = "0.7, 0.8, 0.9"
DomainSets = "0.5"
Groebner = "0.1, 0.2"
IfElse = "0.1"
IntervalSets = "0.5, 0.6, 0.7"
LaTeXStrings = "1.3"
LambertW = "0.4.5"
jishnub marked this conversation as resolved.
Show resolved Hide resolved
Latexify = "0.11, 0.12, 0.13, 0.14, 0.15"
MacroTools = "0.5"
Metatheory = "1.2.0"
Expand All @@ -62,7 +65,6 @@ StaticArrays = "1.1"
SymbolicUtils = "0.18, 0.19"
TermInterface = "0.2, 0.3"
TreeViews = "0.3"
LambertW = "0.4.5"
julia = "1.6"

[extras]
Expand Down
8 changes: 5 additions & 3 deletions src/domains.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import DomainSets: Domain, Interval, AbstractInterval
import IntervalSets: Interval, AbstractInterval, TypedEndpointsInterval
import DomainSets: Domain
import Symbolics: value, Sym, Term, Num

struct VarDomainPairing
variables
domain::Domain
end

Base.:∈(variable::Union{Sym,Term,Num},domain::Domain) = VarDomainPairing(value(variable),domain)
Base.:∈(variable::Union{Sym,Term,Num},domain::Interval) = VarDomainPairing(value(variable),domain)
for D in [:Domain, :Interval, :TypedEndpointsInterval]
@eval Base.:∈(variable::Union{Sym,Term,Num},domain::$D) = VarDomainPairing(value(variable),domain)
end

# Construct Interval domain from a Tuple
Base.:∈(variable::Union{Sym,Term,Num},domain::NTuple{2,Real}) = VarDomainPairing(variable,Interval(domain...))
Expand Down