Skip to content

Commit

Permalink
small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Oct 22, 2016
1 parent fb82733 commit 142a3c0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -294,17 +294,16 @@ function (::Type{CDDGeneratorMatrix{N,T,S}}){N,T,S}(;rays=nothing, points=nothin
end

nvreps(matrix::CDDGeneratorMatrix) = length(matrix)
function nrays(matrix::CDDGeneratorMatrix)
function npoints(matrix::CDDGeneratorMatrix)
count = 0
for i in 1:length(matrix)
b = extractrow(matrix, i)
if isray(b)
if isrowpoint(matrix, i)
count += 1
end
end
count
end
npoints(matrix::CDDGeneratorMatrix) = length(matrix) - nrays(matrix)
nrays(matrix::CDDGeneratorMatrix) = length(matrix) - npoints(matrix)

startvrep(ext::CDDGeneratorMatrix) = 1
donevrep(ext::CDDGeneratorMatrix, state) = state > length(ext)
Expand All @@ -323,7 +322,6 @@ function nextpoint(ext::CDDGeneratorMatrix, i, n)
i
end


startray(ext::CDDGeneratorMatrix) = nextray(ext, 1, length(ext))
doneray(ext::CDDGeneratorMatrix, state) = state > length(ext)
nextray(ext::CDDGeneratorMatrix, state) = (extractrow(ext, state), nextray(ext, state+1, length(ext)))
Expand Down

0 comments on commit 142a3c0

Please sign in to comment.