add dirichlet_char_is_primitive

This commit is contained in:
Fredrik Johansson 2016-11-28 09:59:30 +01:00
parent 4128a16951
commit 4227e0b0a8
2 changed files with 10 additions and 0 deletions

View file

@ -144,6 +144,12 @@ dirichlet_char_is_real(const dirichlet_group_t G, const dirichlet_char_t chi)
return G->q <= 4 || (nmod_mul(chi->n, chi->n, G->mod) == 1);
}
DIRICHLET_INLINE int
dirichlet_char_is_primitive(const dirichlet_group_t G, const dirichlet_char_t chi)
{
return (dirichlet_conductor_char(G, chi) == G->q);
}
ulong dirichlet_chi(const dirichlet_group_t G, const dirichlet_char_t chi, ulong n);
void dirichlet_vec_set_null(ulong *v, const dirichlet_group_t G, slong nv);

View file

@ -224,6 +224,10 @@ level of *number* and *char* object. Both case require no discrete log computati
Returns 1 if *chi* is a real character (iff it has order `\leq 2`).
.. function:: int dirichlet_char_is_primitive(const dirichlet_group_t G, const dirichlet_char_t chi)
Returns 1 if *chi* is primitive (iff its conductor is exactly *q*).
Character evaluation
-------------------------------------------------------------------------------