#19152: {Real,Complex}Ball: Miscellaneous fixes and improvements
-------------------------------------+-------------------------------------
       Reporter:  mmezzarobba        |        Owner:
           Type:  enhancement        |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-6.10
      Component:  numerical          |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Marc Mezzarobba    |    Reviewers:  Clemens Heuberger
Report Upstream:  N/A                |  Work issues:
         Branch:  public/19152-arb-  |       Commit:
  misc                               |  ea08942380a0cfab4614de252bac9a8db340b3b4
   Dependencies:  #19063             |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by jdemeyer):

 Replying to [comment:18 mmezzarobba]:
 > Replying to [comment:15 jdemeyer]:
 > > 2. You can remove the `include_dirs=[SAGE_INC + '/flint'])` from
 `src/module_list.py`.
 >
 > Are you sure? I get:
 > {{{
 > [2/2] gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
 -fPIC -I/home/marc/co/sage/local/include
 -I/home/marc/co/sage/local/include/python2.7
 -I/home/marc/co/sage/local/lib/python2.7/site-packages/numpy/core/include
 -I/home/marc/co/sage/src -I/home/marc/co/sage/src/sage/ext
 -I/home/marc/co/sage/src/build/cythonized
 -I/home/marc/co/sage/src/build/cythonized/sage/ext
 -I/home/marc/co/sage/local/include/python2.7 -c
 /home/marc/co/sage/src/build/cythonized/sage/rings/real_arb.c -o
 build/temp.linux-
 x86_64-2.7/home/marc/co/sage/src/build/cythonized/sage/rings/real_arb.o
 -fno-strict-aliasing -w
 > In file included from
 /home/marc/co/sage/src/build/cythonized/sage/rings/complex_ball_acb.c:310:0:
 > /home/marc/co/sage/local/include/mag.h:36:19: fatal error: flint.h: No
 such file or directory
 > compilation terminated.
 > In file included from
 /home/marc/co/sage/src/build/cythonized/sage/rings/real_arb.c:309:0:
 > /home/marc/co/sage/local/include/mag.h:36:19: fatal error: flint.h: No
 such file or directory
 > }}}

 I must admit I didn't test it, but it seems the problem comes from `arb`
 (not the Sage library). I'll look into it later.

 > > 3. Ideally, the type declarations in the arb `.pxd` files should be in
 a different file: try to follow the model of `src/sage/libs/gmp` for
 example. Then you should add `# distutils: libraries = arb` to the files
 with library functions (i.e. not types).
 >
 > A difference is that arb comes with several `.h` files (one for each
 module, with a more or less well-defined dependency graph): are you
 suggesting to put all the type definitions in a single `.pxd` file
 nevertheless?
 Yes, put the type declarations all in `types.pxd`.

 > > 5. For `CBF.__hash__`, what's the point of `>> 7`?
 >
 > The idea was just to avoid that the λ(1+i) all hash to zero...
 ??? I don't get it.

 > > 6. This is a very strange way to handle exceptions, what's wrong with
 `raise`?
 > > {{{
 > >         if arf_get_mpfr(rad.value, tmp, GMP_RNDN):
 > >             abort()
 > > }}}
 >
 > I don't remember for sure. I guess I may have wanted to make sure that
 errors raised by `arf_get_mpfr()` itself and errors raised manually give
 the same exception, and to avoid repeating the error message.
 You can use `sig_error()` for that, it just calls `abort()` but it's more
 explicit.

 > > 9. What's with this comment?
 > > {{{
 > >                 # FIXME: RBF is not even associative, but
 CompletionFunctor
 > >                 # only works with rings, and other coercion features
 require
 > >                 # methods like is_integral_domain() to be defined
 > >                 category=category or
 sage.categories.fields.Fields().Infinite())
 > > }}}
 > > Your class models a mathematical field (real or complex numbers), so I
 don't see the problem. How would you want to fix this?
 >
 > Well, people seem to disagree about the meaning of categories in Sage,
 and some people apparently assume that a parent that belongs to the
 category of fields will satisfy the axioms of fields, not just vaguely
 model a field. This is particularly harmful in the context of interval
 arithmetic.
 >
 > In the long term, I'd want to fix this by (i) clarifying the “global
 conventions” that need to be used consistently across the whole sage
 codebase and (ii) depending on the outcome, perhaps creating categories
 for “inexact fields” and the like.
 But that's not at all specific to `arb` right, so I'm just confused by
 this comment. I propose to remove it.

 > > 10. Now that all this is standard, can you add `RBF`, `RealBallField`,
 `CBF` and `ComplexBallField` to the global namespace and then remove all
 doctest lines of the form `from sage.rings.real_arb import RBF`.
 >
 > I'm no fan of adding anything to the global namespace, but I'll do it if
 you insist.
 Why not?

 > > 18. I don't understand what this means: `Return a copy of this ball
 rounded to the precision of the parent.`
 >
 > An arb ball has no intrinsic precision, and (more or less because of
 that), an element of `RealBallField(p)` can have a midpoint that doesn't
 fit on `p` bits. The `round()` method rounds such elements to the
 precision of their parent.
 Now I'm even more confused... I still have no clue what you mean.

--
Ticket URL: <http://trac.sagemath.org/ticket/19152#comment:22>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to