Skip to content

Commit

Permalink
Merge pull request #12 from jverzani/v0.6-7
Browse files Browse the repository at this point in the history
drop v0.4, 5 support
  • Loading branch information
jverzani authored Jan 11, 2018
2 parents bb5850b + b674e55 commit b9bf29e
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![ImplicitEquations](http://pkg.julialang.org/badges/ImplicitEquations_0.4.svg)](http://pkg.julialang.org/?pkg=ImplicitEquations&ver=0.4)
[![ImplicitEquations](http://pkg.julialang.org/badges/ImplicitEquations_0.6.svg)](http://pkg.julialang.org/?pkg=ImplicitEquations&ver=0.6)
 
Linux: [![Build Status](https://travis-ci.org/jverzani/ImplicitEquations.jl.svg?branch=master)](https://travis-ci.org/jverzani/ImplicitEquations.jl)
 
Expand Down
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
julia 0.4
julia 0.6
ForwardDiff 0.3.0
ValidatedNumerics 0.5.0
RecipesBase 0.0.6
Expand Down
17 changes: 10 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
environment:
matrix:
- JULIAVERSION: "julialang/bin/winnt/x86/0.4/julia-0.4-latest-win32.exe"
- JULIAVERSION: "julialang/bin/winnt/x64/0.4/julia-0.4-latest-win64.exe"
- JULIAVERSION: "julialang/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
- JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe"
- JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
matrix:
allow_failures:
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"

branches:
only:
Expand All @@ -19,9 +21,10 @@ notifications:
on_build_status_changed: false

install:
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
# Download most recent Julia Windows binary
- ps: (new-object net.webclient).DownloadFile(
$("http://s3.amazonaws.com/"+$env:JULIAVERSION),
$env:JULIA_URL,
"C:\projects\julia-binary.exe")
# Run installer silently, output to C:\projects\julia
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
Expand Down
14 changes: 7 additions & 7 deletions src/intervals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import Base: <, <=, ==, !==, >=, >,

## a few definitionsn for ValidatedNumerics that don't fit in there:
## Validated numerics doesn't define these, as the order ins't a total order
Base.isless{T<:Real, S<:Real}(i::Interval{T}, j::Interval{S}) = isless(i.hi, j.lo)
<={T<:Real, S<:Real}(i::Interval{T}, j::Interval{S}) = <=(i.hi, j.lo)
Base.isless(i::Interval{T}, j::Interval{S}) where {T<:Real, S<:Real} = isless(i.hi, j.lo)
#<=(i::Interval{T}, j::Interval{S}) where {T<:Real, S<:Real} = <=(i.hi, j.lo)

#Base.max(i::Interval, j::Interval) = Interval(max(i.lo,j.lo), max(i.hi,j.hi))
#Base.min(i::Interval, j::Interval) = Interval(min(i.lo,j.lo), min(i.hi,j.hi))
Expand Down Expand Up @@ -57,18 +57,18 @@ immutable OInterval <: Real
OInterval(val, def, cont) = new(val, def, cont)
end

@compat Base.show(io::IO, o::OInterval) = print(io, "OInterval: ", o.val, " def=", o.def, " cont=",o.cont)
Base.show(io::IO, o::OInterval) = print(io, "OInterval: ", o.val, " def=", o.def, " cont=",o.cont)

## some outer constructors...
OInterval{T <: Real, S <: Real}(a::T, b::S) = OInterval(Interval(a,b), TRUE, TRUE)
OInterval(a::T, b::S) where {T <: Real, S <: Real}= OInterval(Interval(a,b), TRUE, TRUE)
OInterval(a::OInterval, b::OInterval) = a === a ? a : error("a is not b?") ## why is this one necessary?
OInterval(a) = OInterval(a,a) # thin one...
OInterval(i::Interval) = OInterval(i.lo, i.hi)

Base.convert(::Type{OInterval}, i::Interval) = OInterval(i.lo, i.hi)
Base.convert{S<:Real}(::Type{OInterval}, x::S) = OInterval(x)
Base.promote_rule{N,B<:Real}(::Type{OInterval}, ::Type{ForwardDiff.Dual{N,B}}) = warn("defined to remove ambiguity")
Base.promote_rule{A<:Real}(::Type{OInterval}, ::Type{A}) = OInterval
Base.convert(::Type{OInterval}, x::S) where {S<:Real}= OInterval(x)
Base.promote_rule(::Type{OInterval}, ::Type{ForwardDiff.Dual{N,B}}) where {N,B<:Real} = warn("defined to remove ambiguity")
Base.promote_rule(::Type{OInterval}, ::Type{A}) where {A<:Real} = OInterval

## A region is two OIntervals.
immutable Region
Expand Down
45 changes: 20 additions & 25 deletions src/predicates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,26 @@

#f(x,y) < 0 or f(x,y) == 0

import Base: <, <=, ==, !=, !==, >=, >, &, |, !
#import Base: <, <=, ==, !=, !==, >=, >
import Base: &, |, !

abstract Predicate
abstract type Predicate end

"""
A predicate is defined in terms of a function of two variables, an
inquality, and either another function or a real number.
They are conveniently created by the functions `Lt`, `Le`, `Eq`, `Neq`, `Ge`, and `Gt`. The unicode operators
`≪` (`\ll[tab]`), `≦` (`\leqq[tab]`), `⩵` (`\Equal[tab]`), `≶` (`\lessgtr[tab]`) or `≷` (`\gtrless[tab]`), `≧` (`\geqq[tab]`), `≫` (`\leqq[tab]`) may also be used.
inquality, and either another function or a real number. They are
conveniently created by the functions `Lt`, `Le`, `Eq`, `Neq`, `Ge`,
and `Gt`. The equivalent unicode operators:
* `≪` (`\ll[tab]`),
* `≦` (`\leqq[tab]`),
* `⩵` (`\Equal[tab]`),
* `≶` (`\lessgtr[tab]`) or `≷` (`\gtrless[tab]`),
* `≧` (`\geqq[tab]`),
* `≫` (`\leqq[tab]`) may also be used.
For example,
`f < 0` or `f >= g`. The case `f==g` and `f != g` are not defined, as doing so crosses
up `Gadfly` and other code that compares functions for equality. Use
`eq(f,g)` or `f \Equal<tab> g` for equality and `neq(f,g)` or `f \gtrless<tab> g` for not equal.
Available operations to produce predicates:
* `<`
* `<=`, `≤` (`\le<tab>`)
* `==` (`Function == Real`), `eq(f,g)`, `⩵` (`\Equal<tab>`)
* `!==` (`Function != Real`), `neq(f,g)`, `≷` (`\gtrless<tab>`), `≶` (`\lessgtr<tab>`)
* `>=`, `≥` (`\ge<tab>`)
* `>`
The use of Julia's usual comparison operators is no longer supported.
To combine predicates, `&` and `|` can be used.
Expand Down Expand Up @@ -81,7 +76,7 @@ end
# ⩵(f::Function, g::Function) = eq(f,g)


Neq(f::Function, x::Real) = Pred(f, != , x)
Neq(f::Function, x::Real) = Pred(f, !== , x)
Neq(f::Function, g::Function) = Neq((x,y) -> f(x,y) - g(x,y), 0)

(x::Real, y::Real) = (x != y)
Expand All @@ -97,14 +92,14 @@ Neq(f::Function, g::Function) = Neq((x,y) -> f(x,y) - g(x,y), 0)



>=(f::Function, x::Real) = Pred(f, >= , x)
>=(f::Function, g::Function) = Pred((x,y) -> f(x,y) - g(x,y), >= , 0)
#>=(f::Function, x::Real) = Pred(f, >= , x)
#>=(f::Function, g::Function) = Pred((x,y) -> f(x,y) - g(x,y), >= , 0)

>(f::Function, x::Real) = Pred(f, > , x)
>(f::Function, g::Function) = Pred((x,y) -> f(x,y) - g(x,y), > , 0)
#>(f::Function, x::Real) = Pred(f, > , x)
#>(f::Function, g::Function) = Pred((x,y) -> f(x,y) - g(x,y), > , 0)

Base.isless(x::Real, f::Function) = (f >= x)
Base.isless(f::Function, x::Real) = (f < x)
#Base.isless(x::Real, f::Function) = Ge(F, x) #(f >= x)
#Base.isless(f::Function, x::Real) = Lt(f, x) #(f < x)


"""
Expand Down

0 comments on commit b9bf29e

Please sign in to comment.