#15915: add discrete Gaussian samplers to Sage
-------------------------------------+-------------------------------------
Reporter: malb | Owner:
Type: enhancement | Status: needs_info
Priority: major | Milestone: sage-6.3
Component: statistics | Resolution:
Keywords: sd59 | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/saraedum/ticket/15915 | d57f528a2e79c700f72d6144a2b3045760284f70
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by malb):
Replying to [comment:26 saraedum]:
> Some comments/questions:
>
> In the `fmpz_poly` linkage: What is the except -2 good for? Do these
flint methods return -2 on error? Shouldn't you use sig_on()/sig_off()
rather?
It's the standard signature of {{{clement_*}}} functions used by
polynomial templates. Specifiying -2 there allows to throw exceptions in C
functions. This code wasn't meant to be in this ticket, though, see above.
My apologies. The code in question belonged to #16574 but has been
removed.
> What is the reason for the following in
`Polynomial_integer_dense_flint`?
> {{{
> - elif not isinstance(x, list):
> - x = [x] # constant polynomials
> + else:
> + try:
> + x = list(x)
> + except TypeError:
> + x = [x] # constant polynomials
> }}}
This code wasn't meant to be in this ticket, my apologoies. It belongs in
#16574. It allows {{{R(tuple(x))}}} and {{{R(vector(x))}}} to go through.
> In `polynomial_quotient_ring.py`, why don't you use `r"""` so you can
write `\ZZ`?
I could do that, I find the other notation more straight-forward, is there
a particular reason why one is preferable to the other?
> Also, there are now a lot of unicode characters; even though you put an
encoding in the header, my vim does not understand these characters
(strangely) and they also confused the patchbot.
I can remove them but that'd make the code less readable IMHO.
> I stopped reading at `dgs.h`. Would you mind relicensing this as GPLv2+?
I have no strong feelings either way, what would be the advantage? I am
quite happy with the code being BSD, it's not very sophisticated and BSD
licensing it allows anyone to use it.
> Should such things not be in an SPKG?
The C code really does only one thing, so an SPKG would be a bit of an
overkill. Also, SPKG's take votes and extra bureaucracy. I'd like to avoid
that, it's hard enough to get this stuff reviewed.
> I wonder if the amount of documentation is sufficient for including it
directly in Sage and also if anybody can really review this (I cannot
review that part I'm afraid.)
Daniel Cabarcas reviewed the C part. I can add more documentation.
--
Ticket URL: <http://trac.sagemath.org/ticket/15915#comment:30>
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.