@@ -554,12 +554,12 @@ Bit packing and unpacking
554554 coefficient of ``poly `` is bigger than ``bits/2 `` bits. We
555555 also assume ``bits < 3 * FLINT_BITS ``.
556556
557- .. function :: void _nmod_poly_bit_unpack(nn_ptr res, slong len , nn_srcptr mpn, ulong bits, nmod_t mod)
557+ .. function :: void _nmod_poly_bit_unpack(nn_ptr res, slong nlo, slong nhi , nn_srcptr mpn, ulong bits, nmod_t mod)
558558
559- Unpacks ``len `` coefficients stored in the big integer ``mpn ``
560- in bit fields of the given number of bits, reduces them modulo the
561- given modulus, then stores them in the polynomial ``res ``.
562- We assume ``len > 0 `` and `` 3 * FLINT_BITS > bits > 0 ``.
559+ Unpacks ``nhi - nlo `` coefficients stored in the big integer ``mpn ``
560+ in bit fields of the given number of bits, starting at offset `` nlo ``,
561+ reduces them modulo the given modulus, then stores them in the polynomial ``res ``.
562+ We assume ``3 * FLINT_BITS > bits > 0 ``.
563563 There are no restrictions on the size of the actual coefficients as
564564 stored within the bitfields.
565565
@@ -679,19 +679,14 @@ Multiplication
679679 coefficients from ``start `` onwards into the high coefficients of
680680 ``res ``, the remaining coefficients being arbitrary but reduced.
681681
682- .. function :: void _nmod_poly_mul_KS(nn_ptr out, nn_srcptr in1, slong len1, nn_srcptr in2, slong len2, flint_bitcnt_t bits, nmod_t mod)
682+ .. function :: void _nmod_poly_mul_KS(nn_ptr out, nn_srcptr in1, slong len1, nn_srcptr in2, slong len2, nmod_t mod)
683683
684- Sets ``res `` to the product of ``in1 `` and ``in2 ``
685- assuming the output coefficients are at most the given number of
686- bits wide. If ``bits `` is set to `0 ` an appropriate value is
687- computed automatically. Assumes that ``len1 >= len2 > 0 ``.
684+ Sets ``res `` to the product of ``in1 `` and ``in2 ``.
685+ Assumes that ``len1 >= len2 > 0 ``.
688686
689- .. function :: void nmod_poly_mul_KS(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2, flint_bitcnt_t bits )
687+ .. function :: void nmod_poly_mul_KS(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2)
690688
691- Sets ``res `` to the product of ``poly1 `` and ``poly2 ``
692- assuming the output coefficients are at most the given number of
693- bits wide. If ``bits `` is set to `0 ` an appropriate value
694- is computed automatically.
689+ Sets ``res `` to the product of ``poly1 `` and ``poly2 ``.
695690
696691.. function :: void _nmod_poly_mul_KS2(nn_ptr res, nn_srcptr op1, slong n1, nn_srcptr op2, slong n2, nmod_t mod)
697692
@@ -711,14 +706,14 @@ Multiplication
711706
712707 Sets ``res `` to the product of ``poly1 `` and ``poly2 ``.
713708
714- .. function :: void _nmod_poly_mullow_KS(nn_ptr out, nn_srcptr in1, slong len1, nn_srcptr in2, slong len2, flint_bitcnt_t bits, slong n, nmod_t mod)
709+ .. function :: void _nmod_poly_mullow_KS(nn_ptr out, nn_srcptr in1, slong len1, nn_srcptr in2, slong len2, slong n, nmod_t mod)
715710
716711 Sets ``out `` to the low `n ` coefficients of ``in1 `` of length
717712 ``len1 `` times ``in2 `` of length ``len2 ``. The output must have
718713 space for ``n `` coefficients. We assume that ``len1 >= len2 > 0 ``
719714 and that ``0 < n <= len1 + len2 - 1 ``.
720715
721- .. function :: void nmod_poly_mullow_KS(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2, flint_bitcnt_t bits, slong n)
716+ .. function :: void nmod_poly_mullow_KS(nmod_poly_t res, const nmod_poly_t poly1, const nmod_poly_t poly2, slong n)
722717
723718 Set ``res `` to the low `n ` coefficients of ``in1 `` of length
724719 ``len1 `` times ``in2 `` of length ``len2 ``.
@@ -746,6 +741,20 @@ Multiplication
746741 Sets ``res `` to the first ``trunc `` coefficients of the
747742 product of ``poly1 `` and ``poly2 ``.
748743
744+ .. function :: void _nmod_poly_mulmid(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, slong nlo, slong nhi, nmod_t mod)
745+ void nmod_poly_mulmid(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, slong nlo, slong nhi, nmod_t mod)
746+ void _nmod_poly_mulmid_classical(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, slong nlo, slong nhi, nmod_t mod)
747+ void nmod_poly_mulmid_classical(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, slong nlo, slong nhi, nmod_t mod)
748+ void _nmod_poly_mulmid_KS(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, slong nlo, slong nhi, nmod_t mod)
749+ void nmod_poly_mulmid_KS(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, slong nlo, slong nhi, nmod_t mod)
750+
751+ Sets ``res `` to the first ``nhi - nlo `` middle coefficients of the
752+ product of ``poly1 `` of length ``len1 `` and ``poly2 `` of
753+ length ``len2 `` starting at offset ``nlo ``.
754+ It is assumed that ``0 <= nlo < nhi <= len1 + len2 - 1 ``.
755+ The function :func: `_nmod_poly_mulmid_classical ` does not support
756+ aliasing between inputs and outputs, but all others do.
757+
749758.. function :: void _nmod_poly_mulhigh(nn_ptr res, nn_srcptr poly1, slong len1, nn_srcptr poly2, slong len2, slong n, nmod_t mod)
750759
751760 Sets all but the low `n ` coefficients of ``res `` to the
@@ -767,16 +776,17 @@ Multiplication
767776 other multiplication algorithms, given inputs of length *len1 * and *len2 *
768777 and output truncation to length *n *.
769778
770- .. function :: int _nmod_poly_mullow_fft_small_repack (nn_ptr z, nn_srcptr a, slong an, nn_srcptr b, slong bn, slong zn, nmod_t mod)
779+ .. function :: int _nmod_poly_mulmid_fft_small_repack (nn_ptr z, nn_srcptr a, slong an, nn_srcptr b, slong bn, slong znlo , slong zn, nmod_t mod)
771780
772781 Internal helper function for :func: `_nmod_poly_mullow_fft_small `: if the
773782 inputs are small enough to perform a repacked convolution of half the
774783 length, multiply and return 1, otherwise do nothing and return 0.
775- The conditions on the arguments are the same as for :func: `_nmod_poly_mullow `.
784+ The conditions on the arguments are the same as for :func: `_nmod_poly_mulmid_fft_small `.
776785
777- .. function :: void _nmod_poly_mullow_fft_small(nn_ptr z, nn_srcptr a, slong an, nn_srcptr b, slong bn, slong zn, nmod_t mod)
786+ .. function :: void _nmod_poly_mulmid_fft_small(nn_ptr z, nn_srcptr a, slong an, nn_srcptr b, slong bn, slong znlo, slong zn, nmod_t mod)
787+ void _nmod_poly_mullow_fft_small(nn_ptr z, nn_srcptr a, slong an, nn_srcptr b, slong bn, slong zn, nmod_t mod)
778788
779- Low multiplication via the *fft_small * module. Throws an error
789+ Multiplication via the *fft_small * module. Throws an error
780790 if *fft_small * is not available. The conditions on the arguments
781791 are the same as for :func: `_nmod_poly_mullow `.
782792
0 commit comments