2016-04-12 15:07:04 +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 General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
ARB is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with ARB; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
|
|
|
=============================================================================*/
|
|
|
|
/******************************************************************************
|
|
|
|
|
|
|
|
Copyright (C) 2016 Pascal Molin
|
|
|
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|