Polymake.jl
Polymake.jl
is a Julia package for using polymake
, a software for research in polyhedral geometry from Julia. This package is developed as part of the OSCAR project.
The current version of Polymake.jl
relies on polymake
version 4.0
or later.
Current state of the polymake
wrapper
Data structures
- Big objects, e.g., Polytopes, can be handled in Julia.
- Several small objects (data types) from
polymake
are available inPolymake.jl
:- Integers (
Polymake.Integer <: Integer
) - Rationals (
Polymake.Rational <: Real
) - Vectors (
Polymake.Vector <: AbstractVector
) ofInt64
s,Float64
s,Polymake.Integer
s andPolymake.Rational
s - Matrices (
Polymake.Matrix <: AbstractMatrix
) ofInt64
s,Float64
s,Polymake.Integer
s andPolymake.Rational
s - Sets (
Polymake.Set <: AbstractSet
) ofInt64
s - Arrays (
Polymake.Array <: AbstractVector
, asPolymake.Arrays
are one-dimensional) ofInt64
s andPolymake.Integers
- some combinations thereof, e.g.,
Polymake.Array
s ofPolymake.Sets
ofInt32
s.
- Integers (
These data types can be converted to appropriate Julia types, but are also subtypes of the corresponding Julia abstract types (as indicated above), and so should be accepted by all methods that apply to the abstract types.
Note: If the returned small object has not been wrapped in Polymake.jl
yet, you will not be able to access its content or in general use it from Julia, however you can always pass it back as an argument to a polymake
function. Moreover you may try to convert to Julia understandable type via macro @convert_to SomeType{Template, Names} obj
.
Functions
- All user functions from
polymake
are available in the appropriate modules, e.g.homology
function fromtopaz
can be called astopaz.homology(...)
in julia. We pull the docstrings for functions frompolymake
as well, so?topaz.homology
(in Julia's REPL) returns thepolymake
docstring. Note: the syntax presented in the docstring is apolymake
syntax, notPolymake.jl
one. - Most of the user functions from
polymake
are available asappname.funcname(...)
inPolymake.jl
. Moreover, any function frompolymake
C++
library can be called via macro call@pm appname.funcname{C++{template, names}}(...)
. - All big objects of
polymake
can be constructed either via call to constructor, i.e.
obj = appname.BigObject(args)
One can specify some templates here as well: polytope.Polytope{Float64}(...)
is a valid call, but the list of supported types is rather limited. Please consider filing a bug if a valid call results in polymake
error. For more advanced use see section on @pm
macro.
- Properties of big objects are accessible by
bigobject.property
syntax (as opposed to$bigobject->property
inpolymake
). If there is a missing property please check if it can be accessed byappname.property(object)
. For examplepolytope.Polytope
does not haveDIM
property inPolymake.jl
sincDIM
is exposed aspolytope.dim(...)
function. - Methods are available as functions in the appropriate modules, with the first argument as the object, i.e.
$bigobj->methodname(...)
can be called viaappname.methodname(bigobj, ...)
- A function in
Polymake.jl
callingpolymake
may return a big or small object, and the generic return (PropertyValue
) is transparently converted to one of the known data types. This conversion can be deactivated by addingkeep_PropertyValue=true
keyword argument to function/method call.
User Guide
Funding
The development of this Julia package is supported by the Deutsche Forschungsgemeinschaft DFG within the Collaborative Research Center TRR 195.