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

Dimension error for default Polyhedra backend in >= v0.7 #842

Closed
schillic opened this issue Oct 21, 2018 · 2 comments
Closed

Dimension error for default Polyhedra backend in >= v0.7 #842

schillic opened this issue Oct 21, 2018 · 2 comments
Assignees
Labels
bug 🐛 Something isn't working

Comments

@schillic
Copy link
Member

With #831 we introduced a misuse in the default backend of Polyhedra: Here we should not pass 2 but dim(P) (and the same a few lines below). The problem is that we do not have P here...

@schillic schillic added bug 🐛 Something isn't working discussion 🗣️ Requires human input labels Oct 21, 2018
@mforets
Copy link
Member

mforets commented Oct 21, 2018

yes, i hardcoded 2 in default_polyhedra_backend because the default_library for d > 1 does not depend on d, there is just one DefaultLibrary{_default_type(T)}(), see this function.

presumably the default interval library is specialized for interval computations, and i would expect that the general library also works for d=1 (but i havent' checked).

if we want we can still update our functions passing P as well, eg.

function convex_hull(P1::HPoly{N},
                     P2::HPoly{N};
                     backend=default_polyhedra_backend(P1, N)) where {N}
    @assert isdefined(Main, :Polyhedra) "the function `convex_hull` needs " *
                                        "the package 'Polyhedra' to be loaded"
    Pch = convexhull(polyhedron(P1, backend), polyhedron(P2, backend))
    return convert(typeof(P1), Pch)
end

...

    function default_polyhedra_backend(P, N::Type{<:AbstractFloat})
        return default_library(LazySets.dim(P), Float64)
    end

@schillic
Copy link
Member Author

i would expect that the general library also works for d=1 (but i havent' checked).

There are problems with 1-dimensional cases, see #843.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants