juliaintervals / intervalconstraintprogramming.jl Goto Github PK
View Code? Open in Web Editor NEWCalculate rigorously the feasible region for a set of real-valued inequalities with Julia
License: Other
Calculate rigorously the feasible region for a set of real-valued inequalities with Julia
License: Other
E.g.
x = Variable(:x)
y = Variable(:y)
Then
x + y <= 3
becomes a constraint object.
e.g.
a = f(a)
a = f(a)
It is not clear what syntax to use to distinguish variables (that specify the dimensions of the space that the feasible region lives in) and parameters (basically, constants that are specified externally).
Maybe
S = @constraint(c, 1 <= (x - c)^2 <= 3 )
The last argument is the constraint; the others specify that those variables are parameters.
Then S(1)
should be the constraint specialised with c = 1
etc.
And add a show
method for the result of @function
.
julia> X = IntervalBox(-100..100, 2)
[-100, 100] × [-100, 100]
julia> C = @constraint x*y==0
Separator:
- variables: x, y
- expression: x * y ∈ [0, 0]
julia> C(X)
([0, 0] × ∅, [-100, 100] × [-100, 100])
Bisect them until they are finite.
Add a check to not bisect if nextfloat(a.lo) == a.hi
.
Functions from n variables to 1:
@function f(x, y) = x^2 + y^2
@constraint 1 <= f(x, y) <= 3
@function f(x) = 4x*(1-x)
@constraint 0.1 <= f(f(x)) <= 0.3
Then concrete separator types:
ConstraintSeparator
:
@constraint disc = x^2 + y^2 <= 1 # note position of `@constraint`
Store the name inside the type.
CombinationSeparator
:
e.g. S1 \cap S4
IntervalContractors
package.iseven
, isodd
iseven
of an Interval
bisect
Any other function that just manipulates There are none left.Interval
s or IntervalBox
es.
Forward should take as argument an IntervalBox
, and return an IntervalBox
that is the output, together with a tuple of the intermediate variables.
Backward should take as argument an IntervalBox
and the tuple, and return an IntervalBox
.
Contractor should be parametric on the size of the IntervalBox
es it takes, and forward and backward should type annotate the sizes of the tuples.
Like
for i = 1:10
a = f(a)
end
f(f(x))
This should be doable just using the separator for f?
Make a version of separator that leaves the interval as a variable?
Syntax as in #8.
These should probably become extra arguments of the contractor / separator functions.
Assume intersection by default.
julia> immutable Vol{N}
volume::Float64
end
julia> import Base.*
Instead of
julia> *{N1,N2}(V1::Vol{N1}, V2::Vol{N2}) = Vol{N1+N2}(V1.volume * V2.volume)
* (generic function with 150 methods)
use
@generated *{N1,N2}(V1::Vol{N1}, V2::Vol{N2}) = :(Vol{$(N1+N2)}(V1.volume * V2.volume))
From this notebook
(a, b) = f(x, y)
That does not duplicate contractor.
To be consistent with Luc Jaulin's papers.
Or contractor and contractor!
julia> b
[-1.00001e+16, 1]
julia> x
[-1e+08, 1e+08]
julia> IntervalConstraintProgramming.power_rev(b, x, 3)
([-1.00001e+16, 1],[0, 1],[3, 3])
In particular, allow iterating them.
To minimize name clashes, e.g. __z1
E.g.
@function f(x) = (a = x^2; a+y)
The a
should be uniqued at the moment of generating code (outside the function).
Mark non-existent child with sentinel value -1.
inv(::typeof(+)) = …
Call with
inv(+)(...)
On 0.2 and master; reported by @kriukov.
Done in #78.
Make versions of the backward functions that take interval unions and return interval unions.
So that they operate on a single variable. Move these to ValidatedNumerics.jl.
Make sure to use notation consistent with the IEEE standard 1788-2015.
(This specifies a specific, to my mind strange, order for the arguments.)
Eg +_inv
There is no need to have different names.
Maybe called Paving
Instead of y - exp(x) == 0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.