Skip to content

Commit

Permalink
Merge pull request #218 from JuliaReach/schillic/212
Browse files Browse the repository at this point in the history
#212 - use ngens function
  • Loading branch information
Marcelo Forets authored Feb 5, 2018
2 parents 2a5f52f + 9aa040e commit 6474bbc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Zonotope.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ For high dimensions, it would be preferable to develop a `vertex_iterator`
approach.
"""
function vertices_list(Z::Zonotope{N})::Vector{Vector{N}} where {N<:Real}
p = size(Z.generators, 2)
p = ngens(Z)
vlist = Vector{Vector{N}}()
sizehint!(vlist, 2^p)

Expand Down Expand Up @@ -258,7 +258,7 @@ The order of a zonotope is defined as the quotient of its number of generators
and its dimension.
"""
function order(Z::Zonotope)::Rational
return size(Z.generators, 2) // dim(Z)
return ngens(Z) // dim(Z)
end

"""
Expand Down
2 changes: 1 addition & 1 deletion src/is_intersection_empty.jl
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ function is_intersection_empty(Z::Zonotope{N},
witness::Bool=false
)::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}
v = H.b - dot(H.a, Z.center)
abs_sum = sum(abs(dot(H.a, Z.generators[:, i])) for i = 1:size(Z.generators, 2))
abs_sum = sum(abs(dot(H.a, Z.generators[:, i])) for i = 1:ngens(Z))
empty_intersection = v < -abs_sum || v > abs_sum

if !witness
Expand Down

0 comments on commit 6474bbc

Please sign in to comment.