Skip to content

Commit

Permalink
order arguments in acb_vec_unit_roots
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalmolin committed Oct 30, 2017
1 parent dfa3343 commit 226ed94
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion acb.h
Expand Up @@ -1142,7 +1142,7 @@ void _acb_vec_sort_pretty(acb_ptr vec, slong len);

/* roots of unity */
void acb_unit_root(acb_t res, ulong order, slong prec);
void _acb_vec_unit_roots(acb_ptr z, slong len, slong order, slong prec);
void _acb_vec_unit_roots(acb_ptr z, slong order, slong len, slong prec);

ACB_INLINE slong
acb_allocated_bytes(const acb_t x)
Expand Down
2 changes: 1 addition & 1 deletion acb/test/t-vec_unit_roots.c
Expand Up @@ -51,7 +51,7 @@ int main()
acb_init(t);
fmpq_init(q);

_acb_vec_unit_roots(vec, len, order, prec);
_acb_vec_unit_roots(vec, order, len, prec);

for (k = 0; k < len; k++)
{
Expand Down
2 changes: 1 addition & 1 deletion acb/vec_unit_roots.c
Expand Up @@ -13,7 +13,7 @@
#include "acb.h"

void
_acb_vec_unit_roots(acb_ptr res, slong len, slong n, slong prec)
_acb_vec_unit_roots(acb_ptr res, slong n, slong len, slong prec)
{
int conj = 0;
slong k, len1, wp;
Expand Down
2 changes: 1 addition & 1 deletion acb_dft/bluestein.c
Expand Up @@ -26,7 +26,7 @@ _acb_vec_bluestein_factors(acb_ptr z, slong n, slong prec)
nmod_t n2;

z2n = _acb_vec_init(2 * n);
_acb_vec_unit_roots(z2n, 2 * n, -2 * n, prec);
_acb_vec_unit_roots(z2n, -2 * n, 2 * n, prec);
nmod_init(&n2, 2 * n);

for (k = 0, k2 = 0; k < n; k++)
Expand Down
2 changes: 1 addition & 1 deletion acb_dft/cyc.c
Expand Up @@ -27,7 +27,7 @@ _acb_dft_cyc_init_z_fac(acb_dft_cyc_t t, n_factor_t fac, slong dv, acb_ptr z, sl
if (DFT_VERB)
flint_printf("dft_cyc: init z[%wu]\n", t->n);
z = _acb_vec_init(t->n);
_acb_vec_unit_roots(z, t->n, -t->n, prec);
_acb_vec_unit_roots(z, -t->n, t->n, prec);
dz = 1;
t->zclear = 1;
}
Expand Down
4 changes: 2 additions & 2 deletions acb_dft/naive.c
Expand Up @@ -57,7 +57,7 @@ acb_dft_naive(acb_ptr w, acb_srcptr v, slong len, slong prec)
acb_ptr z, v1 = NULL;

z = _acb_vec_init(len);
_acb_vec_unit_roots(z, len, -len, prec);
_acb_vec_unit_roots(z, -len, len, prec);
if (w == v)
{
v1 = _acb_vec_init(len);
Expand All @@ -84,7 +84,7 @@ _acb_dft_naive_init(acb_dft_naive_t pol, slong dv, acb_ptr z, slong dz, slong le
if (DFT_VERB)
flint_printf("dft_naive: init z[%ld]\n",len);
pol->z = _acb_vec_init(len);
_acb_vec_unit_roots(pol->z, len, -len, prec);
_acb_vec_unit_roots(pol->z, -len, len, prec);
pol->dz = 1;
pol->zclear = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion acb_dft/rad2.c
Expand Up @@ -50,7 +50,7 @@ _acb_dft_rad2_init(acb_dft_rad2_t t, slong dv, int e, slong prec)
t->nz = t->n >> 1;
t->z = _acb_vec_init(t->nz);
/* set n/2 roots of order n */
_acb_vec_unit_roots(t->z, t->nz, -t->n, prec);
_acb_vec_unit_roots(t->z, -t->n, t->nz, prec);
}

/* remark: can use same rad2 with smaller power of 2 */
Expand Down
2 changes: 1 addition & 1 deletion doc/source/acb.rst
Expand Up @@ -1026,7 +1026,7 @@ Vector functions

Sets *xs* to the powers `1, x, x^2, \ldots, x^{len-1}`.

.. function:: void _acb_vec_unit_roots(acb_ptr z, slong len, slong order, slong prec)
.. function:: void _acb_vec_unit_roots(acb_ptr z, slong order, slong len, slong prec)

Sets *z* to the powers `1,z,z^2,\dots z^{\mathrm{len}-1}` where `z=\exp(\frac{2i\pi}{\mathrm{order}})` to precision *prec*.
*order* can be taken negative.
Expand Down

0 comments on commit 226ed94

Please sign in to comment.