projects
/
linpy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add labels to documentation sections
[linpy.git]
/
doc
/
reference.rst
diff --git
a/doc/reference.rst
b/doc/reference.rst
index
de5300d
..
ae82aca
100644
(file)
--- a/
doc/reference.rst
+++ b/
doc/reference.rst
@@
-1,7
+1,12
@@
+.. _reference:
+
Module Reference
================
Module Reference
================
+
+.. _reference_symbols:
+
Symbols
-------
Symbols
-------
@@
-67,6
+72,8
@@
This is achieved using ``Dummy('x')``.
True
True
+.. _reference_linexprs:
+
Linear Expressions
------------------
Linear Expressions
------------------
@@
-172,7
+179,6
@@
For example, if ``x`` is a :class:`Symbol`, then ``x + 1`` is an instance of :cl
>>> x < y
Le(x - y + 1, 0)
>>> x < y
Le(x - y + 1, 0)
-
.. method:: scaleint()
Return the expression multiplied by its lowest common denominator to make all values integer.
.. method:: scaleint()
Return the expression multiplied by its lowest common denominator to make all values integer.
@@
-227,6
+233,9
@@
They are implemented by the :class:`Rational` class, that inherits from both :cl
See the documentation of :class:`fractions.Fraction` for more information and examples.
See the documentation of :class:`fractions.Fraction` for more information and examples.
+
+.. _reference_polyhedra:
+
Polyhedra
---------
Polyhedra
---------
@@
-278,10
+287,20
@@
This space can be unbounded.
The tuple of constraints, i.e., equalities and inequalities.
This is semantically equivalent to: ``equalities + inequalities``.
The tuple of constraints, i.e., equalities and inequalities.
This is semantically equivalent to: ``equalities + inequalities``.
+ .. method:: convex_union(polyhedron[, ...])
+
+ Return the convex union of two or more polyhedra.
+
+ .. method:: asinequalities()
+
+ Express the polyhedron using inequalities, given as a list of expressions greater or equal to 0.
+
.. method:: widen(polyhedron)
Compute the *standard widening* of two polyhedra, à la Halbwachs.
.. method:: widen(polyhedron)
Compute the *standard widening* of two polyhedra, à la Halbwachs.
+ In its current implementation, this method is slow and should not be used on large polyhedra.
+
.. data:: Empty
.. data:: Empty
@@
-291,11
+310,14
@@
This space can be unbounded.
The universe polyhedron, whose set of constraints is always satisfiable, i.e. is empty.
The universe polyhedron, whose set of constraints is always satisfiable, i.e. is empty.
+
+.. _reference_domains:
+
Domains
-------
A *domain* is a union of polyhedra.
Domains
-------
A *domain* is a union of polyhedra.
-Unlike polyhedra, domains allow exact computation of union and complementary operations.
+Unlike polyhedra, domains allow exact computation of union
, subtraction
and complementary operations.
.. class:: Domain(*polyhedra)
Domain(string)
.. class:: Domain(*polyhedra)
Domain(string)
@@
-473,6
+495,8
@@
Unlike polyhedra, domains allow exact computation of union and complementary ope
Convert the domain to a sympy expression.
Convert the domain to a sympy expression.
+.. _reference_operators:
+
Comparison and Logic Operators
------------------------------
Comparison and Logic Operators
------------------------------
@@
-493,7
+517,7
@@
The following functions create :class:`Polyhedron` or :class:`Domain` instances
.. function:: Ne(expr1, expr2[, expr3, ...])
Create the domain such that ``expr1 != expr2 != expr3 ...``.
.. function:: Ne(expr1, expr2[, expr3, ...])
Create the domain such that ``expr1 != expr2 != expr3 ...``.
- The result is a :class:`Domain`, not a :class:`Polyhedron`.
+ The result is a :class:`Domain`
object
, not a :class:`Polyhedron`.
.. function:: Ge(expr1, expr2[, expr3, ...])
.. function:: Ge(expr1, expr2[, expr3, ...])
@@
-505,19
+529,21
@@
The following functions create :class:`Polyhedron` or :class:`Domain` instances
The following functions combine :class:`Polyhedron` or :class:`Domain` instances using logic operators:
The following functions combine :class:`Polyhedron` or :class:`Domain` instances using logic operators:
-.. function:: Or(domain1, domain2[, ...])
-
- Create the union domain of the domains given in arguments.
-
.. function:: And(domain1, domain2[, ...])
Create the intersection domain of the domains given in arguments.
.. function:: And(domain1, domain2[, ...])
Create the intersection domain of the domains given in arguments.
+.. function:: Or(domain1, domain2[, ...])
+
+ Create the union domain of the domains given in arguments.
+
.. function:: Not(domain)
Create the complementary domain of the domain given in argument.
.. function:: Not(domain)
Create the complementary domain of the domain given in argument.
+.. _reference_geometry:
+
Geometric Objects
-----------------
Geometric Objects
-----------------
@@
-677,7
+703,7
@@
Geometric Objects
.. method:: cross(vector)
Compute the cross product of two 3D vectors.
.. method:: cross(vector)
Compute the cross product of two 3D vectors.
- If either one of the vectors is not t
ri
dimensional, a :exc:`ValueError` exception is raised.
+ If either one of the vectors is not t
hree-
dimensional, a :exc:`ValueError` exception is raised.
.. method:: dot(vector)
.. method:: dot(vector)