mirror of
https://github.com/vale981/arb
synced 2025-03-05 09:21:38 -05:00
fix acb_dft_crt_clear
This commit is contained in:
parent
50548c194e
commit
8212b68050
5 changed files with 26 additions and 19 deletions
19
acb_dft.h
19
acb_dft.h
|
@ -249,7 +249,7 @@ acb_dft_rad2_init(acb_dft_rad2_t t, int e, slong prec)
|
|||
ACB_DFT_INLINE void
|
||||
acb_dft_rad2_clear(acb_dft_rad2_t t)
|
||||
{
|
||||
_acb_vec_clear(t->z, 2 * t->nz);
|
||||
_acb_vec_clear(t->z, t->n);
|
||||
}
|
||||
|
||||
void _acb_dft_bluestein_init(acb_dft_bluestein_t t, slong dv, slong n, slong prec);
|
||||
|
@ -268,21 +268,8 @@ acb_dft_bluestein_clear(acb_dft_bluestein_t t)
|
|||
}
|
||||
|
||||
void _acb_dft_crt_init(acb_dft_crt_t crt, slong dv, slong len, slong prec);
|
||||
|
||||
ACB_DFT_INLINE void
|
||||
acb_dft_crt_init(acb_dft_crt_t crt, slong len, slong prec)
|
||||
{
|
||||
crt->n = len;
|
||||
crt_init(crt->c, len);
|
||||
crt->dv = 1;
|
||||
crt->cyc = _acb_dft_steps_prod(crt->c->m, crt->c->num, prec);
|
||||
}
|
||||
|
||||
ACB_DFT_INLINE void
|
||||
acb_dft_crt_clear(acb_dft_crt_t crt)
|
||||
{
|
||||
flint_free(crt->cyc);
|
||||
}
|
||||
void acb_dft_crt_init(acb_dft_crt_t crt, slong len, slong prec);
|
||||
void acb_dft_crt_clear(acb_dft_crt_t crt);
|
||||
|
||||
/* utils, could be moved elsewhere */
|
||||
|
||||
|
|
|
@ -151,6 +151,24 @@ _acb_dft_crt_init(acb_dft_crt_t crt, slong dv, slong len, slong prec)
|
|||
crt->cyc = _acb_dft_steps_prod(crt->c->m, crt->c->num, prec);
|
||||
}
|
||||
|
||||
void
|
||||
acb_dft_crt_init(acb_dft_crt_t crt, slong len, slong prec)
|
||||
{
|
||||
crt->n = len;
|
||||
crt_init(crt->c, len);
|
||||
crt->dv = 1;
|
||||
crt->cyc = _acb_dft_steps_prod(crt->c->m, crt->c->num, prec);
|
||||
}
|
||||
|
||||
void
|
||||
acb_dft_crt_clear(acb_dft_crt_t crt)
|
||||
{
|
||||
slong i;
|
||||
for (i = 0; i < crt->c->num; i++)
|
||||
acb_dft_precomp_clear(crt->cyc[i].pre);
|
||||
flint_free(crt->cyc);
|
||||
}
|
||||
|
||||
void
|
||||
acb_dft_crt_precomp(acb_ptr w, acb_srcptr v, const acb_dft_crt_t crt, slong prec)
|
||||
{
|
||||
|
|
|
@ -24,9 +24,6 @@ _acb_dft_naive(acb_ptr w, acb_srcptr v, slong dv, acb_srcptr z, slong dz, slong
|
|||
{
|
||||
flint_printf("\n_acb_dft_naive: does not accept aliasing\n");
|
||||
abort();
|
||||
v1 = _acb_vec_init(len);
|
||||
_acb_vec_set(v1, v, len);
|
||||
v = v1;
|
||||
}
|
||||
|
||||
for (i = 0, wi = w; i < len; i++, wi++)
|
||||
|
@ -72,6 +69,7 @@ acb_dft_naive(acb_ptr w, acb_srcptr v, slong len, slong prec)
|
|||
|
||||
if (v1)
|
||||
_acb_vec_clear(v1, len);
|
||||
|
||||
_acb_vec_clear(z, len);
|
||||
}
|
||||
|
||||
|
|
|
@ -127,6 +127,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
_acb_vec_clear(u, len[i]);
|
||||
_acb_vec_clear(v, len[i]);
|
||||
_acb_vec_clear(w, len[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -130,6 +130,9 @@ int main()
|
|||
|
||||
check_vec_eq_prec(w1, w2, n, prec, digits, n, "rad2", "pol", "rad2");
|
||||
|
||||
_acb_vec_clear(v, n);
|
||||
_acb_vec_clear(w1, n);
|
||||
|
||||
}
|
||||
|
||||
flint_randclear(state);
|
||||
|
|
Loading…
Add table
Reference in a new issue