On Mon, 12 Jul 2021 at 23:36, Brent W. Baccala <
cos...@freesoft.org> wrote:
>
> On Monday, July 12, 2021 at 4:39:42 AM UTC-4 Bill Hart wrote:
>>
>> Hi Brent,
>>
>> I don't know of a specific instance of this in Flint. One of the
>> challenges with lists is using them from Julia, so I think we nowadays
>> prefer an array of fmpz_mpoly_t's instead of fmpz_mpoly_structs, for
>> example, when working just with a single array. I guess a list of
>> lists would just be an array of arrays, i.e. an fmpz_mpoly_t **.
>
>
> Are you thinking of a pointer (fmpz_mpoly_t **) to an array of pointers (fmpz_mpoly_t *) to arrays (fmpz_mpoly_t)?
I'm thinking of an array (fmpz_mpoly_t **) or arrays (fmpz_mpoly_t *)
of polynomials (fmpz_mpoly_t)
>
> Would the first array end with a NULL? Or pass in a length for it? And how would we communicate the length of the secondary arrays? An extra array of integers?
I would pass in an array of lengths, one for each of the (fmpz_mpoly_t
*)'s and a length for the number of elements in the first array
(fmpz_mpoly_t **)
>
> A problem I see with that is that, unlike the binary operators like fmpz_mpoly_mul, we'd have to create a new array of fmpz_mpoly_t's just to structure things properly to pass into the addmul function. Perhaps pointers to polynomials would be better; arrays of pointers to polynomials, and an array of pointers to arrays of pointers to polynomials. Still wondering the best way to encode the length of the arrays.
Why? If I have an array of polynomials, fmpz_mpoly_t * polyarr; then
to get the i-th polynomial is just polyarr[i]. That can be passed in
to addmul.
>
> I don't know Julia; I've been looking at how to do this from Sage/Python. It looks like I'll create a dynamically allocated array in the Cython code to pass into the FLINT function, so a single array of pointers to polynomials would be the most convenient. I'm currently ending each sub-list with a NULL pointer, and ending the entire list with two NULL pointers. Obviously a bit of a weird convention; it can be tweaked.
>
>>
>> Can I petition for a change of name though. addmul is used in flint
>> for c = a*b and this is a function we may want at some point. Perhaps
>> addmul_multi or something like that would be better.
>
>
> Sure, that sounds fine. fmpz_mpoly_addmul_multi, then?
Sure.
>
> agape
> brent
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "flint-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
flint-devel...@googlegroups.com.
> To view this discussion on the web, visit
https://groups.google.com/d/msgid/flint-devel/8b56fb8e-77da-46cc-b291-3be34d6af526n%40googlegroups.com.