Skip to content
forked from codac-team/pyIbex

A Python binding for ibex-lib

License

LGPL-3.0, LGPL-3.0 licenses found

Licenses found

LGPL-3.0
LICENSE
LGPL-3.0
COPYING.LESSER
Notifications You must be signed in to change notification settings

nicolaje/pyIbex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

========================== Ibex python binding


Introduction

pyIbex is a python binding of Ibex library. It aims at providing a basic interface of Ibex Basic types (Interval, IntervalVector, Ctc, ...), high level functionnalities and contractors programming.


Prerequisites

  • CMake (>= 2.8.3)
  • Boost (tested with 1.4.2, but should work with >= 1.3.2)
  • Python (tested with 2.7, but should work with >= 2.2)
  • a C++ compiler for your platform, e.g. GCC or MinGW (not tested on Windows and Mac OS X)

Building

  • Set the BOOST_ROOT environment variable if Boost is installed in a non-standard directory
  • create a build directory, e.g. directly in the project directory and cd to it: mkdir build ; cd build
  • run cmake .. and afterwards make, make install and make test option :
    • use -DCMAKE_INSTALL_PREFIX= to change the install destination
    • use -DCMAKE_BUILD_TYPE=DEBUG | RELEASE to change the compilation mode

Alternatively, run the provided build.sh script.


Features

Binding for :

  • Interval, IntervalVector
  • Bsc, LargestFirst
  • Function (only text constructors)
  • Ctc, CtcFwdBwd, CtcIn, CtcNotIn
  • CtcUnion, CtcCompo

Tutorial

###Basic types manipulation

# Load pyIbex lib
from pyIbex import *

# Create new Intervals
a = Interval.EMPTY_SET
a = Interval.ALL_REALS
a  = Interval(-2, 3)

# Create IntervalVector
b = IntervalVector( 2, a)
c = IntervalVector([1,2,3])
d = IntervalVector([[-1,3], [3,10], [-3, -1]])

# Operations
e = c & d
e = c+d
e = a * c

###Functions and contractors manipulation

# Define a Function from an equation
f = Function("x", "y", "x^2 + y^2 - 3")

# FwdBwd Contractor
ctc1 = CtcFwdBwd(f, CmpOp.LEQ, FwdMode.AFFINE_MODE)

# CtcIn/CtcOut contractors :math:`$f \in [-2.5, 3.5]$`
ctcIn = CtcIn(f, Interval(3).inflate(0.5))
ctcOut = CtcNotIn(f, Interval(3).inflate(0.5))

# Operations on Contractors 
# composition of two contractor
ctc = ctcIn & ctcOut 
# union of a python list of contractors
ctc1 = CtcUnion([ctcIn, ctcOut, ctc1]) 

TODO

  • Write the documentation !!!
  • Add IntervalMatrix support
    • Add IntervalMatrix support
    • Add Jacobian and gradient
  • Add iSet support
  • Add numpy array support for interval Vector class

About

A Python binding for ibex-lib

Resources

License

LGPL-3.0, LGPL-3.0 licenses found

Licenses found

LGPL-3.0
LICENSE
LGPL-3.0
COPYING.LESSER

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 59.0%
  • Python 40.7%
  • Shell 0.3%