@@ -12,7+12,7 @@ They correspond to mathematical variables.
Return a symbol with the name string given in argument.
Alternatively, the function :func:`symbols` allows to create several symbols at once.
Return a symbol with the name string given in argument.
Alternatively, the function :func:`symbols` allows to create several symbols at once.
- Symbols are instances of class :class:`LinExpr` and, as such, inherit its functionalities.
+ Symbols are instances of class :class:`LinExpr` and inherit its functionalities.
>>> x = Symbol('x')
>>> x
>>> x = Symbol('x')
>>> x
@@ -46,12+46,12 @@ They correspond to mathematical variables.
>>> x, y = symbols(['x', 'y'])
>>> x, y = symbols(['x', 'y'])
-Sometimes, you need to have a unique symbol, for example as a temporary one in some calculation, which is going to be substituted for something else at the end anyway.
+Sometimes you need to have a unique symbol. For example, you might need a temporary one in some calculation, which is going to be substituted for something else at the end anyway.
This is achieved using ``Dummy('x')``.
.. class:: Dummy(name=None)
This is achieved using ``Dummy('x')``.
.. class:: Dummy(name=None)
- A variation of :class:`Symbol` which are all unique, identified by an internal count index.
+ A variation of :class:`Symbol` in which all symbols are unique and identified by an internal count index.
If a name is not supplied then a string value of the count index will be used.
This is useful when a unique, temporary variable is needed and the name of the variable used in the expression is not important.
If a name is not supplied then a string value of the count index will be used.
This is useful when a unique, temporary variable is needed and the name of the variable used in the expression is not important.
@@ -79,8+79,8 @@ For example, if ``x`` is a :class:`Symbol`, then ``x + 1`` is an instance of :cl
.. class:: LinExpr(coefficients=None, constant=0)
LinExpr(string)
.. class:: LinExpr(coefficients=None, constant=0)
LinExpr(string)
- Return a linear expression from a dictionary or a sequence that maps symbols to their coefficients, and a constant term.
- The coefficients and the constant must be rational numbers.
+ Return a linear expression from a dictionary or a sequence, that maps symbols to their coefficients, and a constant term.
+ The coefficients and the constant term must be rational numbers.
For example, the linear expression ``x + 2y + 1`` can be constructed using one of the following instructions:
For example, the linear expression ``x + 2y + 1`` can be constructed using one of the following instructions:
@@ -88,7+88,7 @@ For example, if ``x`` is a :class:`Symbol`, then ``x + 1`` is an instance of :cl
>>> LinExpr({x: 1, y: 2}, 1)
>>> LinExpr([(x, 1), (y, 2)], 1)
>>> LinExpr({x: 1, y: 2}, 1)
>>> LinExpr([(x, 1), (y, 2)], 1)
- although it may be easier to use overloaded operators:
+ However, it may be easier to use overloaded operators:
>>> x, y = symbols('x y')
>>> x + 2*y + 1
>>> x, y = symbols('x y')
>>> x + 2*y + 1
@@ -181,7+181,7 @@ For example, if ``x`` is a :class:`Symbol`, then ``x + 1`` is an instance of :cl
subs(pairs)
Substitute the given symbol by an expression and return the resulting expression.
subs(pairs)
Substitute the given symbol by an expression and return the resulting expression.
- Raise :exc:`TypeError` is the resulting expression is not linear.
+ Raise :exc:`TypeError` if the resulting expression is not linear.
>>> x, y = symbols('x y')
>>> e = x + 2*y + 1
>>> x, y = symbols('x y')
>>> e = x + 2*y + 1
@@ -216,21+216,21 @@ They are implemented by the :class:`Rational` class, that inherits from both :cl
.. class:: Rational(numerator, denominator=1)
Rational(string)
.. class:: Rational(numerator, denominator=1)
Rational(string)
- The first version requires that *numerator* and *denominator* are instances of :class:`numbers.Rational` and returns a new :class:`Rational` instance with value ``numerator/denominator``.
- If denominator is ``0``, it raises a :exc:`ZeroDivisionError`.
+ The first version requires that the *numerator* and *denominator* are instances of :class:`numbers.Rational` and returns a new :class:`Rational` instance with the value ``numerator/denominator``.
+ If the denominator is ``0``, it raises a :exc:`ZeroDivisionError`.
The other version of the constructor expects a string.
The usual form for this instance is::
[sign] numerator ['/' denominator]
The other version of the constructor expects a string.
The usual form for this instance is::
[sign] numerator ['/' denominator]
- where the optional ``sign`` may be either '+' or '-' and ``numerator`` and ``denominator`` (if present) are strings of decimal digits.
+ where the optional ``sign`` may be either '+' or '-' and the ``numerator`` and ``denominator`` (if present) are strings of decimal digits.
See the documentation of :class:`fractions.Fraction` for more information and examples.
Polyhedra
---------
See the documentation of :class:`fractions.Fraction` for more information and examples.
Polyhedra
---------
-A *convex polyhedron* (or simply polyhedron) is the space defined by a system of linear equalities and inequalities.
+A *convex polyhedron* (or simply "polyhedron") is the space defined by a system of linear equalities and inequalities.