From 8c84d431e556878eb9dccff93ae5d8ac7f5126ae Mon Sep 17 00:00:00 2001 From: Zejin Shi Date: Wed, 27 Jun 2018 17:47:06 +0900 Subject: [PATCH] Update deprecations. --- src/vertex_enumeration.jl | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/vertex_enumeration.jl b/src/vertex_enumeration.jl index f4983801..984d991e 100644 --- a/src/vertex_enumeration.jl +++ b/src/vertex_enumeration.jl @@ -1,7 +1,7 @@ import Polyhedra: hyperplane function vertex_enumeration(g::NormalFormGame{2}; - plib=getlibraryfor(2, Float64)) + plib=SimplePolyhedraLibrary{Float64}()) c = Channel(0) task = vertex_enumeration_task(c, g, plib) @@ -37,12 +37,12 @@ function _vertex_enumeration_producer{T}(c::Channel, ZERO_LABELING_BITS = (1 << (n+m)) - (1 << m) COMPLETE_LABELING_BITS = 1 << (n+m) - 1 - for v1 in vreps(V1) + for v1 in points(V1) labelings_bits1 = labelings_bits(v1, H1) if labelings_bits1 == ZERO_LABELING_BITS continue end - for v2 in vreps(V2) + for v2 in points(V2) labelings_bits2 = labelings_bits(v2, H2) if xor(labelings_bits1, labelings_bits2) == COMPLETE_LABELING_BITS put!(c, (_get_mixed_action(v1), @@ -64,9 +64,9 @@ function construction_BRP{T}(g::NormalFormGame{2, T}, plib) b1 = Vector{T}(n+m) b1[1:m] = one(T) b1[m+1:end] = zero(T) - H1 = SimpleHRepresentation(C, b1) + H1 = hrep(C, b1) p1 = polyhedron(H1, plib) - V1 = SimpleVRepresentation(p1) + V1 = vrep(p1) # create Representation for player 2 D = Matrix{T}(n+m, m) @@ -75,16 +75,16 @@ function construction_BRP{T}(g::NormalFormGame{2, T}, plib) b2 = Vector{T}(n+m) b2[1:m] = zero(T) b2[m+1:end] = one(T) - H2 = SimpleHRepresentation(D, b2) + H2 = hrep(D, b2) p2 = polyhedron(H2, plib) - V2 = SimpleVRepresentation(p2) + V2 = vrep(p2) return H1, V1, H2, V2 end function labelings_bits(v::VRepElement, p::HRep) b = 0 - for (i, h) in enumerate(hreps(p)) + for (i, h) in enumerate(halfspaces(p)) if v in hyperplane(h) b += 1 << (i-1) end @@ -95,3 +95,4 @@ end function _get_mixed_action(a::Vector) return a ./ sum(a) end +