wmpy.core.polytope.Polytope

class Polytope(expressions, variables, env)[source]

Bases: object

Internal class for convex H-polytopes.

inequalities

list of wmpy.core.Inequality

N

the number of variables

Default constructor for a H-polytope defined on an ordered list of variables (the continuous integration domain).

Parameters:
  • expressions (Collection[FNode]) – list of linear inequalities in pysmt format

  • variables (Collection[FNode]) – the continuous integration domain

  • env (Environment) – the pysmt environment

Methods

to_numpy

Converts the polytope to a tuple of numpy arrays.

to_pysmt

Returns a pysmt formula (FNode) encoding the polytope.

to_numpy()[source]

Converts the polytope to a tuple of numpy arrays.

Return type:

tuple[ndarray, ndarray, ndarray]

Returns:

Three numpy arrays A, B, S encoding the polytope

A x {<=/<} B

S is a {0,1} array indicating which rows/entries in A, B correspond to strict inequalities.

to_pysmt()[source]

Returns a pysmt formula (FNode) encoding the polytope.

Return type:

FNode