Skip to content

Commit

Permalink
Support keywords for redundancy removal (#74)
Browse files Browse the repository at this point in the history
* README updates

* Fix new test

* nightly -> 1.6
  • Loading branch information
blegat authored Apr 14, 2022
1 parent a5d8929 commit 54b455b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ jobs:
- version: '1'
os: windows-latest
arch: x86
- version: 'nightly'
- version: '1.6'
os: ubuntu-latest
arch: x64
- version: 'nightly'
- version: '1.6'
os: macOS-latest
arch: x64
- version: 'nightly'
- version: '1.6'
os: windows-latest
arch: x64
- version: 'nightly'
- version: '1.6'
os: ubuntu-latest
arch: x86
- version: 'nightly'
- version: '1.6'
os: windows-latest
arch: x86
steps:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
| [![Build Status][build-img]][build-url] | [![DOI][zenodo-img]][zenodo-url] |
| [![Codecov branch][codecov-img]][codecov-url] | |

CDDLib is a wrapper for [cdd](https://www.inf.ethz.ch/personal/fukudak/cdd_home/).
CDDLib is a wrapper for [cdd](https://www.inf.ethz.ch/personal/fukudak/cdd_home/).

This package can either be used in a "lower level" using the API of cdd or using the
This package can either be used in a "lower level" using the API of cdd or using the
higher level interface of [Polyhedra](https://github.com/JuliaPolyhedra/Polyhedra.jl).

## Problem description
Expand Down Expand Up @@ -40,7 +40,7 @@ Pkg.add("CDDLib")
```

Building the package will download binaries of [`cddlib`](https://github.com/cddlib/cddlib)
that are compiled by [cddlibBuilder](https://github.com/JuliaPolyhedra/cddlibBuilder/).
that are provided by [cddlib_jll.jl](https://github.com/JuliaBinaryWrappers/cddlib_jll.jl).

## Use with JuMP

Expand All @@ -52,7 +52,7 @@ model = Model(CDDLib.Optimizer{Float64})

## Use with MathOptInterface

CDD can also solve problems using `Rational{BigInt}` arithmetic.
CDD can also solve problems using `Rational{BigInt}` arithmetic.

Use `CDDLib.Optimizer{Rational{BigInt}}` to use CDDLib with [MathOptInterface](https://github.com/jump-dev/MathOptInterface.jl):
```julia
Expand Down
8 changes: 4 additions & 4 deletions src/polyhedron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ end
# FIXME `hchebyshevcenter` needs a floating point solver so it may give
# `Optimizer{Cdouble}` here for `Polyhedron{Rational{BigInt}}` but we are just
# going to use `Optimizer{Rational{BigInt}}` instead.
function Polyhedra.detecthlinearity!(p::Polyhedron{T}, solver::Type{<:Optimizer}=Optimizer{T}) where T
function Polyhedra.detecthlinearity!(p::Polyhedron{T}, solver::Type{<:Optimizer}=Optimizer{T}; kws...) where T
if !p.hlinearitydetected
canonicalizelinearity!(getine(p))
p.hlinearitydetected = true
Expand All @@ -214,7 +214,7 @@ function Polyhedra.detecthlinearity!(p::Polyhedron{T}, solver::Type{<:Optimizer}
p.poly = nothing
end
end
function Polyhedra.detectvlinearity!(p::Polyhedron{T}, solver::Type{<:Optimizer}=Optimizer{T}) where T
function Polyhedra.detectvlinearity!(p::Polyhedron{T}, solver::Type{<:Optimizer}=Optimizer{T}; kws...) where T
if !p.vlinearitydetected
canonicalizelinearity!(getext(p))
p.vlinearitydetected = true
Expand All @@ -228,7 +228,7 @@ function Polyhedra.detectvlinearity!(p::Polyhedron{T}, solver::Type{<:Optimizer}
end


function Polyhedra.removehredundancy!(p::Polyhedron)
function Polyhedra.removehredundancy!(p::Polyhedron; kws...)
if !p.noredundantinequality
if !p.hlinearitydetected
canonicalize!(getine(p))
Expand All @@ -242,7 +242,7 @@ function Polyhedra.removehredundancy!(p::Polyhedron)
end
end

function Polyhedra.removevredundancy!(p::Polyhedron)
function Polyhedra.removevredundancy!(p::Polyhedron; kws...)
if !p.noredundantgenerator
canonicalize!(getext(p))
p.noredundantgenerator = true
Expand Down

0 comments on commit 54b455b

Please sign in to comment.