### Navigation

- index
- modules |
- next |
- previous |
- C/C++ Library Interfaces »

# Cython interface to Cremona’s `eclib` library (also known as `mwrank`)

Cython interface to Cremona’s `eclib` library (also known as `mwrank`)

EXAMPLES:

    sage: from sage.libs.mwrank.mwrank import _Curvedata, _mw
    sage: c = _Curvedata(1,2,3,4,5)

    sage: print c
    [1,2,3,4,5]
    b2 = 9       b4 = 11         b6 = 29         b8 = 35
    c4 = -183           c6 = -3429
    disc = -10351       (# real components = 1)
    #torsion not yet computed

    sage: t= _mw(c)
    sage: t.search(10)
    sage: t
    [[1:2:1]]

`sage.libs.mwrank.mwrank.``get_precision`()

  Returns the working floating point precision of mwrank.

  OUTPUT:

  (int) The current precision in decimal digits.

  EXAMPLE:

      sage: from sage.libs.mwrank.mwrank import get_precision
      sage: get_precision()
      50

`sage.libs.mwrank.mwrank.``initprimes`(filename, verb=False)

  Initialises mwrank/eclib’s internal prime list.

  INPUT:

  - `filename` (string) – the name of a file of primes.
  - `verb` (bool: default `False`) – verbose or not?

  EXAMPLES:

      sage: file = os.path.join(SAGE_TMP, 'PRIMES')
      sage: open(file,'w').write(' '.join([str(p) for p in prime_range(10^7,10^7+20)]))
      sage: mwrank_initprimes(file, verb=True)
      Computed 78519 primes, largest is 1000253
      reading primes from file ...
      read extra prime 10000019
      finished reading primes from file ...
      Extra primes in list: 10000019

      sage: mwrank_initprimes("x" + file, True)
      Traceback (most recent call last):
      ...
      IOError: No such file or directory: ...

`sage.libs.mwrank.mwrank.``set_precision`(n)

  Sets the working floating point precision of mwrank.

  INPUT:

  - `n` (int) – a positive integer: the number of decimal digits.

  OUTPUT:

  None.

  EXAMPLE:

      sage: from sage.libs.mwrank.mwrank import set_precision
      sage: set_precision(50)

### Navigation

- index
- modules |
- next |
- previous |
- C/C++ Library Interfaces »