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
|
|
|
|
acb_dirichlet_power(acb_t z, const acb_dirichlet_powers_t t, ulong n, slong prec)
|
|
|
|
{
|
2016-07-22 16:23:09 +02:00
|
|
|
if (!t->depth)
|
2016-04-12 15:07:04 +02:00
|
|
|
{
|
2016-07-22 16:23:09 +02:00
|
|
|
acb_pow_ui(z, t->z, n, prec);
|
2016-04-12 15:07:04 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-07-22 16:23:09 +02:00
|
|
|
slong k;
|
|
|
|
ulong r;
|
|
|
|
r = n % t->size;
|
|
|
|
n = n / t->size;
|
|
|
|
acb_set(z, t->Z[0] + r);
|
|
|
|
for (k = 1; k < t->depth && n; k++)
|
2016-04-12 15:07:04 +02:00
|
|
|
{
|
2016-07-22 16:23:09 +02:00
|
|
|
r = n % t->size;
|
|
|
|
n = n / t->size;
|
|
|
|
acb_mul(z, z, t->Z[k] + r, prec);
|
2016-04-12 15:07:04 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|