2016-09-06 15:32:23 +02:00
|
|
|
/*
|
2016-06-15 11:33:01 +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-06-15 11:33:01 +02:00
|
|
|
|
2016-10-06 14:19:39 +02:00
|
|
|
#include "dirichlet.h"
|
2016-06-15 11:33:01 +02:00
|
|
|
|
|
|
|
ulong
|
2016-10-08 17:22:19 +02:00
|
|
|
dirichlet_conductor_char(const dirichlet_group_t G, const dirichlet_char_t x)
|
2016-06-15 11:33:01 +02:00
|
|
|
{
|
|
|
|
int k, f;
|
|
|
|
ulong cond = 1;
|
|
|
|
|
|
|
|
if (G->neven >= 1 && x->log[0] == 1)
|
|
|
|
cond = 4;
|
|
|
|
if (G->neven == 2 && x->log[1])
|
|
|
|
{
|
|
|
|
ulong l2 = x->log[1];
|
|
|
|
f = n_remove(&l2, 2);
|
2020-03-10 00:16:34 +01:00
|
|
|
cond = UWORD(1) << (G->P[1].e - f);
|
2016-06-15 11:33:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
for (k = G->neven; k < G->num; k++)
|
|
|
|
{
|
|
|
|
if (x->log[k])
|
|
|
|
{
|
|
|
|
ulong p, lp;
|
2016-07-06 18:39:29 +02:00
|
|
|
p = G->P[k].p;
|
2016-06-15 11:33:01 +02:00
|
|
|
lp = x->log[k];
|
|
|
|
f = n_remove(&lp, p);
|
|
|
|
if (f)
|
2016-07-06 18:39:29 +02:00
|
|
|
cond *= n_pow(p, G->P[k].e - f);
|
2016-06-15 11:33:01 +02:00
|
|
|
else
|
2016-07-06 18:39:29 +02:00
|
|
|
cond *= G->P[k].pe.n;
|
2016-06-15 11:33:01 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return cond;
|
|
|
|
}
|