2016-09-06 15:32:23 +02:00
|
|
|
/*
|
2016-04-12 15:07:04 +02:00
|
|
|
Copyright (C) 2016 Pascal Molin
|
|
|
|
|
2016-09-06 15:32:23 +02:00
|
|
|
This file is part of Arb.
|
|
|
|
|
|
|
|
Arb is free software: you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU Lesser General Public License (LGPL) as published
|
|
|
|
by the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version. See <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2016-04-12 15:07:04 +02:00
|
|
|
|
|
|
|
#include "acb_dirichlet.h"
|
|
|
|
#include "acb_poly.h"
|
|
|
|
|
|
|
|
void
|
2016-07-22 16:23:09 +02:00
|
|
|
_acb_dirichlet_powers_init(acb_dirichlet_powers_t t, ulong order, slong size, slong depth, slong prec)
|
2016-04-12 15:07:04 +02:00
|
|
|
{
|
2016-07-22 16:23:09 +02:00
|
|
|
slong k;
|
2016-04-12 15:07:04 +02:00
|
|
|
t->order = order;
|
2016-07-22 16:23:09 +02:00
|
|
|
acb_init(t->z);
|
2016-10-06 12:39:42 +02:00
|
|
|
acb_nth_root(t->z, order, prec);
|
2016-07-22 16:23:09 +02:00
|
|
|
t->size = size;
|
|
|
|
t->depth = depth;
|
|
|
|
if (depth)
|
2016-04-12 15:07:04 +02:00
|
|
|
{
|
2016-07-22 16:23:09 +02:00
|
|
|
acb_struct * z;
|
|
|
|
z = t->z + 0;
|
|
|
|
t->Z = flint_malloc(depth * sizeof(acb_ptr));
|
|
|
|
for (k = 0; k < depth; k++)
|
|
|
|
{
|
|
|
|
t->Z[k] = _acb_vec_init(size);
|
|
|
|
_acb_vec_set_powers(t->Z[k], z, size, prec);
|
|
|
|
z = t->Z[k] + 1;
|
|
|
|
}
|
2016-04-12 15:07:04 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
t->Z = NULL;
|
|
|
|
}
|
2016-07-22 16:23:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
acb_dirichlet_powers_init(acb_dirichlet_powers_t t, ulong order, slong num, slong prec)
|
|
|
|
{
|
|
|
|
slong size, depth;
|
|
|
|
|
|
|
|
depth = (num > order) ? 1 : n_flog(order, num);
|
|
|
|
size = n_root(order, depth) + 1;
|
|
|
|
|
|
|
|
_acb_dirichlet_powers_init(t, order, size, depth, prec);
|
2016-04-12 15:07:04 +02:00
|
|
|
}
|