mirror of
https://github.com/vale981/arb
synced 2025-03-06 01:41:39 -05:00
order arguments in acb_vec_unit_roots
This commit is contained in:
parent
dfa3343cb4
commit
226ed94603
8 changed files with 9 additions and 9 deletions
2
acb.h
2
acb.h
|
@ -1142,7 +1142,7 @@ void _acb_vec_sort_pretty(acb_ptr vec, slong len);
|
||||||
|
|
||||||
/* roots of unity */
|
/* roots of unity */
|
||||||
void acb_unit_root(acb_t res, ulong order, slong prec);
|
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_INLINE slong
|
||||||
acb_allocated_bytes(const acb_t x)
|
acb_allocated_bytes(const acb_t x)
|
||||||
|
|
|
@ -51,7 +51,7 @@ int main()
|
||||||
acb_init(t);
|
acb_init(t);
|
||||||
fmpq_init(q);
|
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++)
|
for (k = 0; k < len; k++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "acb.h"
|
#include "acb.h"
|
||||||
|
|
||||||
void
|
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;
|
int conj = 0;
|
||||||
slong k, len1, wp;
|
slong k, len1, wp;
|
||||||
|
|
|
@ -26,7 +26,7 @@ _acb_vec_bluestein_factors(acb_ptr z, slong n, slong prec)
|
||||||
nmod_t n2;
|
nmod_t n2;
|
||||||
|
|
||||||
z2n = _acb_vec_init(2 * n);
|
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);
|
nmod_init(&n2, 2 * n);
|
||||||
|
|
||||||
for (k = 0, k2 = 0; k < n; k++)
|
for (k = 0, k2 = 0; k < n; k++)
|
||||||
|
|
|
@ -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)
|
if (DFT_VERB)
|
||||||
flint_printf("dft_cyc: init z[%wu]\n", t->n);
|
flint_printf("dft_cyc: init z[%wu]\n", t->n);
|
||||||
z = _acb_vec_init(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;
|
dz = 1;
|
||||||
t->zclear = 1;
|
t->zclear = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ acb_dft_naive(acb_ptr w, acb_srcptr v, slong len, slong prec)
|
||||||
acb_ptr z, v1 = NULL;
|
acb_ptr z, v1 = NULL;
|
||||||
|
|
||||||
z = _acb_vec_init(len);
|
z = _acb_vec_init(len);
|
||||||
_acb_vec_unit_roots(z, len, -len, prec);
|
_acb_vec_unit_roots(z, -len, len, prec);
|
||||||
if (w == v)
|
if (w == v)
|
||||||
{
|
{
|
||||||
v1 = _acb_vec_init(len);
|
v1 = _acb_vec_init(len);
|
||||||
|
@ -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)
|
if (DFT_VERB)
|
||||||
flint_printf("dft_naive: init z[%ld]\n",len);
|
flint_printf("dft_naive: init z[%ld]\n",len);
|
||||||
pol->z = _acb_vec_init(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->dz = 1;
|
||||||
pol->zclear = 1;
|
pol->zclear = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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->nz = t->n >> 1;
|
||||||
t->z = _acb_vec_init(t->nz);
|
t->z = _acb_vec_init(t->nz);
|
||||||
/* set n/2 roots of order n */
|
/* 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 */
|
/* remark: can use same rad2 with smaller power of 2 */
|
||||||
|
|
|
@ -1026,7 +1026,7 @@ Vector functions
|
||||||
|
|
||||||
Sets *xs* to the powers `1, x, x^2, \ldots, x^{len-1}`.
|
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*.
|
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.
|
*order* can be taken negative.
|
||||||
|
|
Loading…
Add table
Reference in a new issue