viff

changeset 1038:ab4a8125d1d8

Moved doctests to where they will be found.
author Martin Geisler <mg@daimi.au.dk>
date Fri, 05 Dec 2008 11:15:11 +0100
parents d47b8da68a23
children e127af30cba4
files viff/field.py
diffstat 1 files changed, 19 insertions(+), 19 deletions(-) [+]
line diff
     1.1 --- a/viff/field.py	Fri Dec 05 11:13:29 2008 +0100
     1.2 +++ b/viff/field.py	Fri Dec 05 11:15:11 2008 +0100
     1.3 @@ -515,31 +515,31 @@
     1.4      return GFElement
     1.5  
     1.6  def FakeGF(modulus):
     1.7 -    """Construct a fake field."""
     1.8 +    """Construct a fake field.
     1.9 +
    1.10 +    These fields should only be used in benchmarking. They work like
    1.11 +    any other field except that all computations will give ``-1`` as
    1.12 +    the result:
    1.13 +
    1.14 +    >>> F = FakeGF(1031)
    1.15 +    >>> a = F(123)
    1.16 +    >>> b = F(234)
    1.17 +    >>> a + b
    1.18 +    {{1030}}
    1.19 +    >>> a * b
    1.20 +    {{1030}}
    1.21 +    >>> a.sqrt()
    1.22 +    {{1030}}
    1.23 +    >>> a.bit(100)
    1.24 +    1
    1.25 +    """
    1.26  
    1.27      # Return value of all operations on FakeFieldElements. We choose
    1.28      # this value to maximize the communication complexity.
    1.29      return_value = modulus - 1
    1.30  
    1.31      class FakeFieldElement(FieldElement):
    1.32 -        """Fake field which does no computations.
    1.33 -
    1.34 -        This class should only be used in benchmarking. It works like any
    1.35 -        other :class:`FieldElement` except that all computations will give
    1.36 -        ``-1`` as the result:
    1.37 -
    1.38 -        >>> F = FakeGF(1031)
    1.39 -        >>> a = F(123)
    1.40 -        >>> b = F(234)
    1.41 -        >>> a + b
    1.42 -        {{1030}}
    1.43 -        >>> a * b
    1.44 -        {{1030}}
    1.45 -        >>> a.sqrt()
    1.46 -        {{1030}}
    1.47 -        >>> a.bit(100)
    1.48 -        1
    1.49 -        """
    1.50 +        """Fake field which does no computations."""
    1.51  
    1.52          def __init__(self, value):
    1.53              """Create a fake field element.