# HG changeset patch
# User Alexandre Blondin Masse < alexandre.blondin.masse at gmail.com>
# Date 1267710152 -3600
# Node ID 3019fa0b143ec38a40b8bd6aabde4ad5e9dfe075
# Parent cdf906d1912e376d2c225f7ee6bd9ccf00df8ac1
#7311 minor doc and code formatting fixes
diff --git a/sage/numerical/mip.pyx b/sage/numerical/mip.pyx
a
|
b
|
class MixedIntegerLinearProgram: |
629 | 629 | INPUT: |
630 | 630 | |
631 | 631 | - ``linear_function`` -- Two different types of arguments are possible: |
632 | | |
633 | 632 | - A linear function. In this case, arguments ``min`` or ``max`` |
634 | 633 | have to be specified. |
635 | | |
636 | 634 | - A linear constraint of the form ``A <= B``, ``A >= B``, |
637 | 635 | ``A <= B <= C``, ``A >= B >= C`` or ``A == B``. In this |
638 | 636 | case, arguments ``min`` and ``max`` will be ignored. |
639 | | |
640 | 637 | - ``max`` -- An upper bound on the constraint (set to ``None`` |
641 | 638 | by default). This must be a numerical value. |
642 | | |
643 | 639 | - ``min`` -- A lower bound on the constraint. This must be a |
644 | 640 | numerical value |
645 | | |
646 | 641 | - ``name`` -- A name for the constraint. |
647 | 642 | |
648 | 643 | EXAMPLE: |
… |
… |
class MixedIntegerLinearProgram: |
722 | 717 | c = len(self._constraints_bounds_min) |
723 | 718 | |
724 | 719 | for (v,coeff) in f.iteritems(): |
725 | | if v!=-1: |
| 720 | if v != -1: |
726 | 721 | self._constraints_matrix_i.append(c) |
727 | 722 | self._constraints_matrix_j.append(v) |
728 | 723 | self._constraints_matrix_values.append(coeff) |
… |
… |
class LinearFunction: |
1465 | 1460 | by the keys ( which are integers ). The key ``-1`` |
1466 | 1461 | corresponds to the constant term. |
1467 | 1462 | |
1468 | | EXAMPLE: |
| 1463 | EXAMPLE:: |
1469 | 1464 | |
1470 | 1465 | sage: from sage.numerical.mip import LinearFunction |
1471 | 1466 | sage: lf = LinearFunction({0 : 1, 3 : -8}) |
… |
… |
class LinearFunction: |
1666 | 1661 | |
1667 | 1662 | def __hash__(self): |
1668 | 1663 | r""" |
1669 | | Defining a ``__hash__`` function |
| 1664 | Defines a ``__hash__`` function |
1670 | 1665 | |
1671 | 1666 | EXAMPLE:: |
1672 | 1667 | |
… |
… |
class LinearConstraint: |
1723 | 1718 | |
1724 | 1719 | INPUT: |
1725 | 1720 | |
1726 | | - ``c`` -- A ``LinearFunction`` |
| 1721 | - ``c`` -- A linear function (see ``LinearFunction``). |
1727 | 1722 | |
1728 | 1723 | EXAMPLE:: |
1729 | 1724 | |
… |
… |
class LinearConstraint: |
1741 | 1736 | |
1742 | 1737 | def __repr__(self): |
1743 | 1738 | r""" |
1744 | | Returns a description of the constraint |
| 1739 | Returns a string representation of the constraint. |
1745 | 1740 | |
1746 | 1741 | EXAMPLE:: |
1747 | 1742 | |
… |
… |
class LinearConstraint: |
1804 | 1799 | |
1805 | 1800 | def __lt__(self, other): |
1806 | 1801 | r""" |
1807 | | Prevents the use of the stricts operators ``<,>`` |
| 1802 | Prevents the use of the stricts operators ``<`` and ``>`` |
1808 | 1803 | |
1809 | 1804 | EXAMPLE:: |
1810 | 1805 | |