P1788

P1788 is a Ruby extension wrapping the C++ libieeep1788 interval arithmetic library.

The goal of this gem is to allow doing basic arithmetic in Ruby on set-based intervals. The output of operations are guaranteed to enclose the true result of operations.

Forward-mode and reverse-mode elementary functions are implemented to allow building contractors.

Installation

Basically:

gem install p1788

To compile, P1788 requires to have the GNU GMP and MPFR development libraries installed on your machine, as well as the Ruby development headers:

sudo apt install libgmp-dev libmpfr-dev ruby-dev

A copy of libieeep1788 is embedded into this gem, so you do not need to install it. However, if an installation of libieeep1788 is found on your machine while the gem is installing, it will be used instead of the embedded copy. Note: to install libieeep1788 from its github repository, you may need to remove the flags -Wextra -Werror around line 65 of file libieeep1788/CMakeLists.txt:

-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic")

Installation from sources

To install P1788 from sources:

# Clone the repository on your machine
git clone https://gitlab.ensta-bretagne.fr/bollenth/p1788.git
cd p1788
# Build the gem
gem build p1788.gemspec
# Install the gem (x.y.z is the gem version)
gem install p1788-x.y.z.gem

To build the documentation:

# Install yard if you don't have it
gem install yard
# Go into the P1788 source folder
cd p1788
# Build the documentation
yard
# Open it!
firefox doc/index.html