Skip to content

Commit

Permalink
remove copy method again
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Jan 17, 2019
1 parent b1f2b85 commit 20b5b5a
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions src/HPolyhedron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ using MathProgBase, GLPKMathProgInterface

import Base: isempty,
rand,
convert,
copy
convert

export HPolyhedron,
dim, σ, ,
Expand Down Expand Up @@ -438,8 +437,10 @@ A new polyhedron obtained by removing the redundant constraints in `P`.
See `remove_redundant_constraints!`.
"""
function remove_redundant_constraints(P::PT;
backend=GLPKSolverLP()) where {N, PT<:HPoly{N}}
return remove_redundant_constraints!(copy(P), backend=backend)
backend=GLPKSolverLP()
) where {N, PT<:HPoly{N}}
return remove_redundant_constraints!(PT(copy(constraints_list(P))),
backend=backend)
end

"""
Expand Down Expand Up @@ -537,23 +538,6 @@ function linear_map(M::AbstractMatrix{N}, P::PT) where {N<:Real, PT<:HPoly{N}}
return PT(constraints)
end

"""
copy(P::PT) where {N, PT<:HPoly{N}}
Create a copy of a polyhedron.
### Input
- `P` -- polyhedron
### Output
The polyhedron obtained by copying the constraints in `P` using `Base.copy`.
"""
function copy(P::PT) where {N, PT<:HPoly{N}}
return PT(copy(P.constraints))
end

# ========================================================
# External methods that require Polyhedra.jl to be loaded
# ========================================================
Expand Down

0 comments on commit 20b5b5a

Please sign in to comment.