------------------------------
This version comes with a lot of improvements, notably:
* support for type checking,
* new functions that more closely reflect upstream cddlib,
* improved build and installation, allowing linkage against arbitrary gmp/cddlib
versions installed by the system or by the user.
Unfortunately, the interface of the old version did not permit type checking,
due to an unfortunate design decision from the past:
from a typing point of view,
real and rational matrices could be mixed arbitrarily,
and runtime checks had to be put in place to prevent this.
Since type checking is meant to prevent bugs like this long before runtime,
I made the hard decision to break the old API.
As a consequence, the library is now split into two
separate modules: ``cdd`` for real matrices, and ``cdd.gmp`` for rational matrices.
Coincidentally, these two modules reflect the upstream organization of cddlib itself
into ``cdd`` and ``cddgmp``.
Whilst doing this,
new functions have been added
from the upstream cddlib public headers.
This resulted in a faster, cleaner, and less buggy implementation,
which is more closely aligned with upstream cddlib.
Fully detailed changes:
* BACKWARDS INCOMPATIBLE:
The ``number_type`` arguments are gone.
The ``cdd`` module now only exposes the floating point interface
(formerly accessible with ``number_type="float"``).
The new ``cdd.gmp`` submodule exposes the rational numbers interface
(formerly accessible with ``number_type="fraction"``).
This change was necessary to enable fully correct type checking for the library,
and to allow a version of pycddlib to be installed without needing to compile gmp.
* BACKWARDS INCOMPATIBLE:
Under the hood, the old version used cython's ``__cinit__`` to initialize
``Matrix``, ``LinProg``, and ``Polyhedron`` objects.
However, exceptions thrown from this function
risk leaving the object in an invalid state.
Instead, cython recommends using factory functions.
So, new factory functions have been introduced to replace the old constructors:
``matrix_from_array``, ``linprog_from_matrix``, ``linprog_from_array``,
and ``polyhedron_from_matrix``.
As a consequence, errors during construction are now always correctly handled.
* BACKWARDS INCOMPATIBLE:
For consistency, methods have been refactored into functions
to more closely reflect the underlying cddlib interface.
- ``Matrix(...)`` is now ``matrix_from_array(...)``.
The ``linear`` argument has been replaced with ``lin_set``,
and all other properties can also be specified from this new factory function.
- ``Matrix.extend`` is now ``matrix_append_to`` and takes two matrices as argument,
to match the corresponding cddlib functions.
It still raises a :exc:`ValueError` if the column sizes differ.
- ``Matrix.copy`` is now ``matrix_copy``.
- ``Matrix.canonicalize`` is now ``matrix_canonicalize``,
and now also returns the sequence of new row indices.
- ``LinProg(...)`` is now ``linprog_from_matrix(...)``
or ``linprog_from_array(...)``.
The ``linprog_from_array`` factory function
is recommended especially if you have no equality constraints since it saves
having to allocate a matrix first.
If you have equality constraints, ``linprog_from_matrix``
will convert those for you.
If you use ``linprog_from_array``, you will have to convert these yourself.
- ``LinProg.solve`` is now ``linprog_solve``.
- ``Polyhedron(...)`` is now ``polyhedron_from_matrix``.
- The ``Polyhedron.get_...`` methods are now ``copy_...``. This reflects the
upstream naming of these functions.
* Enumeration classes now inherit from :class:`enums.IntEnum`.
* Pickle support for ``Matrix`` and ``LinProg`` (see issue 47).
``Polyhedron`` does not have pickle support as it has no public interface to
construct it without running the double description method, which can be very slow.
As a fallback, you can pickle a matrix
that you then convert to a polyhedron
(as noted, this may be be quite slow),
or simply pickle the outputs that you need for your application
(i.e. inequalities, generators, adjacencies, incidences, ...).
* Additional functions have been exposed:
- Fourier and block elimination (see issue 38).
- Matrix adjacency and weak adjacency using linear programming
(i.e. without running the double description method).
- Matrix rank.
- New functions for redundancy checks and certificates.
- New functions to canonicalize only linearities, or only inequalities.
* You can now specify the row order type
when constructing a ``Polyhedron`` from a matrix.
(This exposes the ``dd_DDMatrix2Poly2`` function.)
* Thanks to the reorganization, there now is a standalone Python package that
installs just the floating point interface without needing the gmp or cddlib
libraries installed.
This is useful on systems where the user cannot easily install
libraries, such as for instance google colab.
To install it, use ``pip install pycddlib-standalone``.
Naturally, you cannot install ``pycddlib`` and ``pycddlib-standalone``
at the same time.
* Type hints are now included, so the code can fully benefit from type checking.
* The Windows wheels now use vcpkg to compile cddlib and gmp.
This updates the library from mpir 3.0.0 (dating back from 2017)
to gmp 6.3.0 (the most recent release at the time of writing).
* The build script no longer compiles cddlib.
This permits the module to use cddlib and gmp
as installed by the system (e.g. vcpkg, rpm, ...).
To build the extension, you may need to point Python to the correct folders.
Check the installation instructions for more details.
* The ``setup.py`` script has been migrated to ``pyproject.toml``.
* Drop x86 binary wheels on Windows.
These can still be built but they are no longer distributed in PyPI.
* Drop Python 3.8 support.