Public mpn_divexact_1 (was: Re: Extending the mpn interface)

2015-02-18 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: There ought to be more public mpn division functions. To make any progress, we could start with the easy ones. I'm looking into making mpn_divexact_1 public. I guess what it takes is only moving the prototype from gmp-impl.h to gmp-h.in, and document

Re: Extending the mpn interface

2015-02-16 Thread Bill Allombert
On Fri, Feb 15, 2013 at 03:51:02PM +0100, Niels Möller wrote: /* Second revision of a minimal mpz/mpn interface. Question: Should we use real functions, inline functions, or macros? */ Sorry to answer with two year delay, but I just see that these functions were added to GMP 6. I should

Re: Extending the mpn interface

2015-02-16 Thread Niels Möller
Bill Allombert bill.allomb...@math.u-bordeaux.fr writes: I would like to call mpz_divexact_ui on (x,nx) and put the result in (z,nz), and I would like to avoid doing extra copies (because mpz_divexact_ui run in linear time). The current functions don't let you construct an mpz_t object that

Re: Extending the mpn interface

2013-02-28 Thread Niels Möller
bodr...@mail.dm.unipi.it writes: A comment about roinit... This function trusts the caller with regards to normalisation. I'm not sure I like this. I think we should: - normalize (same code as mpz_limbs_finish) before setting SIZ, or - add an ASSERT (xs == 0 || xp[ABS (xs)] != 0), and add

Re: Extending the mpn interface

2013-02-28 Thread Marc Glisse
On Thu, 28 Feb 2013, Niels Möller wrote: And MPN_ROINIT_N can't normalize, of course. I think it could in modern languages (say C++11 for instance), but that's not the point, sorry for the digression. -- Marc Glisse ___ gmp-devel mailing list

Re: Extending the mpn interface

2013-02-23 Thread Marc Glisse
On Sat, 23 Feb 2013, Niels Möller wrote: ni...@lysator.liu.se (Niels Möller) writes: Another revision, this time as a patch. As you can see, I renamed things a bit more. Compile tested only... New patch below, including some testcases (no tests for mpz_roinit_n and MPZ_ROINIT_N though). I'd

Re: Extending the mpn interface

2013-02-23 Thread Niels Möller
Marc Glisse marc.gli...@inria.fr writes: Was the documentation in an earlier message (I couldn't find it)? There were more header comments in some of the earlier messages, most recently in http://gmplib.org/list-archives/gmp-devel/2013-February/002825.html. Should be added (as a new section?)

Re: Extending the mpn interface

2013-02-04 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: Here's a sketch (totally untested, not even compiled), supporting the operations I have seen a need for. As usual, good naming is the difficult part ;-) Here's a new iteration, which has actually had some testing. I think I'll be using these

Re: Extending the mpn interface

2013-01-28 Thread Zimmermann Paul
Dear Niels, But I miss some features in the public interface to do this [...] I'm glad you hit this issue. I hit it for GMP-ECM and MPFR several years ago. I reported missing functions in the public interface, and some of them were added during the years. You have to be patient. I would

Re: Extending the mpn interface

2013-01-28 Thread Emmanuel Thomé
On Mon, Jan 28, 2013 at 8:57 AM, Niels Möller ni...@lysator.liu.se wrote: But I miss some features in the public interface to do this conveniently; both for mpn - mpz interoperation, [...] For the first issue, it would be nice to have [...] +1. I've too been traveling with MPZ_SET_MPN,