changeset 743:57ce422feb55

Converted docstrings in viff.comparison to Sphinx format.
author Martin Geisler <mg@daimi.au.dk>
date Wed, 30 Apr 2008 10:05:34 +0200
parents 88d4c3f9cee1
children e0f9090cf95c
files viff/comparison.py
diffstat 1 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/viff/comparison.py	Tue Apr 29 09:31:34 2008 +0200
+++ b/viff/comparison.py	Wed Apr 30 10:05:34 2008 +0200
@@ -15,12 +15,12 @@
 # You should have received a copy of the GNU Lesser General Public
 # License along with VIFF. If not, see <http://www.gnu.org/licenses/>.
 
-"""Comparison protocols.
+"""Comparison protocols. The mixin classes defined here provide a
+:meth:`greater_than_equal` method to the :class:`Runtime
+<viff.runtime.Runtime>` they are mixed with.
+"""
 
-The mixin classes defined here provide a C{greater_than_equal} method
-to the L{Runtime} they are mixed with.
-
-"""
+__docformat__ = "restructuredtext"
 
 import math
 
@@ -54,7 +54,7 @@
 
     @increment_pc
     def greater_than_equal(self, share_a, share_b):
-        """Compute share_a >= share_b.
+        """Compute ``share_a >= share_b``.
 
         Both arguments must be from the field given. The result is a
         GF256 share.
@@ -140,16 +140,16 @@
 
 
 class Toft05Runtime(ComparisonToft05Mixin, Runtime):
-    """Default mix of L{ComparisonToft05Mixin} and L{Runtime}."""
+    """Default mix of :class:`ComparisonToft05Mixin` and
+    :class:`Runtime <viff.runtime.Runtime>`."""
     pass
 
 
 class ComparisonToft07Mixin:
 
-    """Efficient comparison by Tomas Toft 2007.
-
-    This mixin provides a C{greater_than} method which can compare Zp
-    field elements and gives a secret result shared over Zp.
+    """Efficient comparison by Tomas Toft 2007. This mixin provides a
+    :meth:`greater_than_equal` method which can compare Zp field
+    elements and gives a secret result shared over Zp.
     """
 
     @increment_pc
@@ -235,9 +235,7 @@
 
     @increment_pc
     def greater_than_equal_online(self, share_a, share_b, preproc, field):
-        """Compute share_a >= share_b.
-        Result is shared.
-        """
+        """Compute ``share_a >= share_b``. Result is shared."""
         # increment l as a, b are increased
         l = self.options.bit_length + 1
         # a = 2a+1; b= 2b // ensures inputs not equal
@@ -310,7 +308,7 @@
 
     @increment_pc
     def greater_than_equal(self, share_a, share_b):
-        """Compute share_a >= share_b.
+        """Compute ``share_a >= share_b``.
 
         Both arguments must be of type field. The result is a
         field share.
@@ -332,5 +330,7 @@
 
 
 class Toft07Runtime(ComparisonToft07Mixin, Runtime):
-    """Default mix of L{ComparisonToft07Mixin} and L{Runtime}."""
+    """Default mix of :class:`ComparisonToft07Mixin` and
+    :class:`Runtime <viff.runtime.Runtime>`.
+    """
     pass