2016-09-06 15:32:23 +02:00
|
|
|
/*
|
2016-03-22 11:29:21 +01:00
|
|
|
Copyright (C) 2016 Pascal Molin
|
2016-02-24 11:06:49 +01:00
|
|
|
|
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-02-24 11:06:49 +01:00
|
|
|
|
|
|
|
#include "acb_dirichlet.h"
|
|
|
|
|
2016-04-05 12:18:39 +02:00
|
|
|
void
|
2016-10-08 22:43:29 +02:00
|
|
|
acb_dirichlet_pairing_char(acb_t res, const dirichlet_group_t G, const dirichlet_char_t a, const dirichlet_char_t b, slong prec)
|
2016-02-24 11:06:49 +01:00
|
|
|
{
|
2016-04-05 12:18:39 +02:00
|
|
|
ulong expo;
|
2016-10-08 22:43:29 +02:00
|
|
|
expo = dirichlet_pairing_char(G, a, b);
|
2016-10-06 14:19:39 +02:00
|
|
|
if (expo == DIRICHLET_CHI_NULL)
|
2016-04-05 12:18:39 +02:00
|
|
|
acb_zero(res);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
fmpq_t t;
|
|
|
|
fmpq_init(t);
|
|
|
|
fmpq_set_si(t, 2 * expo, G->expo);
|
|
|
|
arb_sin_cos_pi_fmpq(acb_imagref(res), acb_realref(res), t, prec);
|
|
|
|
fmpq_clear(t);
|
|
|
|
}
|
2016-02-24 11:06:49 +01:00
|
|
|
}
|