Skip to content

Commit

Permalink
Merge branch 'integration'
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Doolittle committed May 28, 2020
2 parents 36e146a + 08da4f3 commit b02fe80
Show file tree
Hide file tree
Showing 15 changed files with 1,155 additions and 58 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "XPORTA"
uuid = "8c143463-af6f-456f-8aed-72447cb569d2"
authors = ["Brian Doolittle"]
version = "0.1.0"
version = "0.1.1"

[deps]
PORTA_jll = "c3fa2e09-48e0-5371-872a-ed3ac32dd1fc"
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

| Documentation | Test Coverage | Linux/Mac | Windows | FreeBSD |
|:-------------:|:-------------:|:---------:|:-------:|:-------:|
|[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaPolyhedra.github.io/XPORTA.jl/dev) | [![Coverage Status](https://coveralls.io/repos/github/JuliaPolyhedra/XPORTA.jl/badge.svg?branch=master)](https://coveralls.io/github/JuliaPolyhedra/XPORTA.jl?branch=master)[![codecov](https://codecov.io/gh/JuliaPolyhedra/XPORTA.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaPolyhedra/XPORTA.jl) | [![Linux/Mac Build Status](https://travis-ci.org/JuliaPolyhedra/XPORTA.jl.svg?branch=master)](https://travis-ci.org/github/JuliaPolyhedra/XPORTA.jl) | [![Windows Build status](https://ci.appveyor.com/api/projects/status/2kjsbavtulwhsamu?svg=true)](https://ci.appveyor.com/project/bdoolittle/xporta-jl) | [![FreeBSD Build Status](https://api.cirrus-ci.com/github/JuliaPolyhedra/XPORTA.jl.svg)](https://cirrus-ci.com/github/JuliaPolyhedra/XPORTA.jl) |
|[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaPolyhedra.github.io/XPORTA.jl/stable) [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaPolyhedra.github.io/XPORTA.jl/dev) | [![Coverage Status](https://coveralls.io/repos/github/JuliaPolyhedra/XPORTA.jl/badge.svg?branch=master)](https://coveralls.io/github/JuliaPolyhedra/XPORTA.jl?branch=master)[![codecov](https://codecov.io/gh/JuliaPolyhedra/XPORTA.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaPolyhedra/XPORTA.jl) | [![Linux/Mac Build Status](https://travis-ci.org/JuliaPolyhedra/XPORTA.jl.svg?branch=master)](https://travis-ci.org/github/JuliaPolyhedra/XPORTA.jl) | [![Windows Build status](https://ci.appveyor.com/api/projects/status/2kjsbavtulwhsamu?svg=true)](https://ci.appveyor.com/project/bdoolittle/xporta-jl) | [![FreeBSD Build Status](https://api.cirrus-ci.com/github/JuliaPolyhedra/XPORTA.jl.svg)](https://cirrus-ci.com/github/JuliaPolyhedra/XPORTA.jl) |

## Documentation

* XPORTA.jl documentation is published at [JuliaPolyhedra.github.io/XPORTA.jl/dev/](https://JuliaPolyhedra.github.io/XPORTA.jl/dev/).
* PORTA documentation is easily accessible at [github.com/bdoolittle/julia-porta](https://github.com/bdoolittle/julia-porta).
* PORTA source code may be downloaded from [http://porta.zib.de](http://porta.zib.de/).
* XPORTA.jl documentation: [JuliaPolyhedra.github.io/XPORTA.jl/dev/](https://JuliaPolyhedra.github.io/XPORTA.jl/stable/).
* PORTA documentation: [github.com/bdoolittle/julia-porta](https://github.com/bdoolittle/julia-porta).
* Official PORTA software: [http://porta.zib.de](http://porta.zib.de/).

## Licensing

Expand Down
6 changes: 4 additions & 2 deletions docs/src/Internals/binaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ run_xporta

## valid

!!! danger "Not Implemented"
Please reach out if you are interested in the `valid` subroutines.
```@docs
run_valid
iespo
```
12 changes: 12 additions & 0 deletions docs/src/exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ IEQ

## Methods

!!! note "Temp Files"
By default, files created by the PORTA binaries are deleted. When performing
longer computations with PORTA, it may be desirable to keep intermediate files.
The argument, `cleanup = false`, causes XPORTA.jl methods to write files to
the directory specified by the `dir` argument.

```@docs
traf
dim
fmel
vint
portsort
posie
fctp
```
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ PORTA and XPORTA.jl are licensed under the GNU General Public License (GPL) v2.0

## Acknowledgments

Development of Porta.jl was made possible by the advisory
Development of XPORTA.jl was made possible by the advisory
of Dr. Eric Chitambar and general support from the Physics Department at the
University of Illinois Urbana-Champaign. Funding was provided by NSF Award 1914440.

Expand Down
21 changes: 16 additions & 5 deletions src/XPORTA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@ historical names from the PORTA software.
# Exports
- [`POI`](@ref) - *Type*, The vertex representation of a polyhedra.
- [`IEQ`](@ref) - *Type*, The intersecting halfspace representation of a polyhedra.
- [`traf`](@ref) - *Method*, Converts a `POI` -> `IEQ` or `IEQ` -> `POI`.
*Types*
- [`POI`](@ref) - The vertex representation of a polyhedra.
- [`IEQ`](@ref) - The intersecting halfspace representation of a polyhedra.
*Methods*
- [`traf`](@ref) - Converts a `POI` -> `IEQ` or `IEQ` -> `POI`.
- [`dim`](@ref) - Given a `POI` computes the dimension and constraining equalities of the `POI` convex hull.
- [`fmel`](@ref) - Projects the linear system of `IEQ` onto a subspace using fourier-motzkin elimination.
- [`vint`](@ref) - Enumerates the integral points which satisfy the linear system specified by an `IEQ`.
- [`portsort`](@ref) - Sorts the elements of `POI` and `IEQ` structs.
- [`posie`](@ref) - Enumerates the points and rays of a `POI` which satisfy the linear system of an `IEQ`.
- [`fctp`](@ref) - Determines if inequalities are tight or violated by elements of a `POI`.
The compiled PORTA binaries are accessed through [PORTA_jll.jl](https://github.com/JuliaBinaryWrappers/PORTA_jll.jl)
Expand All @@ -31,12 +40,14 @@ using PORTA_jll
using Suppressor

export POI, IEQ # types
export traf # xporta methods
export traf, portsort, dim, fmel # xporta methods
export fctp, posie, vint # valid methods

# including local files
include("./types.jl")
include("./filesystem.jl") # utilities for create and removing directories
include("./file_io.jl") # read/write functionality
include("./xporta_subroutines.jl") # wrapper for the xporta binaries.
include("./xporta_subroutines.jl") # wrapper for the xporta binaries.
include("./valid_subroutines.jl") # wrapper for the valid binaries

end # module
9 changes: 5 additions & 4 deletions src/file_io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,13 @@ function read_ieq(filepath::String)::IEQ{Rational{Int}}
end

# match in/equality sign and rhs value
rhs_match = match(r"(<=|=<|>=|=>|==|=)\s*([-+]?)\s*(\d+)", line)
rhs_match = match(r"(<=|=<|>=|=>|==|=)\s*([-+]?)\s*(\d+)(?:/(\d+))?", line)

rel_sign = rhs_match.captures[1]
int_sign = (rhs_match.captures[2] === nothing) ? "+" : rhs_match.captures[2]
rhs_int = parse(Int, int_sign*rhs_match.captures[3])
data_vector[end] = rhs_int
rhs_sign = (rhs_match.captures[2] === nothing) ? "+" : rhs_match.captures[2]
rhs_num = parse(Int, rhs_sign*rhs_match.captures[3])
rhs_den = (rhs_match.captures[4] === nothing) ? 1 : parse(Int, rhs_match.captures[4])
data_vector[end] = Rational(rhs_num, rhs_den)

if (rel_sign == "<=") || (rel_sign == "=<")
push!(inequality_rows, data_vector)
Expand Down
7 changes: 4 additions & 3 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ converted to type `Rational{Int}`.
Fields:
* `conv_section` - each matrix row is a vertex.
* `cone_section` - each matrix row is a ray.
* `valid` - a feasible point for the vertex representation.
* `valid` - a feasible point for the vertex representation. In the context of a `POI`,
this field has no known use.
* `dim` - the dimension of vertices and rays. This field is auto-populated on construction.
A `DomainError` is thrown if the column dimension of rays and vertices is not equal.
Expand Down Expand Up @@ -113,8 +114,8 @@ both have the following form.
`IEQ` Fields:
* `inequalities`: each matrix row is a linear inequality, the first M elements indexed `1:(end-1)` are α and the last element indexed `end` is β.
* `equalities`: each matrix row is linear equality, the first M elements indexed `1:(end-1)` are α and the last element indexed `end` is β.
* `lower_bounds`: each matrix row is a lower bound for enumerating integral points with `vint`.
* `upper_bounds`: each matrix row is an upper bound for enumerating integral points with `vint`.
* `lower_bounds`: a row vector which specifies the lower bound on each individual parameter. Used for enumerating integral points with `vint`.
* `upper_bounds`: a row vector which specifies the upper bound on each individual parameter. Used for enumerating integral points with `vint`.
* `valid`: a feasible point for the linear system.
* `dim`: the dimension of in/equalities, upper/lower bounds, etc. This field is auto-populated on construction.
Expand Down
Loading

0 comments on commit b02fe80

Please sign in to comment.