continuoussets


Namecontinuoussets JSON
Version 0.0.0 PyPI version JSON
download
home_page
SummaryA package for set-based computing.
upload_time2024-01-25 15:37:43
maintainer
docs_urlNone
authorMark Wetzlinger
requires_python>=3.9,<=3.12
licenseGNU
keywords set-based computing interval arithmetic zonotopes
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/wetzlingerm/0a3fab03f3da8db62e046b3f913af3fa/raw/coverage.json)


The Python library [continuoussets](https://github.com/wetzlingerm/continuoussets) provides classes for the representation of continuous sets and the evaluation of set operations on them.

- [Installation](https://github.com/wetzlingerm/continuoussets/#installation)
- [Set Representations](https://github.com/wetzlingerm/continuoussets/#set-representations)
  - [Intervals](https://github.com/wetzlingerm/continuoussets/#intervals)
  - [Zonotopes](https://github.com/wetzlingerm/continuoussets/#zonotopes)
- [Set Operations](https://github.com/wetzlingerm/continuoussets/#set-operations)
- [References](https://github.com/wetzlingerm/continuoussets/#references)

## Installation

The library `continuoussets` requires Python 3.9 or higher.
The only direct dependencies are [numpy](https://numpy.org/), [scipy](https://scipy.org/), and [matplotlib](https://matplotlib.org/).
Installation via PyPI is recommended:
```python
pip install continuoussets
```
Proficient users may choose their own installation path.

## Set Representations

The implemented classes inherit from the abstract base class `ConvexSet`.
They represent continuous sets of n-dimensional vectors.

> [!TIP]
> Many operations, notably including the constructors, also support scalar types, such as `int` and `float`, as well as vectors defined using the type `list`. However, these are internally converted to numpy arrays, which may slow down the computation.

> [!IMPORTANT]
> The usage of keyword arguments for constructors is **mandatory**.

### Intervals

An interval `I` is defined using a lower bound `lb` and an upper bound `ub`:

> I = { x | lb <= x <= ub }

where `lb` and `ub` are vectors of equal length, and the inequality holds elementwise.

The `Interval` class allows to instantiate such objects:
```python
I = Interval(lb = numpy.array([-2., 0.]), ub = numpy.array([2., 1.]))
```


### Zonotopes

A zonotopes `Z` is defined using a center `c` and a generator matrix `G`:

> Z = { c + sum_i G_i a_i | -1 <= a_i <= 1 }

where `G_i` are the columns of `G`.
In contrast to intervals, zonotopes can represent dependencies between different dimensions.

The `Zonotope` class allows to instantiate such objects:
```python
Z = Zonotope(c = numpy.array([1., 0.]), G = numpy.array([[1., 0., 2.], [-1., 1., 1.]]))
```


## Set Operations
  
Many standard set operations are implemented:

- `boundary_point`: Computation of boundary points
- `cartesian_product`: Cartesian product
- `compact`: Reduction to the minimal set representation size without changing the set
- `convex_hull`: Convex hull
- `matmul`: Linear map
- `minkowski_sum`: Minkowski sum
- `minkowski_difference`: Minkowski/Pontryagin difference
- `project`: Projection of the set onto an axis-aligned subspace
- `reduce`: Reduction of the set representation size, possibly incurring enlargement
- `support_function`: Support function evaluation
- `vertices`: Vertex enumeration
- `volume`: Volume computation

> [!IMPORTANT]
> All operations return **new class instances**.

> [!NOTE]
> Operands for binary operations can also be vectors, represented by 1D numpy arrays.

> [!TIP]
> Many operations support **various evaluation modes** via the keyword argument `mode`. These detail whether an exact solution, an outer approximation or an inner approximation should be computed. Not all modes are supported for each operation, some operations cannot be evaluated exactly, and runtime may differ strongly between modes.

Furthermore, the following checks are supported:

- `contains`: Containment of one set or vector in another set
- `intersects`: Intersection between a set and another set or vector
- `__eq__`: Equality of a set and another set or vector
- `represents`: Equivalent representation of a set by another set representation

The `Interval` class additionally supports **interval arithmetic** for range bounding purposes. This includes

- basic operations: addition (`__add__`), subtraction (`__sub__`), multiplication (`__mul__`), division (`__truediv__`), exponentiation (`__pow__`)
- trigonometric functions: `sin`, `cos`, `tan`, `arcsin`, `arccos`, `arctan`
- other standard functions: `sqrt`, `log`, `log10`


## References

This library is heavily inspired by the MATLAB toolbox [CORA](https://cora.in.tum.de).
However, this implementation is based on original sources, e.g.,

- G. Alefeld and G. Mayer. “Interval analysis: Theory and applications”.
  In: Computational and Applied Mathematics 121.1-2 (2000), pp. 421–464. doi: 10.1016/S0377-0427(00)00342-3
- M. Althoff. “Reachability analysis and its application to the safety assessment of autonomous cars”.
  Dissertation. Technische Universität München, 2010.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "continuoussets",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<=3.12",
    "maintainer_email": "",
    "keywords": "Set-based computing,Interval arithmetic,Zonotopes",
    "author": "Mark Wetzlinger",
    "author_email": "m.wetzlinger@tum.de",
    "download_url": "https://files.pythonhosted.org/packages/32/2c/58ac32945ef84254c77955d1be894455917de62ae4ef1d028502e2955e7c/continuoussets-0.0.0.tar.gz",
    "platform": null,
    "description": "![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/wetzlingerm/0a3fab03f3da8db62e046b3f913af3fa/raw/coverage.json)\n\n\nThe Python library [continuoussets](https://github.com/wetzlingerm/continuoussets) provides classes for the representation of continuous sets and the evaluation of set operations on them.\n\n- [Installation](https://github.com/wetzlingerm/continuoussets/#installation)\n- [Set Representations](https://github.com/wetzlingerm/continuoussets/#set-representations)\n  - [Intervals](https://github.com/wetzlingerm/continuoussets/#intervals)\n  - [Zonotopes](https://github.com/wetzlingerm/continuoussets/#zonotopes)\n- [Set Operations](https://github.com/wetzlingerm/continuoussets/#set-operations)\n- [References](https://github.com/wetzlingerm/continuoussets/#references)\n\n## Installation\n\nThe library `continuoussets` requires Python 3.9 or higher.\nThe only direct dependencies are [numpy](https://numpy.org/), [scipy](https://scipy.org/), and [matplotlib](https://matplotlib.org/).\nInstallation via PyPI is recommended:\n```python\npip install continuoussets\n```\nProficient users may choose their own installation path.\n\n## Set Representations\n\nThe implemented classes inherit from the abstract base class `ConvexSet`.\nThey represent continuous sets of n-dimensional vectors.\n\n> [!TIP]\n> Many operations, notably including the constructors, also support scalar types, such as `int` and `float`, as well as vectors defined using the type `list`. However, these are internally converted to numpy arrays, which may slow down the computation.\n\n> [!IMPORTANT]\n> The usage of keyword arguments for constructors is **mandatory**.\n\n### Intervals\n\nAn interval `I` is defined using a lower bound `lb` and an upper bound `ub`:\n\n> I = { x | lb <= x <= ub }\n\nwhere `lb` and `ub` are vectors of equal length, and the inequality holds elementwise.\n\nThe `Interval` class allows to instantiate such objects:\n```python\nI = Interval(lb = numpy.array([-2., 0.]), ub = numpy.array([2., 1.]))\n```\n\n\n### Zonotopes\n\nA zonotopes `Z` is defined using a center `c` and a generator matrix `G`:\n\n> Z = { c + sum_i G_i a_i | -1 <= a_i <= 1 }\n\nwhere `G_i` are the columns of `G`.\nIn contrast to intervals, zonotopes can represent dependencies between different dimensions.\n\nThe `Zonotope` class allows to instantiate such objects:\n```python\nZ = Zonotope(c = numpy.array([1., 0.]), G = numpy.array([[1., 0., 2.], [-1., 1., 1.]]))\n```\n\n\n## Set Operations\n  \nMany standard set operations are implemented:\n\n- `boundary_point`: Computation of boundary points\n- `cartesian_product`: Cartesian product\n- `compact`: Reduction to the minimal set representation size without changing the set\n- `convex_hull`: Convex hull\n- `matmul`: Linear map\n- `minkowski_sum`: Minkowski sum\n- `minkowski_difference`: Minkowski/Pontryagin difference\n- `project`: Projection of the set onto an axis-aligned subspace\n- `reduce`: Reduction of the set representation size, possibly incurring enlargement\n- `support_function`: Support function evaluation\n- `vertices`: Vertex enumeration\n- `volume`: Volume computation\n\n> [!IMPORTANT]\n> All operations return **new class instances**.\n\n> [!NOTE]\n> Operands for binary operations can also be vectors, represented by 1D numpy arrays.\n\n> [!TIP]\n> Many operations support **various evaluation modes** via the keyword argument `mode`. These detail whether an exact solution, an outer approximation or an inner approximation should be computed. Not all modes are supported for each operation, some operations cannot be evaluated exactly, and runtime may differ strongly between modes.\n\nFurthermore, the following checks are supported:\n\n- `contains`: Containment of one set or vector in another set\n- `intersects`: Intersection between a set and another set or vector\n- `__eq__`: Equality of a set and another set or vector\n- `represents`: Equivalent representation of a set by another set representation\n\nThe `Interval` class additionally supports **interval arithmetic** for range bounding purposes. This includes\n\n- basic operations: addition (`__add__`), subtraction (`__sub__`), multiplication (`__mul__`), division (`__truediv__`), exponentiation (`__pow__`)\n- trigonometric functions: `sin`, `cos`, `tan`, `arcsin`, `arccos`, `arctan`\n- other standard functions: `sqrt`, `log`, `log10`\n\n\n## References\n\nThis library is heavily inspired by the MATLAB toolbox [CORA](https://cora.in.tum.de).\nHowever, this implementation is based on original sources, e.g.,\n\n- G. Alefeld and G. Mayer. \u201cInterval analysis: Theory and applications\u201d.\n  In: Computational and Applied Mathematics 121.1-2 (2000), pp. 421\u2013464. doi: 10.1016/S0377-0427(00)00342-3\n- M. Althoff. \u201cReachability analysis and its application to the safety assessment of autonomous cars\u201d.\n  Dissertation. Technische Universit\u00e4t M\u00fcnchen, 2010.\n",
    "bugtrack_url": null,
    "license": "GNU",
    "summary": "A package for set-based computing.",
    "version": "0.0.0",
    "project_urls": null,
    "split_keywords": [
        "set-based computing",
        "interval arithmetic",
        "zonotopes"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0b48cac03f2ec0f90cc6fa3bbf9f12608c48224407dc7c3db292d03268bc11ec",
                "md5": "941d46dd814fea5200e7968e22112afc",
                "sha256": "a7e1384c3370b1a538008f4699b0d848b82882afb9f4cfa9ccdbb46d4ace6f5b"
            },
            "downloads": -1,
            "filename": "continuoussets-0.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "941d46dd814fea5200e7968e22112afc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<=3.12",
            "size": 34865,
            "upload_time": "2024-01-25T15:37:41",
            "upload_time_iso_8601": "2024-01-25T15:37:41.623412Z",
            "url": "https://files.pythonhosted.org/packages/0b/48/cac03f2ec0f90cc6fa3bbf9f12608c48224407dc7c3db292d03268bc11ec/continuoussets-0.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "322c58ac32945ef84254c77955d1be894455917de62ae4ef1d028502e2955e7c",
                "md5": "5e6a3d5aa58714f112812989da7f615a",
                "sha256": "6c1ade5413d21d3aa99b54560fd9d8539415e6b252bb81d4ba6a16819b9db5ea"
            },
            "downloads": -1,
            "filename": "continuoussets-0.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5e6a3d5aa58714f112812989da7f615a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<=3.12",
            "size": 32631,
            "upload_time": "2024-01-25T15:37:43",
            "upload_time_iso_8601": "2024-01-25T15:37:43.217306Z",
            "url": "https://files.pythonhosted.org/packages/32/2c/58ac32945ef84254c77955d1be894455917de62ae4ef1d028502e2955e7c/continuoussets-0.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-25 15:37:43",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "continuoussets"
}
        
Elapsed time: 0.43197s